X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f42c1512dd009866feb5a4410ef5e2dd1e535404..72dc02c6a7fe7d02b1876b6cd466e92614bccfd4:/interface/wx/stream.h diff --git a/interface/wx/stream.h b/interface/wx/stream.h index f301b70314..0d7511ce44 100644 --- a/interface/wx/stream.h +++ b/interface/wx/stream.h @@ -99,12 +99,16 @@ public: /** @class wxStreamBuffer - @todo WRITE A DESCRIPTION + wxStreamBuffer is a cache manager for wxStreamBase: it manages a stream buffer + linked to a stream. + + Each stream always has one autoinitialized stream buffer, but you may + attach more of them to the same stream. @library{wxbase} @category{streams} - @see wxStreamBase + @see wxStreamBase, @ref overview_stream */ class wxStreamBuffer { @@ -127,7 +131,9 @@ public: @code streambuffer.Read(...); - streambuffer2.Read(...); // This call erases previous error messages set by 'streambuffer' + streambuffer2.Read(...); + // This call erases previous error messages set by 'streambuffer' + // assuming that both instances are stream buffers for the same stream @endcode @see SetBufferIO() @@ -290,7 +296,7 @@ public: @see Write() */ - Return value size_t Read(wxStreamBuffer* buffer); + size_t Read(wxStreamBuffer* buffer); /** Resets to the initial state variables concerning the buffer. @@ -326,7 +332,7 @@ public: @see wxStreamBuffer(), Fixed(), Flushable() */ - void SetBufferIO(char* buffer_start, char* buffer_end); + void SetBufferIO(void* start, void* end, bool takeOwnership = false); /** Destroys or invalidates the previous IO buffer and allocates a new one of the @@ -353,6 +359,7 @@ public: /** Returns the parent stream of the stream buffer. + @deprecated use GetStream() instead */ wxStreamBase* Stream(); @@ -462,14 +469,14 @@ public: This function returns a reference on the current object, so the user can test any states of the stream right away. */ - wxOutputStream Write(const void* buffer, size_t size); + virtual wxOutputStream& Write(const void* buffer, size_t size); /** Reads data from the specified input stream and stores them in the current stream. The data is read until an error is raised by one of the two streams. */ - wxOutputStream Write(wxInputStream& stream_in); + wxOutputStream& Write(wxInputStream& stream_in); }; @@ -748,7 +755,7 @@ public: /** Calls Sync() and changes the stream position. */ - virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart) + virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart); /** Flushes the buffer and calls Sync() on the parent stream. @@ -794,6 +801,8 @@ public: /** Returns the first character in the input queue and removes it, blocking until it appears if necessary. + + On success returns a value between 0 - 255; on end of file returns @c wxEOF. */ int GetC(); @@ -816,7 +825,7 @@ public: @return This function returns a reference on the current object, so the user can test any states of the stream right away. */ - wxInputStream Read(void* buffer, size_t size); + virtual wxInputStream& Read(void* buffer, size_t size); /** Reads data from the input queue and stores it in the specified output stream. @@ -860,13 +869,13 @@ public: @return Returns the amount of bytes saved in the Write-Back buffer. */ - size_t Ungetch(const char* buffer, size_t size); + size_t Ungetch(const void* buffer, size_t size); /** This function acts like the previous one except that it takes only one character: it is sometimes shorter to use than the generic function. */ - Return value bool Ungetch(char c); + bool Ungetch(char c); };