21 #ifndef FXMEMORYSTREAM_H 22 #define FXMEMORYSTREAM_H 34 virtual FXuval writeBuffer(FXuval count);
35 virtual FXuval readBuffer(FXuval count);
45 FXMemoryStream(FXStreamDirection save_or_load,FXuchar* data=
nullptr,FXuval size=~0UL,FXbool owned=
false);
58 FXbool open(FXStreamDirection save_or_load,FXuchar* data=
nullptr,FXuval size=~0UL,FXbool owned=
false);
61 void takeBuffer(FXuchar*& data,FXuval& size);
64 void giveBuffer(FXuchar *data,FXuval size);
70 virtual FXbool position(FXlong offset,FXWhence whence=FXFromStart);
88 FXMemoryStream& save(
const FXbool* p,FXuval n){
FXStream::save(p,n);
return *
this; }
89 FXMemoryStream& save(
const FXushort* p,FXuval n){
FXStream::save(p,n);
return *
this; }
90 FXMemoryStream& save(
const FXshort* p,FXuval n){
FXStream::save(p,n);
return *
this; }
91 FXMemoryStream& save(
const FXuint* p,FXuval n){
FXStream::save(p,n);
return *
this; }
92 FXMemoryStream& save(
const FXint* p,FXuval n){
FXStream::save(p,n);
return *
this; }
93 FXMemoryStream& save(
const FXfloat* p,FXuval n){
FXStream::save(p,n);
return *
this; }
94 FXMemoryStream& save(
const FXdouble* p,FXuval n){
FXStream::save(p,n);
return *
this; }
95 FXMemoryStream& save(
const FXlong* p,FXuval n){
FXStream::save(p,n);
return *
this; }
96 FXMemoryStream& save(
const FXulong* p,FXuval n){
FXStream::save(p,n);
return *
this; }
114 FXMemoryStream& load(FXbool* p,FXuval n){
FXStream::load(p,n);
return *
this; }
115 FXMemoryStream& load(FXushort* p,FXuval n){
FXStream::load(p,n);
return *
this; }
116 FXMemoryStream& load(FXshort* p,FXuval n){
FXStream::load(p,n);
return *
this; }
117 FXMemoryStream& load(FXuint* p,FXuval n){
FXStream::load(p,n);
return *
this; }
118 FXMemoryStream& load(FXint* p,FXuval n){
FXStream::load(p,n);
return *
this; }
119 FXMemoryStream& load(FXfloat* p,FXuval n){
FXStream::load(p,n);
return *
this; }
120 FXMemoryStream& load(FXdouble* p,FXuval n){
FXStream::load(p,n);
return *
this; }
121 FXMemoryStream& load(FXlong* p,FXuval n){
FXStream::load(p,n);
return *
this; }
122 FXMemoryStream& load(FXulong* p,FXuval n){
FXStream::load(p,n);
return *
this; }
FXMemoryStream & operator<<(const FXuchar &v)
Save single items to stream.
Definition: FXMemoryStream.h:73
FXMemoryStream & operator>>(TYPE *&obj)
Load object.
Definition: FXMemoryStream.h:132
FXMemoryStream & loadObject(FXObject *&v)
Load object.
Definition: FXMemoryStream.h:128
Memory Store Definition.
Definition: FXMemoryStream.h:32
FXStream & save(const FXuchar *p, FXuval n)
Save arrays of items to stream.
FXMemoryStream & load(FXuchar *p, FXuval n)
Load arrays of items from stream.
Definition: FXMemoryStream.h:112
FXMemoryStream & operator>>(FXuchar &v)
Load single items from stream.
Definition: FXMemoryStream.h:99
FXMemoryStream & save(const FXuchar *p, FXuval n)
Save arrays of items to stream.
Definition: FXMemoryStream.h:86
FXStream & operator>>(FXuchar &v)
Load single items from stream.
FXStream & saveObject(const FXObject *v)
Save object.
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXlong position() const
Get position.
Definition: FXMemoryStream.h:67
Definition: FX4Splitter.h:28
FXMemoryStream & operator<<(const TYPE *obj)
Save object.
Definition: FXMemoryStream.h:136
FXStream & operator<<(const FXuchar &v)
Save single items to stream.
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:138
FXStream & loadObject(FXObject *&v)
Load object.
FXStream & load(FXuchar *p, FXuval n)
Load arrays of items from stream.
FXMemoryStream & saveObject(const FXObject *v)
Save object.
Definition: FXMemoryStream.h:125
FXlong position() const
Get position.
Definition: FXStream.h:164