.. oe:namespace:: OEPlatform



.. meta::
   :keywords: oeisstream, isstream


.. _OEPlatform_oeisstream:

.. oe:class:: oeisstream

   .. oe:api::


      class oeisstream : public oeistream

   This class represents `oeisstream`.

   Implements an input stream that uses a string of data already in
   memory as the input source.

   The following methods are publicly inherited from :ref:`oeistream <OEPlatform_oeistream>`:

   ======================================================== ======================================================= =======================================================
   :oe:meth:`operator>><OEPlatform::oeistream::operator>>>` :oe:meth:`gettoken<OEPlatform::oeistream::gettoken>`    :oe:meth:`skipbyte<OEPlatform::oeistream::skipbyte>`   
   :oe:meth:`close<OEPlatform::oeistream::close>`           :oe:meth:`open<OEPlatform::oeistream::open>`            :oe:meth:`skipline<OEPlatform::oeistream::skipline>`   
   :oe:meth:`get<OEPlatform::oeistream::get>`               :oe:meth:`peekbyte<OEPlatform::oeistream::peekbyte>`                                                           
   :oe:meth:`getbyte<OEPlatform::oeistream::getbyte>`       :oe:meth:`read<OEPlatform::oeistream::read>`                                                                   
   :oe:meth:`getline<OEPlatform::oeistream::getline>`       :oe:meth:`skip<OEPlatform::oeistream::skip>`                                                                   
   ======================================================== ======================================================= =======================================================

   The following methods are publicly inherited from :ref:`oestream <OEPlatform_oestream>`:

   ============================================================= ============================================================ ============================================================
   :oe:meth:`operator bool<OEPlatform::oestream::operator bool>` :oe:meth:`rewind<OEPlatform::oestream::rewind>`              :oe:meth:`tell<OEPlatform::oestream::tell>`                 
   :oe:meth:`eof<OEPlatform::oestream::eof>`                     :oe:meth:`seek<OEPlatform::oestream::seek>`                                                                              
   :oe:meth:`length<OEPlatform::oestream::length>`               :oe:meth:`size<OEPlatform::oestream::size>`                                                                              
   ============================================================= ============================================================ ============================================================

   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            oeisstream()
            oeisstream(const oeisstream& rhs)
            oeisstream(const std::string& buffer)
            oeisstream(char* buffer, oesize_t len, bool copy = true)
            oeisstream(const char* buffer, oesize_t len, bool copy = true)

      .. oe:language:: python

         .. oe:api:: python

            oeisstream(buffer: str, len: oesize_t, copy: bool = True) -> oeisstream
            oeisstream(buffer: str) -> oeisstream
            oeisstream() -> oeisstream
            oeisstream(rhs: oeisstream) -> oeisstream

      Creates a new :ref:`oeisstream <OEPlatform_oeisstream>`.
      Passing any of the specified parameters
      to the one of the non-default constructors is equivalent to
      creating a new :ref:`oeisstream <OEPlatform_oeisstream>` with the default
      constructor and then
      calling the appropriate :oe:meth:`OEPlatform::oeisstream::set` method 
      on that stream.

      If the copy constructor is used, the newly created oeisstream will
      read from the same data string as the stream being copied from. If
      the 'copy' parameter was set to ``true`` on the stream being copied from,
      the new stream will create its own local copy to read from,
      otherwise it will just point to the same place in memory as the
      original stream. In addition, the newly constructed stream's
      reading pointer will be set to the same location as the one in the
      stream being copied from.

      Regardless of whether or not a local copy is made, the stream takes
      no responsibility for the management of the original input source's
      memory.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         oeisstream &operator=(const oeisstream &rhs)

      Clears the current stream and sets the input source of this stream
      to be the same as the one in the assigned stream. If the copy
      parameter was set to ``true`` on the assigned stream, the stream will
      create its own local copy to read from, otherwise it will just
      point to the same place in memory as the assigned stream. In
      addition, the stream's reading pointer will be set to the same
      location as the one in the assigned stream.

      Assignment operator.


   .. oe:method:: clear

      .. oe:language:: c++ java csharp

         .. oe:api::

            void clear()

      .. oe:language:: python

         .. oe:api:: python

            clear() -> None

      Clears the association with input source associated with this
      stream. If the copy parameter was set to ``false`` when this stream was
      assigned or constructed, no changes will be made to the original
      data source.

   .. oe:method:: getbuffer

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool getbuffer(std::string& buffer) const

      .. oe:language:: python

         .. oe:api:: python

            getbuffer(buffer: str) -> bool

      Copies the entire contents of the input source into the specified
      string regardless of the current location of the reading pointer
      and returns whether or not this was successful.

   .. oe:method:: reset

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool reset()

      .. oe:language:: python

         .. oe:api:: python

            reset() -> bool

      Resets the reading pointer to the beginning of the input stream and
      returns whether or not this was successful. This is equivalent to
      calling the :oe:meth:`OEPlatform::oestream::rewind` method of  
      :ref:`oestream <OEPlatform_oestream>`.

   .. oe:method:: set

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool set(const std::string &)
            bool set(char *, oesize_t, bool)
            bool set(const char *, oesize_t, bool)

      .. oe:language:: python

         .. oe:api:: python

            set(arg2: str) -> bool
            set(arg2: str, arg3: oesize_t, arg4: bool) -> bool

      Sets the input source of this stream based on the specified
      parameters. The buffer parameter specifies the data string to be
      used as the input source. If the ``char *`` constructors are used, the
      length of the input buffer must be specified as well as whether or
      not a local copy of the buffer should be made and used as the input
      source. If the ``std::string`` method is used, a local copy of the
      input string will be made and used as the input source.

      Regardless of whether or not a local copy is made, the stream takes
      no responsibility for the management of the original input source's
      memory.
