/**
Constructor; creates a new empty stream buffer which won't flush any data
to a stream. mode specifies the type of the buffer (read, write, read_write).
+
This stream buffer has the advantage to be stream independent and to work
only on memory buffers but it is still compatible with the rest of the
wxStream classes. You can write, read to this special stream and it will
wxStreamBuffer(BufMode mode);
/**
- Constructor. It initializes the stream buffer with the data of the specified
+ Constructor.
+
+ This method initializes the stream buffer with the data of the specified
stream buffer. The new stream buffer has the same attributes, size, position
and they share the same buffer. This will cause problems if the stream to
which the stream buffer belong is destroyed and the newly cloned stream
/**
Returns the current position (counted in bytes) in the stream buffer.
*/
- off_t GetIntPosition() const;
+ wxFileOffset GetIntPosition() const;
/**
Returns the amount of bytes read during the last IO call to the parent stream.
measured in bytes from the beginning of the stream.
Otherwise, it returns wxInvalidOffset.
*/
- off_t Seek(off_t pos, wxSeekMode mode);
+ virtual wxFileOffset Seek(wxFileOffset pos, wxSeekMode mode);
/**
Specifies which pointers to use for stream buffering.
@return Returns the current position in the stream if possible,
wxInvalidOffset in the other case.
*/
- off_t Tell() const;
+ virtual wxFileOffset Tell() const;
/**
Truncates the buffer to the current position.
@return The new stream position or wxInvalidOffset on error.
*/
- off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart);
+ virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart);
/**
Returns the current stream position.
*/
- off_t TellO() const;
+ virtual wxFileOffset TellO() const;
/**
Writes up to the specified amount of bytes using the data of buffer.
handle it and create a stream to decompress it:
@code
- factory = wxFilterClassFactory::Find(filename, wxSTREAM_FILEEXT);
+ factory = wxFilterClassFactory::Find(filename, wxSTREAM_FILEEXT);
if (factory)
stream = factory-NewStream(new wxFFileInputStream(filename));
@endcode
list << *p << _T("\n");
@endcode
*/
- const wxChar* const* GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const;
+ virtual const wxChar * const* GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const = 0;
//@{
/**
@return The new stream position or wxInvalidOffset on error.
*/
- off_t SeekI(off_t pos, wxSeekMode mode = wxFromStart);
+ virtual wxFileOffset SeekI(wxFileOffset pos, wxSeekMode mode = wxFromStart);
/**
Returns the current stream position.
*/
- off_t TellI() const;
+ virtual wxFileOffset TellI() const;
/**
This function is only useful in read mode.
size_t OnSysRead(void* buffer, size_t bufsize);
/**
- Internal function.
- It is called when the stream needs to change the current position.
+ See OnSysRead().
*/
- off_t OnSysSeek(off_t pos, wxSeekMode mode);
+ size_t OnSysWrite(const void* buffer, size_t bufsize);
+
+
+protected:
/**
Internal function.
- It is called when the stream needs to know the real position.
+ It is called when the stream needs to change the current position.
*/
- off_t OnSysTell() const;
+ virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
/**
- See OnSysRead().
+ Internal function.
+ It is called when the stream needs to know the real position.
*/
- size_t OnSysWrite(const void* buffer, size_t bufsize);
+ virtual wxFileOffset OnSysTell() const;
};