Lhaz
読み取り中…
検索中…
一致する文字列を見つけられません
lhazzip.h
[詳解]
1/*==========================================================================*/
2/* Lhaz ZIP/UNZIPインタフェース lhaz@chitora.jp */
3/*==========================================================================*/
4#ifndef _LHAZZIP_H
5#define _LHAZZIP_H
6
7#include <windows.h>
8#include <stdio.h>
9#include <vector>
10#include "lhazarc.h"
11
12class LHAZPROCFILE;
13class MYFILE;
14class PATH;
15
16namespace gui {
17
18class LHAZTREEVIEW;
19
20} // namespace gui
21
22class ARCZIP : public ARCHIVE {
23public:
24 // 圧縮・解凍用コンストラクタ
25 ARCZIP(HWND hwnd, const WSTR& name, TYPE type);
26 // 閲覧用コンストラクタ
27 ARCZIP(HWND hwnd, const WSTR& name, TYPE type, const WSTR& filter, gui::LHAZTREEVIEW* treeview);
28 // デストラクタ
29 ‾ARCZIP(void);
30 // 全解凍
31 bool Extract(bool verify, const WSTR& temp, const WSTR& password);
32 // 個別解凍
33 bool Extract(const WSTR& temp);
34 // 圧縮
35 bool Compress(int method, int header, const WSTR& pass, const PATH& temp, const std::vector<LHAZPROCFILE>& v);
36 // 個別削除
37 bool Delete(const std::vector<LHAZFILE*>& v);
38 // 書庫判定
39 static bool IsArchiveZip(int size, char* buf);
40 static bool IsArchiveZip(const WSTR& name, bool& enc);
41 //
42 static const char HEADER[4];
43 static const char EOA[4];
44 static const char ENT[4];
45 static const char EN2[4];
46
47private:
48 static const TCHAR* METHODS[];
49 static const int EOA_RECORD_SIZE_MAX;
50 //
51 static bool SearchDirEnt(MYFILE& fp, TYPE type, unsigned long& dir_size, int& files);
52
53};
54
56public:
57 ZIP_DIR_ENTRY(void);
58 ‾ZIP_DIR_ENTRY(void);
59 //
60 bool Get(unsigned char**);
61 bool Get(MYFILE& fp);
62 unsigned short GetFlag(void) { return Flag; }
63 unsigned short GetMethod(void) { return Method; }
64 unsigned long GetDate(void) { return Date; }
65 unsigned long GetCsize(void) { return Csize; }
66 unsigned long GetSize(void) { return Size; }
67 const char* GetName(void) { return Name; }
68 unsigned char GetAtrib(void) { return Atrib; }
69 bool IsUTF8(void) const { return ((Flag & 0x0800) != 0); }
70
71private:
72 unsigned short Flag; // 汎用ビットフラグ
73 unsigned short Method; // 形式
74 unsigned long Date; // 日付
75 unsigned long Csize; // 圧縮サイズ
76 unsigned long Size; // サイズ
77 char* Name; // ファイル名
78 unsigned char Atrib; // アトリビュート
79
80};
81
82#endif // _LHAZZIP_H
Definition lhazarc.h:25
TYPE
Definition lhazarc.h:28
Definition lhazzip.h:22
static const int EOA_RECORD_SIZE_MAX
Definition lhazzip.h:49
static bool SearchDirEnt(MYFILE &fp, TYPE type, unsigned long &dir_size, int &files)
Definition lhazzip.cpp:380
static const char ENT[4]
Definition lhazzip.h:26
static const char EN2[4]
Definition lhazzip.h:27
bool Delete(const std::vector< LHAZFILE * > &v)
Definition lhazzip.cpp:278
static bool IsArchiveZip(int size, char *buf)
Definition lhazzip.cpp:311
‾ARCZIP(void)
Definition lhazzip.cpp:175
static const TCHAR * METHODS[]
Definition lhazzip.h:28
static const char EOA[4]
Definition lhazzip.h:25
bool Compress(int method, int header, const WSTR &pass, const PATH &temp, const std::vector< LHAZPROCFILE > &v)
Definition lhazzip.cpp:240
bool Extract(bool verify, const WSTR &temp, const WSTR &password)
Definition lhazzip.cpp:182
static const char HEADER[4]
Definition lhazzip.h:41
Definition lhazprocfile.h:11
Definition lhazzip.h:55
unsigned long Date
Definition lhazzip.h:74
unsigned char Atrib
Definition lhazzip.h:78
unsigned char GetAtrib(void)
Definition lhazzip.h:68
unsigned long Csize
Definition lhazzip.h:75
unsigned long GetCsize(void)
Definition lhazzip.h:65
‾ZIP_DIR_ENTRY(void)
Definition lhazzip.cpp:469
unsigned short Flag
Definition lhazzip.h:72
unsigned long GetSize(void)
Definition lhazzip.h:66
unsigned short GetMethod(void)
Definition lhazzip.h:63
unsigned long Size
Definition lhazzip.h:76
unsigned short Method
Definition lhazzip.h:73
unsigned short GetFlag(void)
Definition lhazzip.h:62
char * Name
Definition lhazzip.h:77
unsigned long GetDate(void)
Definition lhazzip.h:64
bool Get(unsigned char **)
Definition lhazzip.cpp:477
const char * GetName(void)
Definition lhazzip.h:67
bool IsUTF8(void) const
Definition lhazzip.h:69
ZIP_DIR_ENTRY(void)
Definition lhazzip.cpp:455
Definition lhaztreeview.h:18
Archive
¥ type v
Definition lhazregs.h:21
Definition lhazbz2.h:17