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