00001 #ifndef _CTBzfile_HXX
00002 #define _CTBzfile_HXX 1
00003
00008
00009
00010
00011
00012
00013
00014
00015
00016 class CTBzfile {
00017
00018 public:
00019
00020 CTBzfile();
00021
00022 ~CTBzfile();
00023
00024 bool Open(const char *c_name, const char *c_mode);
00025 void Close();
00026
00027 CTBint Read(void* p_buf, CTBint i_size);
00028 CTBint Write(const void* p_buf, CTBint i_size);
00029
00030 CTBint ReadObject(void* p_buf, CTBint i_size);
00031 CTBint WriteObject(const void* p_buf, CTBint i_size);
00032
00033 bool Good();
00034 bool Bad();
00035 bool Fail();
00036 bool Eof();
00037
00038 void Dump(int i_indent=0, ostream& os=cout,
00039 const char* p_text=0) const;
00040
00041 private:
00042
00043 enum type { closed = 0,
00044 cfile,
00045 gzfile
00046 };
00047
00048 int mi_type;
00049 void* m_file;
00050 bool mb_bad;
00051 bool mb_eof;
00052 };
00053
00054
00055 #endif