home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2003 November / VPR0311.ISO / OLS / TAR32223 / tar32223.lzh / tar32_2 / src / arcgz.h < prev    next >
C/C++ Source or Header  |  2003-01-17  |  2KB  |  72 lines

  1. /*
  2.     arcgz.h
  3.         gzip archive input/output class.
  4.         by Yoshioka Tsuneo(QWF00133@nifty.ne.jp)
  5. */
  6. /*    
  7.     このファイルの利用条件:
  8.         このソースファイルの利用制限は一切ありません。
  9.         ソースの一部、全部を商用、非商用など目的に
  10.         かかわりなく他のプログラムで自由に使用できます。
  11.         パブリック・ドメイン・ソフトウェアと同様に扱えます。
  12.     
  13.     プログラマ向けの要望(制限ではありません):
  14.         ソース中に改善すべき点があればお知らせください。
  15.         ソースコード中にバグを見つけた場合は報告してください。
  16.         直した部分などありましたら教えてください。
  17.         断片的な情報でも結構です。
  18.         このファイルを利用した場合はなるべく教えてください。
  19. */
  20. /*
  21.     LICENSE of this file:
  22.         There is no restriction for using this file.
  23.         You can use this file in your software for any purpose.
  24.         In other words, you can use this file as Public Domain Software.
  25.  
  26.     RECOMMENDATION for Programmer(not restriction):
  27.         If you find points to improve code, please report me.
  28.         If you find bug in source code, please report me.
  29.         If you fixed bug, please teach me.
  30.         I want any trivial information.
  31.         If you use this file, please report me.
  32. */
  33.  
  34. #include "arcfile.h"
  35. #include "zlib.h"
  36. #include "tar32api.h" // ARCHIVETYPE_
  37.  
  38. class CTarArcFile_GZip : public ITarArcFile{
  39. public:
  40.     CTarArcFile_GZip();
  41.     ~CTarArcFile_GZip();
  42.     bool open(const char *arcfile, const char *mode);
  43.     int read(void *buf, int size);
  44.     int write(void *buf, int size);
  45.     int seek(int offset, int origin);
  46.     void close();
  47.     int get_archive_type(){return ARCHIVETYPE_GZ;}
  48.     virtual string get_orig_filename();
  49. private:
  50.     gzFile m_gzFile;
  51.  
  52.     /* gzip flag byte */
  53.     static const GZIP_FLAG_ASCII_FLAG;//   =0x01; /* bit 0 set: file probably ascii text */
  54.     static const GZIP_FLAG_CONTINUATION;// =0x02; /* bit 1 set: continuation of multi-part gzip file */
  55.     static const GZIP_FLAG_EXTRA_FIELD;//  =0x04; /* bit 2 set: extra field present */
  56.     static const GZIP_FLAG_ORIG_NAME;//    =0x08; /* bit 3 set: original file name present */
  57.     static const GZIP_FLAG_COMMENT;//      =0x10; /* bit 4 set: file comment present */
  58.     static const GZIP_FLAG_ENCRYPTED;//    =0x20; /* bit 5 set: file is encrypted */
  59.     static const GZIP_FLAG_RESERVED;//     =0xC0; /* bit 6,7:   reserved */
  60.     static const GZIP_METHOD_DEFLATED;//   =8;
  61.  
  62.     int        m_gzip_compress_method;
  63.     unsigned         m_gzip_flags;
  64.     time_t    m_gzip_time_stamp;
  65.     unsigned        m_gzip_ext_flag;
  66.     int        m_gzip_os_type;
  67.  
  68.     int        m_gzip_part;
  69.     string    m_gzip_orig_name;
  70.     string    m_gzip_comment;
  71. };
  72.