Base class for streams that support both read and write operations. More...
#include <datastream.h>
Public Member Functions | |
IOStream (std::streambuf *Buf) | |
Class constructor. More... | |
virtual | ~IOStream () |
Class destructor. | |
virtual void | Advance (const StreamOff Count) |
Advances the position in the stream. More... | |
virtual Boole | Bad () const |
Gets whether or not a critical error was detected in a previous operation in the stream. More... | |
virtual void | ClearErrors () |
Clears any stored error state on the stream. More... | |
virtual Boole | EoF () const |
Gets whether or not the current position is at the end of the stream. More... | |
virtual Boole | Fail () const |
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in the stream. More... | |
virtual String | GetAsString () |
Gets the contents of the stream as a string. More... | |
virtual String | GetLine (Boole Trim=true) |
Gets the contents of the current line in the stream. More... | |
virtual StreamPos | GetReadPosition () |
Gets the current read position in this stream. More... | |
virtual StreamPos | GetStreamPosition (const Boole Read=true) |
Gets the current position in this stream. More... | |
virtual StreamPos | GetWritePosition () |
Gets the current write position in this stream. More... | |
virtual Boole | IsValid () const |
Gets whether or not this stream is intact and ready for operations. More... | |
virtual size_t | Read (void *Buffer, StreamSize Size) |
Reads from the stream and copies that data to a buffer. More... | |
virtual size_t | ReadLine (Char8 *Buffer, size_t MaxCount, const String &Delim="\n") |
Reads a single line from a string. More... | |
virtual void | SetReadPosition (StreamPos Position) |
Sets the position of the read cursor explicitly. More... | |
virtual void | SetReadPosition (StreamOff Offset, SeekOrigin Origin) |
Sets the position of the read cursor. More... | |
virtual void | SetStreamPosition (StreamPos Position) |
Sets the position of the read and write cursors explicitly. More... | |
virtual void | SetStreamPosition (StreamOff Offset, SeekOrigin Origin) |
Sets the position of the read and write cursors. More... | |
virtual void | SetWritePosition (StreamPos Position) |
Sets the position of the write cursor explicitly. More... | |
virtual void | SetWritePosition (StreamOff Offset, SeekOrigin Origin) |
Sets the position of the write cursor. More... | |
virtual size_t | SkipLine (const String &Delim="\n") |
Moves the current position to the start of the next line. More... | |
virtual size_t | Write (const void *Buffer, StreamSize Size) |
Writes data to the stream. More... | |
Public Member Functions inherited from Mezzanine::Resource::iInStream | |
iInStream () | |
Class constructor. | |
virtual | ~iInStream () |
Class destructor. | |
Public Member Functions inherited from Mezzanine::Resource::iStreamBase | |
iStreamBase () | |
Class constructor. | |
virtual | ~iStreamBase () |
Class destructor. | |
virtual StreamSize | GetSize () const =0 |
Gets the size of the stream. More... | |
Public Member Functions inherited from Mezzanine::Resource::iOutStream | |
iOutStream () | |
Class constructor. | |
virtual | ~iOutStream () |
Class destructor. | |
Base class for streams that support both read and write operations.
Definition at line 263 of file datastream.h.
Mezzanine::Resource::IOStream::IOStream | ( | std::streambuf * | Buf | ) |
Class constructor.
Buf | A pointer to the buffer that will be streamed. |
Definition at line 152 of file datastream.cpp.
|
virtual |
Advances the position in the stream.
Count | The number of bytes to skip/advance in the stream from the current position. |
Definition at line 216 of file datastream.cpp.
|
virtual |
Gets whether or not a critical error was detected in a previous operation in the stream.
Implements Mezzanine::Resource::iStreamBase.
Definition at line 165 of file datastream.cpp.
|
virtual |
Clears any stored error state on the stream.
Implements Mezzanine::Resource::iStreamBase.
Definition at line 174 of file datastream.cpp.
|
virtual |
Gets whether or not the current position is at the end of the stream.
Implements Mezzanine::Resource::iStreamBase.
Definition at line 162 of file datastream.cpp.
|
virtual |
Gets whether or not an otherwise silent and recoverable error was detected in a previous operation in the stream.
Implements Mezzanine::Resource::iStreamBase.
Definition at line 168 of file datastream.cpp.
|
virtual |
Gets the contents of the stream as a string.
Definition at line 240 of file datastream.cpp.
Gets the contents of the current line in the stream.
Trim | Whether or not to trim whitespaces on both sides of the string. |
Definition at line 295 of file datastream.cpp.
|
virtual |
Gets the current read position in this stream.
Implements Mezzanine::Resource::iInStream.
Definition at line 192 of file datastream.cpp.
Gets the current position in this stream.
Read | Whether or not to get the Read position. If false this will get the write position instead. |
Definition at line 231 of file datastream.cpp.
|
virtual |
Gets the current write position in this stream.
Implements Mezzanine::Resource::iOutStream.
Definition at line 210 of file datastream.cpp.
|
virtual |
Gets whether or not this stream is intact and ready for operations.
Implements Mezzanine::Resource::iStreamBase.
Definition at line 171 of file datastream.cpp.
|
virtual |
Reads from the stream and copies that data to a buffer.
Buffer | The buffer to be populated with the read data. |
Size | The number of bytes to read from the stream. |
Implements Mezzanine::Resource::iInStream.
Definition at line 180 of file datastream.cpp.
|
virtual |
Reads a single line from a string.
Buffer | Pointer to the buffer to copy to. |
MaxCount | The maximum number of bytes to read. Usually you want this to be your buffer size. |
Delim | The character that marks the end of a line. |
Definition at line 256 of file datastream.cpp.
|
virtual |
Sets the position of the read cursor explicitly.
Position | The position to be set. |
Implements Mezzanine::Resource::iInStream.
Definition at line 186 of file datastream.cpp.
|
virtual |
Sets the position of the read cursor.
Offset | The number of bytes to move the read cursor back(if negative) or forward(if positive). |
Origin | The starting point to be considered for the offset. |
Implements Mezzanine::Resource::iInStream.
Definition at line 189 of file datastream.cpp.
|
virtual |
Sets the position of the read and write cursors explicitly.
Position | The position to be set. |
Definition at line 219 of file datastream.cpp.
|
virtual |
Sets the position of the read and write cursors.
Offset | The number of bytes to move the cursors back(if negative) or forward(if positive). |
Origin | The starting point to be considered for the offset. |
Definition at line 225 of file datastream.cpp.
|
virtual |
Sets the position of the write cursor explicitly.
Position | The position to be set. |
Implements Mezzanine::Resource::iOutStream.
Definition at line 204 of file datastream.cpp.
|
virtual |
Sets the position of the write cursor.
Offset | The number of bytes to move the write cursor back(if negative) or forward(if positive). |
Origin | The starting point to be considered for the offset. |
Implements Mezzanine::Resource::iOutStream.
Definition at line 207 of file datastream.cpp.
|
virtual |
Moves the current position to the start of the next line.
Delim | The character that marks the end of a line. |
Definition at line 328 of file datastream.cpp.
|
virtual |
Writes data to the stream.
Buffer | The memory buffer to write to this stream. |
Size | The size of the buffer being passed in. |
Implements Mezzanine::Resource::iOutStream.
Definition at line 198 of file datastream.cpp.