![]() |
Main Page
Class Hierarchy
Alphabetical List
Compound List
File List
Compound Members
![]() |
#include <FXBufferedStream.h>
Inheritance diagram for FXEX::FXBufferedStream::
Public Methods | |
FXBufferedStream (FXStream *s, const FXObject *cont=NULL) | |
FXbool | open (FXStreamDirection save_or_load) |
FXbool | open (FXuint sp, FXStreamDirection save_or_load) |
FXbool | close () |
void | flush () |
virtual FXStream & | operator<< (const FXuchar &v) |
virtual FXStream & | operator<< (const FXchar &v) |
virtual FXStream & | operator>> (FXuchar &v) |
virtual FXStream & | operator>> (FXchar &v) |
virtual | ~FXBufferedStream () |
buffering 2. stream enhancement such as compression, data munging, etc
This functionality is kinda cool, we can do something like this:
FXFileStream fstream = new FXFileStream(...); fstream.open(...); FXBufferedStream bstream = new FXBufferedStream(fstream); ... bstream << object; ... // when buffer becomes full (or closed), bstream automatically flushes into fstream
Or even better:
FXSocketStream fstream = new FXSocketStream(...); fstream.open(...); FXBzipStream bstream = new FXBzipStream(fstream,compression_level); ... bstream << object; ... // when the buffer becomes full (or closed), bstream automatically flushes bzip // compressed data over the socket!
Child should subclass this class and overload the bufferLoad() and bufferSave() method so that they can mung the data when the buffer is full/empty.
Definition at line 63 of file FXBufferedStream.h.
|
Point this enhanced stream at the base stream.
|
|
Destructor.
|
|
Create an enhanced stream - the subclass should figure out how much space to allocate in the buffer (using setSpace()).
|
|
Create an enhanced stream of a specific buffer size.
|
|
Stop using an enhanced stream.
|
|
Put the buffer into the base stream.
|
|
Save to stream.
|
|
|
|
Load from stream.
|
|
|