00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CFileGZOutputStream_H
00029 #define CFileGZOutputStream_H
00030
00031 #include <mrpt/utils/CStream.h>
00032
00033 #include <iostream>
00034
00035
00036
00037
00038 namespace mrpt
00039 {
00040 namespace utils
00041 {
00048 #if !MRPT_HAS_GZ_STREAMS
00049
00050 # define CFileGZOutputStream CFileOutputStream
00051 #else
00052 class MRPTDLLIMPEXP CFileGZOutputStream : public CStream, public CUncopiable
00053 {
00054 protected:
00057 size_t Read(void *Buffer, size_t Count);
00058
00062 size_t Write(const void *Buffer, size_t Count);
00063
00064 DECLARE_UNCOPIABLE( CFileGZOutputStream )
00065
00066 private:
00067 void *m_f;
00068
00069 public:
00074 CFileGZOutputStream(const std::string &fileName);
00075
00079 CFileGZOutputStream();
00080
00086 bool open(const std::string &fileName, int compress_level = 1 );
00087
00089 void close();
00090
00093 virtual ~CFileGZOutputStream();
00094
00097 bool fileOpenCorrectly();
00098
00101 size_t getPosition();
00102
00104 size_t Seek(long Offset, CStream::TSeekOrigin Origin = sFromBeginning)
00105 {
00106 THROW_EXCEPTION("Seek is not implemented in this class");
00107 }
00108
00110 size_t getTotalBytesCount()
00111 {
00112 THROW_EXCEPTION("getTotalBytesCount is not implemented in this class");
00113 }
00114
00115 };
00116 #endif
00117
00118 }
00119 }
00120 #endif