wxStreamBase Class Reference
[Streams]

#include <wx/stream.h>

Inheritance diagram for wxStreamBase:

wxInputStream wxOutputStream wxFFileInputStream wxFileInputStream wxFilterInputStream wxMemoryInputStream wxSocketInputStream wxStringInputStream wxCountingOutputStream wxFFileOutputStream wxFileOutputStream wxFilterOutputStream wxMemoryOutputStream wxSocketOutputStream wxStringOutputStream wxTempFileOutputStream

List of all members.


Detailed Description

This class is the base class of most stream related classes in wxWidgets. It must not be used directly.

Library:  wxBase

Category:  Streams

See also:
wxStreamBuffer

Public Member Functions

 wxStreamBase ()
virtual ~wxStreamBase ()
wxStreamError GetLastError () const
virtual wxFileOffset GetLength () const
virtual size_t GetSize () const
virtual bool IsOk () const
virtual bool IsSeekable () const
size_t OnSysRead (void *buffer, size_t bufsize)
size_t OnSysWrite (const void *buffer, size_t bufsize)

Protected Member Functions

virtual wxFileOffset OnSysSeek (wxFileOffset pos, wxSeekMode mode)
virtual wxFileOffset OnSysTell () const

Constructor & Destructor Documentation

wxStreamBase::wxStreamBase (  ) 

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

virtual wxStreamBase::~wxStreamBase (  )  [virtual]

Destructor.


Member Function Documentation

wxStreamError wxStreamBase::GetLastError (  )  const

This function returns the last error.

virtual wxFileOffset wxStreamBase::GetLength (  )  const [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.

Since:
2.5.4

virtual size_t wxStreamBase::GetSize (  )  const [virtual]

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.

Reimplemented in wxCountingOutputStream.

virtual bool wxStreamBase::IsOk (  )  const [virtual]

Returns true if no error occurred on the stream.

See also:
GetLastError()

Reimplemented in wxFFileOutputStream, wxFileOutputStream, wxFileInputStream, and wxFFileInputStream.

virtual bool wxStreamBase::IsSeekable (  )  const [virtual]

Returns true if the streams supports seeking to arbitrary offsets.

size_t wxStreamBase::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.

size_t wxStreamBase::OnSysWrite ( const void *  buffer,
size_t  bufsize 
)

virtual wxFileOffset wxStreamBase::OnSysSeek ( wxFileOffset  pos,
wxSeekMode  mode 
) [protected, virtual]

Internal function. It is called when the stream needs to change the current position.

virtual wxFileOffset wxStreamBase::OnSysTell (  )  const [protected, virtual]

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



wxWidgets logo

[ top ]