.. index:: pair: class; EE::System::IOStreamFile .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_file: class EE::System::IOStreamFile ============================== .. toctree:: :hidden: Overview ~~~~~~~~ An implementation for a file system file steam. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class IOStreamFile: public :ref:`EE::System::IOStream` { public: // construction :ref:`IOStreamFile`(const std::string& path, const std::string& modes = "rb"); virtual :target:`~IOStreamFile`(); // methods static IOStreamFile* :target:`New`(const std::string& path, const std::string& modes = "rb"); 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`(); void :ref:`flush`(); void :target:`close`(); }; 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_file: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ An implementation for a file system file steam. Construction ------------ .. index:: pair: function; IOStreamFile .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_file_1abc23ded1b82be33a4d819f1ad2b1c184: .. ref-code-block:: cpp :class: doxyrest-title-code-block IOStreamFile(const std::string& path, const std::string& modes = "rb") Open a file from the file system. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - path - File to open from path * - modes - The open mode that it will be used for the file ( default read-binary ) Methods ------- .. index:: pair: function; read .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_file_1a549b96c926a6837551f8d0b60b1c2053: .. 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_file_1aa3e5ac73da88437a2fd6cecb5855af44: .. 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_file_1a3f5f076bad0c1a381b73e2653a3b07ca: .. 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_file_1a80637f4e2a30790be96437d6208258a5: .. 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_file_1ac1c71a48440f0357cbe00434a4c74dcd: .. 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_file_1a77d3132f19acdad9412b74cb861cb9cc: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isOpen() .. rubric:: Returns: If the virtual stream file is open .. index:: pair: function; flush .. _doxid-class_e_e_1_1_system_1_1_i_o_stream_file_1a9bfbbac5e5489627bfaefad9bfc67eb6: .. ref-code-block:: cpp :class: doxyrest-title-code-block void flush() Synchronizes the buffer associated with the stream to its controlled output sequence. This effectively means that all unwritten characters in the buffer are written to its controlled output sequence as soon as possible.