#include <FXFileStream.h>
Public Types | |
enum | ByteOrder { BigEndian, LittleEndian } |
Public Member Functions | |
FXDEPRECATEDEXT | FXFileStream (const FXObject *cont=NULL) |
bool | open (const FXString &filename, FXStreamDirection save_or_load, FXuval size=8192) |
virtual bool | close () |
virtual | ~FXFileStream () |
QIODevice * | device () const |
void | setDevice (QIODevice *dev) |
FXDEPRECATEDEXT void | unsetDevice () |
bool | atEnd () const |
int | byteOrder () const |
void | setByteOrder (int b) |
FXDEPRECATEDEXT FXStream & | readBytes (char *&s, FXuint &l) |
FXStream & | readRawBytes (char *buffer, FXuval len) |
FXStream & | readRawBytes (FXuchar *buffer, FXuval len) |
FXDEPRECATEDEXT FXStream & | writeBytes (const char *s, FXuint l) |
FXStream & | writeRawBytes (const char *buffer, FXuval len) |
FXStream & | writeRawBytes (const FXuchar *buffer, FXuval len) |
FXfval | rewind (FXint amount) |
FXDEPRECATEDEXT bool | open (FXStreamDirection save_or_load, FXuval size=8192, FXuchar *data=NULL) |
virtual FXDEPRECATEDEXT bool | flush () |
FXDEPRECATEDEXT FXuval | getSpace () const |
FXDEPRECATEDEXT void | setSpace (FXuval sp) |
FXDEPRECATEDEXT FXStreamStatus | status () const |
bool | eof () const |
FXDEPRECATEDEXT void | setError (FXStreamStatus err) |
FXDEPRECATEDEXT FXStreamDirection | direction () const |
FXDEPRECATEDEXT const FXObject * | container () const |
FXlong | position () const |
virtual bool | position (FXlong offset, FXWhence whence=FXFromStart) |
void | swapBytes (FXint s) |
bool | swapBytes () const |
void | setBigEndian (bool big) |
bool | isBigEndian () const |
FXStream & | save (const FXuchar *p, unsigned long n) |
FXStream & | save (const FXchar *p, unsigned long n) |
FXStream & | save (const FXushort *p, unsigned long n) |
FXStream & | save (const FXshort *p, unsigned long n) |
FXStream & | save (const FXuint *p, unsigned long n) |
FXStream & | save (const FXint *p, unsigned long n) |
FXStream & | save (const FXfloat *p, unsigned long n) |
FXStream & | save (const FXdouble *p, unsigned long n) |
FXStream & | save (const FXlong *p, unsigned long n) |
FXStream & | save (const FXulong *p, unsigned long n) |
FXStream & | load (FXuchar *p, unsigned long n) |
FXStream & | load (FXchar *p, unsigned long n) |
FXStream & | load (FXushort *p, unsigned long n) |
FXStream & | load (FXshort *p, unsigned long n) |
FXStream & | load (FXuint *p, unsigned long n) |
FXStream & | load (FXint *p, unsigned long n) |
FXStream & | load (FXfloat *p, unsigned long n) |
FXStream & | load (FXdouble *p, unsigned long n) |
FXStream & | load (FXlong *p, unsigned long n) |
FXStream & | load (FXulong *p, unsigned long n) |
FXStream & | saveObject (const FXObject *v) |
FXStream & | loadObject (FXObject *&v) |
FXStream & | addObject (const FXObject *v) |
Protected Member Functions | |
virtual FXuval | writeBuffer (FXuval count) |
virtual FXuval | readBuffer (FXuval count) |
Protected Attributes | |
FXHash * | hash |
const FXObject * | parent |
FXuchar * | begptr |
FXuchar * | endptr |
FXuchar * | wrptr |
FXuchar * | rdptr |
FXlong | pos |
FXStreamDirection | dir |
FXStreamStatus | code |
FXuint | seq |
bool | owns |
bool | swap |
QIODevice * | dev |
Friends | |
struct | Generic::hasSerialise |
struct | Generic::hasDeserialise |
FXStream & | operator<< (FXStream &s, const FXuchar &v) |
FXStream & | operator<< (FXStream &s, const FXchar &v) |
FXStream & | operator<< (FXStream &s, const FXushort &_v) |
FXStream & | operator<< (FXStream &s, const FXshort &v) |
FXStream & | operator<< (FXStream &s, const FXuint &_v) |
FXStream & | operator<< (FXStream &s, const FXint &v) |
FXStream & | operator<< (FXStream &s, const FXfloat &_v) |
FXStream & | operator<< (FXStream &s, const FXdouble &_v) |
FXStream & | operator<< (FXStream &s, const FXlong &v) |
FXStream & | operator<< (FXStream &s, const FXulong &_v) |
FXStream & | operator<< (FXStream &s, const char *v) |
FXStream & | operator<< (FXStream &s, const bool &_v) |
FXStream & | operator>> (FXStream &s, FXuchar &v) |
FXStream & | operator>> (FXStream &s, FXchar &v) |
FXStream & | operator>> (FXStream &s, FXushort &v) |
FXStream & | operator>> (FXStream &s, FXshort &v) |
FXStream & | operator>> (FXStream &s, FXuint &v) |
FXStream & | operator>> (FXStream &s, FXint &v) |
FXStream & | operator>> (FXStream &s, FXfloat &v) |
FXStream & | operator>> (FXStream &s, FXdouble &v) |
FXStream & | operator>> (FXStream &s, FXlong &v) |
FXStream & | operator>> (FXStream &s, FXulong &v) |
FXStream & | operator>> (FXStream &s, bool &v) |
FXDEPRECATEDEXT FX::FXFileStream::FXFileStream | ( | const FXObject * | cont = NULL |
) |
Create file store.
virtual FX::FXFileStream::~FXFileStream | ( | ) | [virtual] |
Destructor.
bool FX::FXFileStream::open | ( | const FXString & | filename, | |
FXStreamDirection | save_or_load, | |||
FXuval | size = 8192 | |||
) |
Open binary data file stream; allocate a buffer of the given size for the file I/O; the buffer must be at least 16 bytes.
virtual bool FX::FXFileStream::close | ( | ) | [virtual] |
QIODevice* FX::FXStream::device | ( | ) | const [inline, inherited] |
Returns the i/o device this stream is using.
void FX::FXStream::setDevice | ( | QIODevice * | dev | ) | [inherited] |
Sets the i/o device this stream is using.
FXDEPRECATEDEXT void FX::FXStream::unsetDevice | ( | ) | [inline, inherited] |
bool FX::FXStream::atEnd | ( | ) | const [inline, inherited] |
Returns true if there is no more data to be read.
int FX::FXStream::byteOrder | ( | ) | const [inline, inherited] |
Returns the byte order the data on the i/o device shall be interpreted in.
void FX::FXStream::setByteOrder | ( | int | b | ) | [inline, inherited] |
Sets the byte order the data on the i/o device shall be interpreted in.
FXDEPRECATEDEXT FXStream& FX::FXStream::readBytes | ( | char *& | s, | |
FXuint & | l | |||
) | [inherited] |
FXStream& FX::FXStream::readRawBytes | ( | char * | buffer, | |
FXuval | len | |||
) | [inline, inherited] |
Reads preformatted byte data into the specified buffer.
FXDEPRECATEDEXT FXStream& FX::FXStream::writeBytes | ( | const char * | s, | |
FXuint | l | |||
) | [inherited] |
FXStream& FX::FXStream::writeRawBytes | ( | const char * | buffer, | |
FXuval | len | |||
) | [inline, inherited] |
Writes preformatted byte data from the specified buffer.
FXfval FX::FXStream::rewind | ( | FXint | amount | ) | [inherited] |
Moves the file pointer backwards by the specified amount of bytes, returning the new file pointer.
virtual FXuval FX::FXStream::writeBuffer | ( | FXuval | count | ) | [protected, virtual, inherited] |
Write at least count bytes from the buffer; returns number of bytes available to be written.
virtual FXuval FX::FXStream::readBuffer | ( | FXuval | count | ) | [protected, virtual, inherited] |
Read at least count bytes into the buffer; returns number of bytes available to be read.
FXDEPRECATEDEXT bool FX::FXStream::open | ( | FXStreamDirection | save_or_load, | |
FXuval | size = 8192 , |
|||
FXuchar * | data = NULL | |||
) | [inherited] |
Reimplemented in FX::FXMemoryStream.
virtual FXDEPRECATEDEXT bool FX::FXStream::flush | ( | ) | [virtual, inherited] |
Reimplemented in FX::FXBZFileStream, and FX::FXGZFileStream.
FXDEPRECATEDEXT FXuval FX::FXStream::getSpace | ( | ) | const [inherited] |
FXDEPRECATEDEXT void FX::FXStream::setSpace | ( | FXuval | sp | ) | [inherited] |
FXDEPRECATEDEXT FXStreamStatus FX::FXStream::status | ( | ) | const [inline, inherited] |
bool FX::FXStream::eof | ( | ) | const [inline, inherited] |
Return true if at end of file or error.
FXDEPRECATEDEXT void FX::FXStream::setError | ( | FXStreamStatus | err | ) | [inherited] |
FXDEPRECATEDEXT FXStreamDirection FX::FXStream::direction | ( | ) | const [inline, inherited] |
FXDEPRECATEDEXT const FXObject* FX::FXStream::container | ( | ) | const [inline, inherited] |
FXlong FX::FXStream::position | ( | ) | const [inherited] |
Get position.
virtual bool FX::FXStream::position | ( | FXlong | offset, | |
FXWhence | whence = FXFromStart | |||
) | [virtual, inherited] |
Move to position relative to head, tail, or current location.
void FX::FXStream::swapBytes | ( | FXint | s | ) | [inline, inherited] |
Change swap bytes flag. -1 sets machine default (ie; do swap on big endian machines).
bool FX::FXStream::swapBytes | ( | ) | const [inline, inherited] |
Get state of the swap bytes flag.
void FX::FXStream::setBigEndian | ( | bool | big | ) | [inline, inherited] |
Set stream to big endian mode if true. Byte swapping will be enabled if the machine native byte order is not equal to the desired byte order.
bool FX::FXStream::isBigEndian | ( | ) | const [inline, inherited] |
Return true if big endian mode.
FXStream& FX::FXStream::save | ( | const FXuchar * | p, | |
unsigned long | n | |||
) | [inline, inherited] |
Save arrays of items to stream.
FXStream& FX::FXStream::load | ( | FXuchar * | p, | |
unsigned long | n | |||
) | [inline, inherited] |
Load arrays of items from stream.
Add object without saving or loading.
Save single items to stream.
Load single items from stream.