.. index:: pair: class; EE::System::IOStreamMemory .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_memory: class EE::System::IOStreamMemory ================================ .. toctree:: :hidden: Overview ~~~~~~~~ Implementation of a memory stream file. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class IOStreamMemory: public :ref:`EE::System::IOStream` { public: // construction :ref:`IOStreamMemory`(const char* data, :ref:`ios_size` size); :ref:`IOStreamMemory`(char* data, :ref:`ios_size` size); virtual :target:`~IOStreamMemory`(); // methods static IOStreamMemory* :target:`New`(const char* data, :ref:`ios_size` size); static IOStreamMemory* :target:`New`(char* data, :ref:`ios_size` size); 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` :ref:`seek`(:ref:`ios_size` position); virtual :ref:`ios_size` :ref:`tell`(); virtual :ref:`ios_size` :ref:`getSize`(); virtual bool :ref:`isOpen`(); }; 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_memory: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Implementation of a memory stream file. Construction ------------ .. index:: pair: function; IOStreamMemory .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_memory_1a7c7c4f7b617442853b7fd6c4abb22cf6: .. ref-code-block:: cpp :class: doxyrest-title-code-block IOStreamMemory(const char* data, :ref:`ios_size` size) Use the data buffer for reading. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - data - The buffer to read from * - size - The size of the buffer .. index:: pair: function; IOStreamMemory .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_memory_1a3ab3928d827a69704d8f71c0df0cac11: .. ref-code-block:: cpp :class: doxyrest-title-code-block IOStreamMemory(char* data, :ref:`ios_size` size) Use the data buffer for writing. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - data - The buffer to write to * - size - The size of the buffer Methods ------- .. index:: pair: function; read .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_memory_1a4d65bd4759dede4d54b0c24fb44475f3: .. 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_memory_1afce19d4897158b81be5ac9b17b7658c1: .. 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_memory_1a7c4f5895eb00253118a58385253eb849: .. 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_memory_1a4af7adc777c535738ddcdd27cbff9cdd: .. 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_memory_1a0811f2791bc174c799c7d4459c1ef4b9: .. 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_memory_1a2fe0e7abc2d957f70305b42450fbeaa7: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isOpen() .. rubric:: Returns: If the virtual stream file is open