Lhaz
読み取り中…
検索中…
一致する文字列を見つけられません
lhaztgz.h
[詳解]
1#ifndef _LHAZTGZ_H
2#define _LHAZTGZ_H
3
4#include <windows.h>
5#include <stdio.h>
6#include <vector>
7#include "lhazarc.h"
8#include "../zlib/zlib.h"
9
10using namespace std;
11
12class CTAR;
13class LHAZPROCFILE;
14class PATH;
15
16namespace gui {
17
18class LHAZTREEVIEW;
19
20} // namespace gui
21
22class ARCTGZ : public ARCHIVE {
23public:
24 static const unsigned char HEADER[2];
25 // 全解凍用コンストラクタ
26 ARCTGZ(HWND hwnd, const WSTR& name, TYPE type);
27 // 閲覧用コンストラクタ
28 ARCTGZ(HWND hwnd, const WSTR& name, TYPE type, const WSTR& filter, gui::LHAZTREEVIEW* treeview);
29 // デストラクタ
30 ‾ARCTGZ(void);
31 // 全解凍
32 bool Extract(bool verify, const WSTR& temp, const WSTR& password);
33 // 個別解凍
34 bool Extract(const WSTR& temp);
35 // 圧縮
36 bool Compress(int method, int header, const WSTR& pass, const PATH& temp, const vector<LHAZPROCFILE>& v);
37 // 個別削除
38 bool Delete(const vector<LHAZFILE*>& v);
39 //
40 static bool IsArchiveTgz(const WSTR& name);
41 static bool IsArchiveTar(int size, char* buf);
42private:
43 class FP {
44 public:
45 FP(void) { Fp = NULL; Gz = NULL; Fdgz = 0; };
46 ‾FP(void) {
47 Close();
48 }
49 bool Open(TYPE type, const char* name, const char* mode) {
50#ifdef FEATURE_TGZ
51 if (type == TGZ) {
52 if ((Gz = gzopen(name, mode, &Fdgz)) == NULL)
53 return false;
54 } else {
55#endif // FEATURE_TGZ
56 Fp = _fsopen(name, mode, _SH_DENYNO);
57 if (Fp == NULL) {
58 return false;
59 }
60#ifdef FEATURE_TGZ
61 }
62#endif // FEATURE_TGZ
63 return true;
64 }
65 void Close(void) {
66 if (Fp) {
67 fclose(Fp);
68 Fp = NULL;
69 }
70 if (Gz) {
71 gzclose(Gz);
72 Gz = NULL;
73 }
74 }
75 FILE* Fp;
76 gzFile Gz;
77 int Fdgz;
78 };
79 //
80 static const char METHOD[];
82 //
83 bool Test(void);
84 bool SkipWithCalcCRC(CTAR* tar, LONGLONG size, unsigned long& crc);
85};
86
87#endif
Definition lhazarc.h:25
TYPE
Definition lhazarc.h:28
@ TGZ
Definition lhazarc.h:34
Definition lhaztgz.h:43
gzFile Gz
Definition lhaztgz.h:76
void Close(void)
Definition lhaztgz.h:65
‾FP(void)
Definition lhaztgz.h:46
bool Open(TYPE type, const char *name, const char *mode)
Definition lhaztgz.h:49
FP(void)
Definition lhaztgz.h:45
FILE * Fp
Definition lhaztgz.h:75
int Fdgz
Definition lhaztgz.h:77
Definition lhaztgz.h:22
bool Delete(const vector< LHAZFILE * > &v)
Definition lhaztgz.cpp:347
static bool IsArchiveTar(int size, char *buf)
Definition lhaztgz.cpp:488
bool Extract(bool verify, const WSTR &temp, const WSTR &password)
Definition lhaztgz.cpp:205
static bool IsArchiveTgz(const WSTR &name)
Definition lhaztgz.cpp:467
int CountAll
Definition lhaztgz.h:81
bool Compress(int method, int header, const WSTR &pass, const PATH &temp, const vector< LHAZPROCFILE > &v)
Definition lhaztgz.cpp:289
static const unsigned char HEADER[2]
Definition lhaztgz.h:29
bool SkipWithCalcCRC(CTAR *tar, LONGLONG size, unsigned long &crc)
Definition lhaztgz.cpp:521
bool Test(void)
Definition lhaztgz.cpp:408
‾ARCTGZ(void)
Definition lhaztgz.cpp:198
static const char METHOD[]
Definition lhaztgz.h:80
Definition tar.h:14
Definition lhazprocfile.h:11
Definition lhaztreeview.h:18
Archive
¥ type v
Definition lhazregs.h:21
Definition lhazbz2.h:17