31 enum FXStreamDirection {
90 FXStreamDirection dir;
101 virtual FXuval writeBuffer(FXuval count);
107 virtual FXuval readBuffer(FXuval count);
128 FXbool open(FXStreamDirection save_or_load,FXuchar* data=
nullptr,FXuval size=8192UL,FXbool owned=
false);
131 virtual FXbool flush();
134 virtual FXbool close();
137 FXuval getSpace()
const;
140 void setSpace(FXuval sp);
149 FXStreamStatus
status()
const {
return code; }
152 FXbool
eof()
const {
return code!=FXStreamOK; }
155 void setError(FXStreamStatus err);
167 virtual FXbool position(FXlong offset,FXWhence whence=FXFromStart);
184 void setBigEndian(FXbool big);
189 FXbool isBigEndian()
const;
192 FXStream& operator<<(
const FXuchar& v);
193 FXStream& operator<<(
const FXchar& v){
return *this << reinterpret_cast<const FXuchar&>(v); }
194 FXStream& operator<<(
const FXbool& v);
195 FXStream& operator<<(
const FXushort& v);
196 FXStream& operator<<(
const FXshort& v){
return *this << reinterpret_cast<const FXushort&>(v); }
197 FXStream& operator<<(
const FXuint& v);
198 FXStream& operator<<(
const FXint& v){
return *this << reinterpret_cast<const FXuint&>(v); }
199 FXStream& operator<<(
const FXfloat& v){
return *this << reinterpret_cast<const FXuint&>(v); }
200 FXStream& operator<<(
const FXdouble& v);
201 FXStream& operator<<(
const FXlong& v){
return *this << reinterpret_cast<const FXdouble&>(v); }
202 FXStream& operator<<(
const FXulong& v){
return *this << reinterpret_cast<const FXdouble&>(v); }
205 FXStream& save(
const FXuchar* p,FXuval n);
206 FXStream& save(
const FXchar* p,FXuval n){
return save(reinterpret_cast<const FXuchar*>(p),n); }
207 FXStream& save(
const FXbool* p,FXuval n);
208 FXStream& save(
const FXushort* p,FXuval n);
209 FXStream& save(
const FXshort* p,FXuval n){
return save(reinterpret_cast<const FXushort*>(p),n); }
210 FXStream& save(
const FXuint* p,FXuval n);
211 FXStream& save(
const FXint* p,FXuval n){
return save(reinterpret_cast<const FXuint*>(p),n); }
212 FXStream& save(
const FXfloat* p,FXuval n){
return save(reinterpret_cast<const FXuint*>(p),n); }
213 FXStream& save(
const FXdouble* p,FXuval n);
214 FXStream& save(
const FXlong* p,FXuval n){
return save(reinterpret_cast<const FXdouble*>(p),n); }
215 FXStream& save(
const FXulong* p,FXuval n){
return save(reinterpret_cast<const FXdouble*>(p),n); }
218 FXStream& operator>>(FXuchar& v);
219 FXStream& operator>>(FXchar& v){
return *
this >>
reinterpret_cast<FXuchar&
>(v); }
220 FXStream& operator>>(FXbool& v);
221 FXStream& operator>>(FXushort& v);
222 FXStream& operator>>(FXshort& v){
return *
this >>
reinterpret_cast<FXushort&
>(v); }
223 FXStream& operator>>(FXuint& v);
224 FXStream& operator>>(FXint& v){
return *
this >>
reinterpret_cast<FXuint&
>(v); }
225 FXStream& operator>>(FXfloat& v){
return *
this >>
reinterpret_cast<FXuint&
>(v); }
226 FXStream& operator>>(FXdouble& v);
227 FXStream& operator>>(FXlong& v){
return *
this >>
reinterpret_cast<FXdouble&
>(v); }
228 FXStream& operator>>(FXulong& v){
return *
this >>
reinterpret_cast<FXdouble&
>(v); }
231 FXStream& load(FXuchar* p,FXuval n);
232 FXStream& load(FXchar* p,FXuval n){
return load(reinterpret_cast<FXuchar*>(p),n); }
233 FXStream& load(FXbool* p,FXuval n);
234 FXStream& load(FXushort* p,FXuval n);
235 FXStream& load(FXshort* p,FXuval n){
return load(reinterpret_cast<FXushort*>(p),n); }
236 FXStream& load(FXuint* p,FXuval n);
237 FXStream& load(FXint* p,FXuval n){
return load(reinterpret_cast<FXuint*>(p),n); }
238 FXStream& load(FXfloat* p,FXuval n){
return load(reinterpret_cast<FXuint*>(p),n); }
239 FXStream& load(FXdouble* p,FXuval n);
240 FXStream& load(FXlong* p,FXuval n){
return load(reinterpret_cast<FXdouble*>(p),n); }
241 FXStream& load(FXulong* p,FXuval n){
return load(reinterpret_cast<FXdouble*>(p),n); }
244 FXStream& saveObject(
const FXObject* v);
247 FXStream& loadObject(FXObject*& v);
250 FXStream& addObject(
const FXObject* v);
FXbool isOwned() const
Get buffer ownership flag.
Definition: FXStream.h:146
void setOwned(FXbool owned)
Set buffer ownership flag.
Definition: FXStream.h:143
FXStream & operator<<(const TYPE *obj)
Save object.
Definition: FXStream.h:258
A hash table for mapping pointers to pointers.
Definition: FXHash.h:33
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
void swapBytes(FXbool s)
Change swap bytes flag.
Definition: FXStream.h:172
FXStreamStatus status() const
Get status code.
Definition: FXStream.h:149
FXStreamDirection direction() const
Obtain stream direction.
Definition: FXStream.h:158
const FXObject * container() const
Get parent object.
Definition: FXStream.h:161
Definition: FX4Splitter.h:28
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXbool swapBytes() const
Get state of the swap bytes flag.
Definition: FXStream.h:177
FXbool eof() const
Return true if at end of file or error.
Definition: FXStream.h:152
FXlong position() const
Get position.
Definition: FXStream.h:164
FXStream & operator>>(TYPE *&obj)
Load object.
Definition: FXStream.h:254