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



wxStreamBase::wxStreamBase



wxStreamBase(void)

Creates a dummy stream object. It doesn't do anything.



wxStreamBase::~wxStreamBase



~wxStreamBase(void)

Destructor.



wxStreamBase::GetLength

wxFileOffset GetLength(void) 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.

wxWidgets バージョン 2.5.4 で追加された機能です



wxStreamBase::GetLastError

wxStreamError GetLastError(void) 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(void) 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

bool IsOk(void) const

Returns true if no error occurred on the stream.

See also

GetLastError



wxStreamBase::IsSeekable

bool IsSeekable(void) 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(void) const

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



wxStreamBase::OnSysWrite



size_t OnSysWrite(void * buffer, size_t bufsize)

See OnSysRead.

ymasuda 平成17年11月19日