.. oe:namespace:: OEPlatform



.. meta::
   :keywords: oeosstream, osstream


.. _OEPlatform_oeosstream:

.. oe:class:: oeosstream

   .. oe:api::


      class oeosstream : public oeostream

   This class represents `oeosstream`.

   Implements an output stream that writes into an internally
   contained string.

   The following methods are publicly inherited from :ref:`oeostream <OEPlatform_oeostream>`:


   ========================================================= ======================================================= =======================================================
   :oe:meth:`operator\< <OEPlatform::oeostream::operator<<>` :oe:meth:`flush<OEPlatform::oeostream::flush>`          :oe:meth:`putbyte<OEPlatform::oeostream::putbyte>`     
   :oe:meth:`close<OEPlatform::oeostream::close>`            :oe:meth:`open<OEPlatform::oeostream::open>`            :oe:meth:`write<OEPlatform::oeostream::write>`         
   ========================================================= ======================================================= =======================================================

   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::

            oeosstream()
            oeosstream(const char *)
            oeosstream(const unsigned char *, oesize_t)

      .. oe:language:: python

         .. oe:api:: python

            oeosstream() -> oeosstream
            oeosstream(arg2: str, arg3: oesize_t) -> oeosstream
            oeosstream(arg2: str) -> oeosstream

      Creates a new :ref:`oeosstream <OEPlatform_oeosstream>` which is immediately ready to be written
      to. Passing any of the specified parameters to one of the
      non-default constructors is equivalent to creating a new 
      :ref:`oeosstream <OEPlatform_oeosstream>`
      with the default constructor and then calling the appropriate 
      :oe:meth:`OEPlatform::oeosstream::set` method.

      If the copy constructor is used, the entire contents of the other
      stream's internal string are copied into the newly constructed
      stream's internal string.


   .. oe:method:: clear

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

         .. oe:api::

            void clear()

      .. oe:language:: python

         .. oe:api:: python

            clear() -> None

      Clears the contents of the internal string.

   .. oe:method:: set

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

         .. oe:api::

            bool set(const char * buffer)
            bool set(const unsigned char *, oesize_t len)

      .. oe:language:: python

         .. oe:api:: python

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

      Sets the contents of the internal string to the contents of the
      specified 'buffer'. If the 'len' parameter is not specified, this
      method will copy the contents of the specified 'buffer' until a null
      character is reached. The null character is not copied. Returns
      whether or not the contents were successfully copied.



   .. oe:method:: str

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

         .. oe:api::

            std::string str()

      .. oe:language:: python

         .. oe:api:: python

            str() -> bytes

      Returns a copy of the current internal string.

