contents up previous next

wxstreambase

this class is the base class of most stream related classes in wxwidgets. it must not be used directly.

derived from

none

include files

<wx/stream.h>

see also

wxstreambuffer

members

wxstreambase::wxstreambase
wxstreambase::~wxstreambase
wxstreambase::getlength
wxstreambase::getlasterror
wxstreambase::getsize
wxstreambase::isok
wxstreambase::isseekable
wxstreambase::onsysread
wxstreambase::onsysseek
wxstreambase::onsystell
wxstreambase::onsyswrite


wxstreambase::wxstreambase

wxstreambase()

creates a dummy stream object. it doesn't do anything.


wxstreambase::~wxstreambase

~wxstreambase()

destructor.


wxstreambase::getlength

wxfileoffset getlength() const

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.

this function is new since wxwidgets version 2.5.4


wxstreambase::getlasterror

wxstreamerror getlasterror() const

this function returns the last error.

wxstream_no_error no error occurred.
wxstream_eof an end-of-file occurred.
wxstream_write_error a generic error occurred on the last write call.
wxstream_read_error a generic error occurred on the last read call.


wxstreambase::getsize

size_t getsize() const

getlength

this function returns the size of the stream. for example, for a file it is the size of the file.

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.


wxstreambase::isok

virtual bool isok() const

returns true if no error occurred on the stream.

see also

getlasterror


wxstreambase::isseekable

bool isseekable() const

returns true if the streams supports seeking to arbitrary offsets.


wxstreambase::onsysread

size_t onsysread(void* buffer, size_t bufsize)

internal function. it is called when the stream wants to read data of the specified size. it should return the size that was actually read.


wxstreambase::onsysseek

off_t onsysseek(off_t pos, wxseekmode mode)

internal function. it is called when the stream needs to change the current position.


wxstreambase::onsystell

off_t onsystell() const

internal function. is is called when the stream needs to know the real position.


wxstreambase::onsyswrite

size_t onsyswrite(const void *buffer, size_t bufsize)

see onsysread.