.. index:: pair: class; EE::System::IOStreamString .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string: class EE::System::IOStreamString ================================ .. toctree:: :hidden: Overview ~~~~~~~~ Implementation of a memory stream file using an std::string as a container. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class IOStreamString: public :ref:`EE::System::IOStream` { public: // construction :target:`IOStreamString`(); :target:`IOStreamString`(const std::string& filepath); // methods virtual :ref:`ios_size` :ref:`read`(char* data, :ref:`ios_size` size); virtual :ref:`ios_size` :ref:`write`(const char* data, :ref:`ios_size` size); virtual :ref:`ios_size` :target:`write`(const std::string& string); virtual :ref:`ios_size` :ref:`seek`(:ref:`ios_size` position); virtual :ref:`ios_size` :ref:`tell`(); virtual :ref:`ios_size` :ref:`getSize`(); virtual bool :ref:`isOpen`(); void :target:`clear`(); const char* :ref:`getPositionPointer`(); const char* :ref:`getStreamPointer`() const; const std::string& :target:`getStream`() const; }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods virtual :ref:`ios_size` :ref:`read`(char* data, :ref:`ios_size` size) = 0; virtual :ref:`ios_size` :ref:`write`(const char* data, :ref:`ios_size` size) = 0; virtual :ref:`ios_size` :ref:`seek`(:ref:`ios_size` position) = 0; virtual :ref:`ios_size` :ref:`tell`() = 0; virtual :ref:`ios_size` :ref:`getSize`() = 0; virtual bool :ref:`isOpen`() = 0; .. _details-class_e_e_1_1_system_1_1_i_o_stream_string: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Implementation of a memory stream file using an std::string as a container. Methods ------- .. index:: pair: function; read .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string_1ada8ab76010e5e98282ef4d322004a5e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`ios_size` read(char* data, :ref:`ios_size` size) Read data from the stream. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - data - Buffer where to copy the read data * - size - Desired number of bytes to read .. rubric:: Returns: The number of bytes actually read .. index:: pair: function; write .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string_1a339419cdf9ddd67fec3e39581b91166e: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`ios_size` write(const char* data, :ref:`ios_size` size) Write data to the virtual file. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - data - Data to write in the file * - size - Size of the data that needs to be writed .. index:: pair: function; seek .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string_1a4632e8179783c6aa98d449ffc8894586: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`ios_size` seek(:ref:`ios_size` position) Change the current reading position. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - position - The position to seek to, from the beginning .. rubric:: Returns: The position actually sought to. .. index:: pair: function; tell .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string_1adf72cf4f0b5b004c583e5b8ff5c001ad: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`ios_size` tell() Get the current reading position in the stream. .. rubric:: Returns: The current position, or -1 on error. .. index:: pair: function; getSize .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string_1a5b67b94205d0d0610cf2b3ffd851cfd3: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`ios_size` getSize() Return the size of the stream. .. rubric:: Returns: The total number of bytes available in the stream .. index:: pair: function; isOpen .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string_1a6b6a3d249f1926d8b8520daf69c7ade0: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isOpen() .. rubric:: Returns: If the virtual stream file is open .. index:: pair: function; getPositionPointer .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string_1a8768894e6d7d1701112ed1c806b6ed98: .. ref-code-block:: cpp :class: doxyrest-title-code-block const char* getPositionPointer() .. rubric:: Returns: Pointer to the current position in the stream .. index:: pair: function; getStreamPointer .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_string_1a0fa5b7bd3a6dca1aa176e9ebe7ebfb69: .. ref-code-block:: cpp :class: doxyrest-title-code-block const char* getStreamPointer() const .. rubric:: Returns: The pointer to the beggining of the stream