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