00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifdef HAVE_BZ2LIB_H
00022 #ifndef FXBZFILESTREAM_H
00023 #define FXBZFILESTREAM_H
00024
00025 #ifndef FXFILESTREAM_H
00026 #include "FXFileStream.h"
00027 #endif
00028
00029
00030 namespace FX {
00031
00032
00033 struct BZBlock;
00034
00035
00037 class FXAPI FXBZFileStream : public FXFileStream {
00038 private:
00039 BZBlock *bz;
00040 int ac;
00041 protected:
00042 virtual FXuval writeBuffer(FXuval count);
00043 virtual FXuval readBuffer(FXuval count);
00044 public:
00045
00047 FXBZFileStream(const FXObject* cont=NULL);
00048
00050 FXBZFileStream(const FXString& filename,FXStreamDirection save_or_load=FXStreamLoad,FXuval size=8192UL);
00051
00053 FXbool open(const FXString& filename,FXStreamDirection save_or_load=FXStreamLoad,FXuval size=8192UL);
00054
00056 virtual FXbool flush();
00057
00059 virtual FXbool close();
00060
00062 FXlong position() const { return FXStream::position(); }
00063
00065 virtual FXbool position(FXlong,FXWhence){ return false; }
00066
00068 FXBZFileStream& operator<<(const FXuchar& v){ FXStream::operator<<(v); return *this; }
00069 FXBZFileStream& operator<<(const FXchar& v){ FXStream::operator<<(v); return *this; }
00070 FXBZFileStream& operator<<(const FXbool& v){ FXStream::operator<<(v); return *this; }
00071 FXBZFileStream& operator<<(const FXushort& v){ FXStream::operator<<(v); return *this; }
00072 FXBZFileStream& operator<<(const FXshort& v){ FXStream::operator<<(v); return *this; }
00073 FXBZFileStream& operator<<(const FXuint& v){ FXStream::operator<<(v); return *this; }
00074 FXBZFileStream& operator<<(const FXint& v){ FXStream::operator<<(v); return *this; }
00075 FXBZFileStream& operator<<(const FXfloat& v){ FXStream::operator<<(v); return *this; }
00076 FXBZFileStream& operator<<(const FXdouble& v){ FXStream::operator<<(v); return *this; }
00077 FXBZFileStream& operator<<(const FXlong& v){ FXStream::operator<<(v); return *this; }
00078 FXBZFileStream& operator<<(const FXulong& v){ FXStream::operator<<(v); return *this; }
00079
00081 FXBZFileStream& save(const FXuchar* p,FXuval n){ FXStream::save(p,n); return *this; }
00082 FXBZFileStream& save(const FXchar* p,FXuval n){ FXStream::save(p,n); return *this; }
00083 FXBZFileStream& save(const FXbool* p,FXuval n){ FXStream::save(p,n); return *this; }
00084 FXBZFileStream& save(const FXushort* p,FXuval n){ FXStream::save(p,n); return *this; }
00085 FXBZFileStream& save(const FXshort* p,FXuval n){ FXStream::save(p,n); return *this; }
00086 FXBZFileStream& save(const FXuint* p,FXuval n){ FXStream::save(p,n); return *this; }
00087 FXBZFileStream& save(const FXint* p,FXuval n){ FXStream::save(p,n); return *this; }
00088 FXBZFileStream& save(const FXfloat* p,FXuval n){ FXStream::save(p,n); return *this; }
00089 FXBZFileStream& save(const FXdouble* p,FXuval n){ FXStream::save(p,n); return *this; }
00090 FXBZFileStream& save(const FXlong* p,FXuval n){ FXStream::save(p,n); return *this; }
00091 FXBZFileStream& save(const FXulong* p,FXuval n){ FXStream::save(p,n); return *this; }
00092
00094 FXBZFileStream& operator>>(FXuchar& v){ FXStream::operator>>(v); return *this; }
00095 FXBZFileStream& operator>>(FXchar& v){ FXStream::operator>>(v); return *this; }
00096 FXBZFileStream& operator>>(FXbool& v){ FXStream::operator>>(v); return *this; }
00097 FXBZFileStream& operator>>(FXushort& v){ FXStream::operator>>(v); return *this; }
00098 FXBZFileStream& operator>>(FXshort& v){ FXStream::operator>>(v); return *this; }
00099 FXBZFileStream& operator>>(FXuint& v){ FXStream::operator>>(v); return *this; }
00100 FXBZFileStream& operator>>(FXint& v){ FXStream::operator>>(v); return *this; }
00101 FXBZFileStream& operator>>(FXfloat& v){ FXStream::operator>>(v); return *this; }
00102 FXBZFileStream& operator>>(FXdouble& v){ FXStream::operator>>(v); return *this; }
00103 FXBZFileStream& operator>>(FXlong& v){ FXStream::operator>>(v); return *this; }
00104 FXBZFileStream& operator>>(FXulong& v){ FXStream::operator>>(v); return *this; }
00105
00107 FXBZFileStream& load(FXuchar* p,FXuval n){ FXStream::load(p,n); return *this; }
00108 FXBZFileStream& load(FXchar* p,FXuval n){ FXStream::load(p,n); return *this; }
00109 FXBZFileStream& load(FXbool* p,FXuval n){ FXStream::load(p,n); return *this; }
00110 FXBZFileStream& load(FXushort* p,FXuval n){ FXStream::load(p,n); return *this; }
00111 FXBZFileStream& load(FXshort* p,FXuval n){ FXStream::load(p,n); return *this; }
00112 FXBZFileStream& load(FXuint* p,FXuval n){ FXStream::load(p,n); return *this; }
00113 FXBZFileStream& load(FXint* p,FXuval n){ FXStream::load(p,n); return *this; }
00114 FXBZFileStream& load(FXfloat* p,FXuval n){ FXStream::load(p,n); return *this; }
00115 FXBZFileStream& load(FXdouble* p,FXuval n){ FXStream::load(p,n); return *this; }
00116 FXBZFileStream& load(FXlong* p,FXuval n){ FXStream::load(p,n); return *this; }
00117 FXBZFileStream& load(FXulong* p,FXuval n){ FXStream::load(p,n); return *this; }
00118
00120 FXBZFileStream& saveObject(const FXObject* v){ FXStream::saveObject(v); return *this; }
00121
00123 FXBZFileStream& loadObject(FXObject*& v){ FXStream::loadObject(v); return *this; }
00124
00126 virtual ~FXBZFileStream();
00127 };
00128
00129
00130 }
00131
00132 #endif
00133 #endif