wx.StreamBase¶
This class is the base class of most stream related classes in wxWidgets.
It must not be used directly.
See also
StreamBuffer
Class Hierarchy¶
Known Subclasses¶
wx.InputStream, wx.OutputStream
Methods Summary¶
Creates a dummy stream object. |
|
This function returns the last error. |
|
Returns the length of the stream in bytes. |
|
This function returns the size of the stream. |
|
Returns |
|
Returns |
|
Resets the stream state. |
Properties Summary¶
See |
|
See |
|
See |
Class API¶
- class wx.StreamBase(object)¶
Possible constructors:
StreamBase() -> None
This class is the base class of most stream related classes in wxWidgets.
Methods¶
- __init__(self)¶
Creates a dummy stream object.
It doesn’t do anything.
- Return type:
None
- GetLastError(self)¶
This function returns the last error.
- Return type:
- GetLength(self)¶
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
InvalidOffset
.- Return type:
wx.FileOffset
Added in version 2.5.4.
- GetSize(self)¶
This function returns the size of the stream.
For example, for a file it is the size of the file.
- Return type:
int
Warning
There are streams which do not have size by definition, such as socket streams. In that cases,
GetSize
returns 0 so you should always test its return value.
- IsOk(self)¶
Returns
True
if no error occurred on the stream.- Return type:
bool
See also
- IsSeekable(self)¶
Returns
True
if the stream supports seeking to arbitrary offsets.- Return type:
bool
- Reset(self, error=STREAM_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).
- Parameters:
error (StreamError)
- Return type:
None
See also
Properties¶
- LastError¶
See
GetLastError