Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
Memory Store Definition. More...
#include <FXMemoryStream.h>
Public Member Functions | |
FXMemoryStream (const FXObject *cont=nullptr) | |
Create memory stream. | |
FXMemoryStream (FXStreamDirection save_or_load, FXuchar *data=nullptr, FXuval size=~0UL, FXbool owned=false) | |
Create and open memory stream. | |
FXbool | open (FXStreamDirection save_or_load, FXuchar *data=nullptr, FXuval size=~0UL, FXbool owned=false) |
Open memory stream. More... | |
void | takeBuffer (FXuchar *&data, FXuval &size) |
Take buffer away from stream. | |
void | giveBuffer (FXuchar *data, FXuval size) |
Give buffer to stream, making it the owner of this buffer. | |
FXlong | position () const |
Get position. | |
virtual FXbool | position (FXlong offset, FXWhence whence=FXFromStart) |
Move to position. | |
FXMemoryStream & | operator<< (const FXuchar &v) |
Save single items to stream. | |
FXMemoryStream & | operator<< (const FXchar &v) |
FXMemoryStream & | operator<< (const FXbool &v) |
FXMemoryStream & | operator<< (const FXushort &v) |
FXMemoryStream & | operator<< (const FXshort &v) |
FXMemoryStream & | operator<< (const FXuint &v) |
FXMemoryStream & | operator<< (const FXint &v) |
FXMemoryStream & | operator<< (const FXfloat &v) |
FXMemoryStream & | operator<< (const FXdouble &v) |
FXMemoryStream & | operator<< (const FXlong &v) |
FXMemoryStream & | operator<< (const FXulong &v) |
FXMemoryStream & | save (const FXuchar *p, FXuval n) |
Save arrays of items to stream. | |
FXMemoryStream & | save (const FXchar *p, FXuval n) |
FXMemoryStream & | save (const FXbool *p, FXuval n) |
FXMemoryStream & | save (const FXushort *p, FXuval n) |
FXMemoryStream & | save (const FXshort *p, FXuval n) |
FXMemoryStream & | save (const FXuint *p, FXuval n) |
FXMemoryStream & | save (const FXint *p, FXuval n) |
FXMemoryStream & | save (const FXfloat *p, FXuval n) |
FXMemoryStream & | save (const FXdouble *p, FXuval n) |
FXMemoryStream & | save (const FXlong *p, FXuval n) |
FXMemoryStream & | save (const FXulong *p, FXuval n) |
FXMemoryStream & | operator>> (FXuchar &v) |
Load single items from stream. | |
FXMemoryStream & | operator>> (FXchar &v) |
FXMemoryStream & | operator>> (FXbool &v) |
FXMemoryStream & | operator>> (FXushort &v) |
FXMemoryStream & | operator>> (FXshort &v) |
FXMemoryStream & | operator>> (FXuint &v) |
FXMemoryStream & | operator>> (FXint &v) |
FXMemoryStream & | operator>> (FXfloat &v) |
FXMemoryStream & | operator>> (FXdouble &v) |
FXMemoryStream & | operator>> (FXlong &v) |
FXMemoryStream & | operator>> (FXulong &v) |
FXMemoryStream & | load (FXuchar *p, FXuval n) |
Load arrays of items from stream. | |
FXMemoryStream & | load (FXchar *p, FXuval n) |
FXMemoryStream & | load (FXbool *p, FXuval n) |
FXMemoryStream & | load (FXushort *p, FXuval n) |
FXMemoryStream & | load (FXshort *p, FXuval n) |
FXMemoryStream & | load (FXuint *p, FXuval n) |
FXMemoryStream & | load (FXint *p, FXuval n) |
FXMemoryStream & | load (FXfloat *p, FXuval n) |
FXMemoryStream & | load (FXdouble *p, FXuval n) |
FXMemoryStream & | load (FXlong *p, FXuval n) |
FXMemoryStream & | load (FXulong *p, FXuval n) |
FXMemoryStream & | saveObject (const FXObject *v) |
Save object. | |
FXMemoryStream & | loadObject (FXObject *&v) |
Load object. | |
template<class TYPE > | |
FXMemoryStream & | operator>> (TYPE *&obj) |
Load object. | |
template<class TYPE > | |
FXMemoryStream & | operator<< (const TYPE *obj) |
Save object. | |
virtual | ~FXMemoryStream () |
Destructor. | |
Public Member Functions inherited from FX::FXStream | |
FXStream (const FXObject *cont=nullptr) | |
Construct stream with given container object. More... | |
FXbool | open (FXStreamDirection save_or_load, FXuchar *data=nullptr, FXuval size=8192UL, FXbool owned=false) |
Open stream for reading (FXStreamLoad) or for writing (FXStreamSave). More... | |
virtual FXbool | flush () |
Flush buffer. | |
virtual FXbool | close () |
Close; return true if OK. | |
FXuval | getSpace () const |
Get available buffer space. | |
void | setSpace (FXuval sp) |
Set available buffer space. | |
void | setOwned (FXbool owned) |
Set buffer ownership flag. | |
FXbool | isOwned () const |
Get buffer ownership flag. | |
FXStreamStatus | status () const |
Get status code. | |
FXbool | eof () const |
Return true if at end of file or error. | |
void | setError (FXStreamStatus err) |
Set status code. | |
FXStreamDirection | direction () const |
Obtain stream direction. | |
const FXObject * | container () const |
Get parent object. | |
FXlong | position () const |
Get position. | |
void | swapBytes (FXbool s) |
Change swap bytes flag. | |
FXbool | swapBytes () const |
Get state of the swap bytes flag. | |
void | setBigEndian (FXbool big) |
Set stream to big endian mode if true. More... | |
FXbool | isBigEndian () const |
Return true if big endian mode. | |
FXStream & | operator<< (const FXuchar &v) |
Save single items to stream. | |
FXStream & | operator<< (const FXchar &v) |
FXStream & | operator<< (const FXbool &v) |
FXStream & | operator<< (const FXushort &v) |
FXStream & | operator<< (const FXshort &v) |
FXStream & | operator<< (const FXuint &v) |
FXStream & | operator<< (const FXint &v) |
FXStream & | operator<< (const FXfloat &v) |
FXStream & | operator<< (const FXdouble &v) |
FXStream & | operator<< (const FXlong &v) |
FXStream & | operator<< (const FXulong &v) |
FXStream & | save (const FXuchar *p, FXuval n) |
Save arrays of items to stream. | |
FXStream & | save (const FXchar *p, FXuval n) |
FXStream & | save (const FXbool *p, FXuval n) |
FXStream & | save (const FXushort *p, FXuval n) |
FXStream & | save (const FXshort *p, FXuval n) |
FXStream & | save (const FXuint *p, FXuval n) |
FXStream & | save (const FXint *p, FXuval n) |
FXStream & | save (const FXfloat *p, FXuval n) |
FXStream & | save (const FXdouble *p, FXuval n) |
FXStream & | save (const FXlong *p, FXuval n) |
FXStream & | save (const FXulong *p, FXuval n) |
FXStream & | operator>> (FXuchar &v) |
Load single items from stream. | |
FXStream & | operator>> (FXchar &v) |
FXStream & | operator>> (FXbool &v) |
FXStream & | operator>> (FXushort &v) |
FXStream & | operator>> (FXshort &v) |
FXStream & | operator>> (FXuint &v) |
FXStream & | operator>> (FXint &v) |
FXStream & | operator>> (FXfloat &v) |
FXStream & | operator>> (FXdouble &v) |
FXStream & | operator>> (FXlong &v) |
FXStream & | operator>> (FXulong &v) |
FXStream & | load (FXuchar *p, FXuval n) |
Load arrays of items from stream. | |
FXStream & | load (FXchar *p, FXuval n) |
FXStream & | load (FXbool *p, FXuval n) |
FXStream & | load (FXushort *p, FXuval n) |
FXStream & | load (FXshort *p, FXuval n) |
FXStream & | load (FXuint *p, FXuval n) |
FXStream & | load (FXint *p, FXuval n) |
FXStream & | load (FXfloat *p, FXuval n) |
FXStream & | load (FXdouble *p, FXuval n) |
FXStream & | load (FXlong *p, FXuval n) |
FXStream & | load (FXulong *p, FXuval n) |
FXStream & | saveObject (const FXObject *v) |
Save object. | |
FXStream & | loadObject (FXObject *&v) |
Load object. | |
FXStream & | addObject (const FXObject *v) |
Add object without saving or loading. | |
template<class TYPE > | |
FXStream & | operator>> (TYPE *&obj) |
Load object. | |
template<class TYPE > | |
FXStream & | operator<< (const TYPE *obj) |
Save object. | |
virtual | ~FXStream () |
Destructor. | |
Protected Member Functions | |
virtual FXuval | writeBuffer (FXuval count) |
Write at least count bytes from the buffer; returns number of bytes available to be written. | |
virtual FXuval | readBuffer (FXuval count) |
Read at least count bytes into the buffer; returns number of bytes available to be read. | |
Additional Inherited Members | |
Protected Attributes inherited from FX::FXStream | |
FXHash | hash |
const FXObject * | parent |
FXuchar * | begptr |
FXuchar * | endptr |
FXuchar * | wrptr |
FXuchar * | rdptr |
FXlong | pos |
FXStreamDirection | dir |
FXStreamStatus | code |
FXuint | seq |
FXbool | owns |
FXbool | swap |
Memory Store Definition.
FXbool FX::FXMemoryStream::open | ( | FXStreamDirection | save_or_load, |
FXuchar * | data = nullptr , |
||
FXuval | size = ~0UL , |
||
FXbool | owned = false |
||
) |
Open memory stream.
When reading from the data buffer, the size parameter is optional. If not given, the reader will need to know when to stop reading by some other means, like end-of-file markers in the data. When writing, the size parameter must be set to reflect the actual buffer size, and should be at least 16. If the owned flag is true, the stream becomes the owner of the data buffer; otherwise, the stream will not delete the buffer. Passing NULL for the data buffer will cause the stream to allocate a buffer of the given size.
Copyright © 1997-2022 Jeroen van der Zijp |