#include <wx/stream.h>
This class is the base class of most stream related classes in wxWidgets.
It must not be used directly.
Public Member Functions | |
wxStreamBase () | |
Creates a dummy stream object. More... | |
virtual | ~wxStreamBase () |
Destructor. More... | |
wxStreamError | GetLastError () const |
This function returns the last error. More... | |
virtual wxFileOffset | GetLength () const |
Returns the length of the stream in bytes. More... | |
virtual size_t | GetSize () const |
This function returns the size of the stream. More... | |
virtual bool | IsOk () const |
Returns true if no error occurred on the stream. More... | |
virtual bool | IsSeekable () const |
Returns true if the stream supports seeking to arbitrary offsets. More... | |
void | Reset (wxStreamError error=wxSTREAM_NO_ERROR) |
Resets the stream state. More... | |
bool | operator! () const |
Returns the opposite of IsOk(). More... | |
Protected Member Functions | |
virtual wxFileOffset | OnSysSeek (wxFileOffset pos, wxSeekMode mode) |
Internal function. More... | |
virtual wxFileOffset | OnSysTell () const |
Internal function. More... | |
wxStreamBase::wxStreamBase | ( | ) |
Creates a dummy stream object.
It doesn't do anything.
|
virtual |
Destructor.
wxStreamError wxStreamBase::GetLastError | ( | ) | const |
This function returns the last error.
|
virtual |
Returns the length of the stream in bytes.
If the length cannot be determined (this is always the case for socket streams for example), returns wxInvalidOffset.
Reimplemented in wxCountingOutputStream.
|
virtual |
This function returns the size of the stream.
For example, for a file it is the size of the file.
|
virtual |
Returns true if no error occurred on the stream.
Reimplemented in wxFSInputStream, wxFileStream, wxFFileStream, wxFFileInputStream, wxFileInputStream, wxFileOutputStream, and wxFFileOutputStream.
|
virtual |
Returns true if the stream supports seeking to arbitrary offsets.
|
protectedvirtual |
Internal function.
It is called when the stream needs to change the current position.
pos | Offset to seek to. |
mode | One of the wxSeekMode enumeration values. |
|
protectedvirtual |
Internal function.
It is called when the stream needs to know the real position.
bool wxStreamBase::operator! | ( | ) | const |
Returns the opposite of IsOk().
You can use this function to test the validity of the stream as if it was a pointer:
void wxStreamBase::Reset | ( | wxStreamError | error = wxSTREAM_NO_ERROR | ) |
Resets the stream state.
By default, resets the stream to good state, i.e. clears any errors. Since wxWidgets 2.9.3 can be also used to explicitly set the state to the specified error (the error argument didn't exist in the previous versions).