Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXMemoryStream Class Reference

Memory Store Definition. More...

#include <FXMemoryStream.h>

Inheritance diagram for FX::FXMemoryStream:
FX::FXStream

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.
 
FXMemoryStreamoperator<< (const FXuchar &v)
 Save single items to stream.
 
FXMemoryStreamoperator<< (const FXchar &v)
 
FXMemoryStreamoperator<< (const FXbool &v)
 
FXMemoryStreamoperator<< (const FXushort &v)
 
FXMemoryStreamoperator<< (const FXshort &v)
 
FXMemoryStreamoperator<< (const FXuint &v)
 
FXMemoryStreamoperator<< (const FXint &v)
 
FXMemoryStreamoperator<< (const FXfloat &v)
 
FXMemoryStreamoperator<< (const FXdouble &v)
 
FXMemoryStreamoperator<< (const FXlong &v)
 
FXMemoryStreamoperator<< (const FXulong &v)
 
FXMemoryStreamsave (const FXuchar *p, FXuval n)
 Save arrays of items to stream.
 
FXMemoryStreamsave (const FXchar *p, FXuval n)
 
FXMemoryStreamsave (const FXbool *p, FXuval n)
 
FXMemoryStreamsave (const FXushort *p, FXuval n)
 
FXMemoryStreamsave (const FXshort *p, FXuval n)
 
FXMemoryStreamsave (const FXuint *p, FXuval n)
 
FXMemoryStreamsave (const FXint *p, FXuval n)
 
FXMemoryStreamsave (const FXfloat *p, FXuval n)
 
FXMemoryStreamsave (const FXdouble *p, FXuval n)
 
FXMemoryStreamsave (const FXlong *p, FXuval n)
 
FXMemoryStreamsave (const FXulong *p, FXuval n)
 
FXMemoryStreamoperator>> (FXuchar &v)
 Load single items from stream.
 
FXMemoryStreamoperator>> (FXchar &v)
 
FXMemoryStreamoperator>> (FXbool &v)
 
FXMemoryStreamoperator>> (FXushort &v)
 
FXMemoryStreamoperator>> (FXshort &v)
 
FXMemoryStreamoperator>> (FXuint &v)
 
FXMemoryStreamoperator>> (FXint &v)
 
FXMemoryStreamoperator>> (FXfloat &v)
 
FXMemoryStreamoperator>> (FXdouble &v)
 
FXMemoryStreamoperator>> (FXlong &v)
 
FXMemoryStreamoperator>> (FXulong &v)
 
FXMemoryStreamload (FXuchar *p, FXuval n)
 Load arrays of items from stream.
 
FXMemoryStreamload (FXchar *p, FXuval n)
 
FXMemoryStreamload (FXbool *p, FXuval n)
 
FXMemoryStreamload (FXushort *p, FXuval n)
 
FXMemoryStreamload (FXshort *p, FXuval n)
 
FXMemoryStreamload (FXuint *p, FXuval n)
 
FXMemoryStreamload (FXint *p, FXuval n)
 
FXMemoryStreamload (FXfloat *p, FXuval n)
 
FXMemoryStreamload (FXdouble *p, FXuval n)
 
FXMemoryStreamload (FXlong *p, FXuval n)
 
FXMemoryStreamload (FXulong *p, FXuval n)
 
FXMemoryStreamsaveObject (const FXObject *v)
 Save object.
 
FXMemoryStreamloadObject (FXObject *&v)
 Load object.
 
template<class TYPE >
FXMemoryStreamoperator>> (TYPE *&obj)
 Load object.
 
template<class TYPE >
FXMemoryStreamoperator<< (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 FXObjectcontainer () 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.
 
FXStreamoperator<< (const FXuchar &v)
 Save single items to stream.
 
FXStreamoperator<< (const FXchar &v)
 
FXStreamoperator<< (const FXbool &v)
 
FXStreamoperator<< (const FXushort &v)
 
FXStreamoperator<< (const FXshort &v)
 
FXStreamoperator<< (const FXuint &v)
 
FXStreamoperator<< (const FXint &v)
 
FXStreamoperator<< (const FXfloat &v)
 
FXStreamoperator<< (const FXdouble &v)
 
FXStreamoperator<< (const FXlong &v)
 
FXStreamoperator<< (const FXulong &v)
 
FXStreamsave (const FXuchar *p, FXuval n)
 Save arrays of items to stream.
 
FXStreamsave (const FXchar *p, FXuval n)
 
FXStreamsave (const FXbool *p, FXuval n)
 
FXStreamsave (const FXushort *p, FXuval n)
 
FXStreamsave (const FXshort *p, FXuval n)
 
FXStreamsave (const FXuint *p, FXuval n)
 
FXStreamsave (const FXint *p, FXuval n)
 
FXStreamsave (const FXfloat *p, FXuval n)
 
FXStreamsave (const FXdouble *p, FXuval n)
 
FXStreamsave (const FXlong *p, FXuval n)
 
FXStreamsave (const FXulong *p, FXuval n)
 
FXStreamoperator>> (FXuchar &v)
 Load single items from stream.
 
FXStreamoperator>> (FXchar &v)
 
FXStreamoperator>> (FXbool &v)
 
FXStreamoperator>> (FXushort &v)
 
FXStreamoperator>> (FXshort &v)
 
FXStreamoperator>> (FXuint &v)
 
FXStreamoperator>> (FXint &v)
 
FXStreamoperator>> (FXfloat &v)
 
FXStreamoperator>> (FXdouble &v)
 
FXStreamoperator>> (FXlong &v)
 
FXStreamoperator>> (FXulong &v)
 
FXStreamload (FXuchar *p, FXuval n)
 Load arrays of items from stream.
 
FXStreamload (FXchar *p, FXuval n)
 
FXStreamload (FXbool *p, FXuval n)
 
FXStreamload (FXushort *p, FXuval n)
 
FXStreamload (FXshort *p, FXuval n)
 
FXStreamload (FXuint *p, FXuval n)
 
FXStreamload (FXint *p, FXuval n)
 
FXStreamload (FXfloat *p, FXuval n)
 
FXStreamload (FXdouble *p, FXuval n)
 
FXStreamload (FXlong *p, FXuval n)
 
FXStreamload (FXulong *p, FXuval n)
 
FXStreamsaveObject (const FXObject *v)
 Save object.
 
FXStreamloadObject (FXObject *&v)
 Load object.
 
FXStreamaddObject (const FXObject *v)
 Add object without saving or loading.
 
template<class TYPE >
FXStreamoperator>> (TYPE *&obj)
 Load object.
 
template<class TYPE >
FXStreamoperator<< (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 FXObjectparent
 
FXuchar * begptr
 
FXuchar * endptr
 
FXuchar * wrptr
 
FXuchar * rdptr
 
FXlong pos
 
FXStreamDirection dir
 
FXStreamStatus code
 
FXuint seq
 
FXbool owns
 
FXbool swap
 

Detailed Description

Memory Store Definition.

Member Function Documentation

◆ open()

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.


The documentation for this class was generated from the following file:

Copyright © 1997-2022 Jeroen van der Zijp