This represents a stream to a file on disk using the C++ file stream API. More...
#include <filestream.h>
Inheritance diagram for Mezzanine::Resource::FileStream:
Collaboration diagram for Mezzanine::Resource::FileStream:Public Member Functions | |||
| FileStream () | |||
| Blank constructor. | |||
| FileStream (const String &File, const Whole Mode=Resource::SF_Read|Resource::SF_Write) | |||
| Open constructor. More... | |||
| FileStream (const String &FileName, const String &FilePath, const Whole Mode=Resource::SF_Read|Resource::SF_Write) | |||
| Split Open constructor. More... | |||
| virtual | ~FileStream () | ||
| Class destructor. | |||
| void | CloseFile () | ||
| Closes the file that is currently opened. | |||
| const String & | GetFilePathAndName () const | ||
| Gets the path and name of the file that this stream is currently open to. More... | |||
| virtual StreamSize | GetSize () const | ||
| Whole | GetSteamFlags () const | ||
| Gets the flags that were used to open the file. More... | |||
| Boole | IsOpenToFile () const | ||
| Gets whether or not this stream is currently open to a file. More... | |||
| void | OpenFile (const String &File, const Whole Mode=Resource::SF_Read|Resource::SF_Write) | ||
Opens this stream to a file.
| |||
| void | OpenFile (const String &FileName, const String &FilePath, const Whole Mode=Resource::SF_Read|Resource::SF_Write) | ||
Opens this stream to a file.
| |||
Public Member Functions inherited from Mezzanine::Resource::IOStream | |||
| 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. | |||
Public Member Functions inherited from Mezzanine::Resource::iOutStream | |||
| iOutStream () | |||
| Class constructor. | |||
| virtual | ~iOutStream () | ||
| Class destructor. | |||
Protected Attributes | |
| std::filebuf | FileBuffer |
| The buffer object containing most or all of the functionality for this stream. More... | |
| Whole | Flags |
| The type of access this stream has to the file. More... | |
| String | OpenFileName |
| The path and name of the file this stream is currently open to. More... | |
| StreamSize | Size |
| The size of the stream. More... | |
This represents a stream to a file on disk using the C++ file stream API.
Definition at line 56 of file filestream.h.
| Mezzanine::Resource::FileStream::FileStream | ( | const String & | File, |
| const Whole | Mode = Resource::SF_Read | Resource::SF_Write |
||
| ) |
Open constructor.
| File | The combined name and path to the file to be opened. |
| Mode | The configuration to open the file with. |
Definition at line 58 of file filestream.cpp.
| Mezzanine::Resource::FileStream::FileStream | ( | const String & | FileName, |
| const String & | FilePath, | ||
| const Whole | Mode = Resource::SF_Read | Resource::SF_Write |
||
| ) |
Split Open constructor.
| FileName | The name of the file to be opened. |
| FilePath | The path to the file to be opened. |
| Mode | The configuration to open the file with. |
Definition at line 62 of file filestream.cpp.
| const String & Mezzanine::Resource::FileStream::GetFilePathAndName | ( | ) | const |
Gets the path and name of the file that this stream is currently open to.
Definition at line 125 of file filestream.cpp.
|
virtual |
Implements Mezzanine::Resource::iStreamBase.
Definition at line 134 of file filestream.cpp.
| Whole Mezzanine::Resource::FileStream::GetSteamFlags | ( | ) | const |
Gets the flags that were used to open the file.
Definition at line 128 of file filestream.cpp.
| Boole Mezzanine::Resource::FileStream::IsOpenToFile | ( | ) | const |
Gets whether or not this stream is currently open to a file.
Definition at line 109 of file filestream.cpp.
| void Mezzanine::Resource::FileStream::OpenFile | ( | const String & | File, |
| const Whole | Mode = Resource::SF_Read | Resource::SF_Write |
||
| ) |
Opens this stream to a file.
| If | the stream fails to open the file specified, a IO_FILE_NOT_FOUND_EXCEPTION will be thrown. |
| File | The combined name and path to the file to be opened. |
| Mode | The configuration to open the file with. |
Definition at line 72 of file filestream.cpp.
| void Mezzanine::Resource::FileStream::OpenFile | ( | const String & | FileName, |
| const String & | FilePath, | ||
| const Whole | Mode = Resource::SF_Read | Resource::SF_Write |
||
| ) |
Opens this stream to a file.
| If | the stream fails to open the file specified, a IO_FILE_NOT_FOUND_EXCEPTION will be thrown. |
| FileName | The name of the file to be opened. |
| FilePath | The path to the file to be opened. |
| Mode | The configuration to open the file with. |
Definition at line 91 of file filestream.cpp.
|
protected |
The buffer object containing most or all of the functionality for this stream.
Definition at line 61 of file filestream.h.
|
protected |
The type of access this stream has to the file.
Definition at line 68 of file filestream.h.
|
protected |
The path and name of the file this stream is currently open to.
Definition at line 65 of file filestream.h.
|
protected |
The size of the stream.
Definition at line 71 of file filestream.h.
1.8.9.1. Thanks to the
Open Icon Library
for help with some of the icons.