Lhaz
読み取り中…
検索中…
一致する文字列を見つけられません
lhazarc.h
[詳解]
1/*************************************************************************/
6#pragma once
7
8#include "altstr.hpp"
9#include <vector>
10#include <windows.h>
11#include <commctrl.h>
12
13class LHAZPROCFILE;
14class LHAZFILE;
15class LHAZFILETREE;
16class PATH;
17
18namespace gui {
19
20class LVCOLMS;
21class LHAZTREEVIEW;
22
23} // namespace gui
24
25class ARCHIVE {
26
27public:
57 //
58 static TYPE GetArchiveType(const WSTR& name, bool& pass_correct);
59 static TYPE GetArchiveTypeByName(const WSTR& name);
60 static bool IsSingleFileCompressed(TYPE type);
61 static bool IsUnicodeSupport(TYPE type);
62 //
63 ARCHIVE(HWND hwnd, const WSTR& name, TYPE type, gui::LHAZTREEVIEW* treeview);
64 static ARCHIVE* Create(HWND hwnd, const WSTR& name, TYPE type);
65 static ARCHIVE* Create(HWND hwnd, const WSTR& name, TYPE type, TCHAR* filter, gui::LHAZTREEVIEW* treeview);
66 virtual ‾ARCHIVE();
67 // 全解凍
68 virtual COMPLETE Extract(bool verify, const WSTR& temp, const WSTR& password) = 0;
69 // 部分解凍
70 virtual COMPLETE Extract(const WSTR& temp) = 0;
71 // 圧縮
72 virtual bool Compress(int method, int header, const WSTR& pass, const PATH& temp, const std::vector<LHAZPROCFILE>& v) = 0;
73 // 削除
74 virtual bool Delete(const std::vector<LHAZFILE*>& v) = 0;
75 //
76 bool CanAppend(UINT& mes_id);
77 void ClearExtFile() { ExtFile.clear(); }
78 bool CompExlude(const WSTR& name);
79 bool DoMakeDir() const { return MakeDir; }
80 void Filt(const WSTR& filter);
81 void Filt(const WSTR& filter, const LHAZFILETREE* node);
82 const WSTR& GetAllName(int idx) const;
83 std::size_t GetCount() const { return List.size(); }
84 const WSTR& GetCsizeText(int idx) const;
85 const WSTR& GetCsizeTextKB(int idx) const;
86 const WSTR& GetDir(int idx) const;
87 ::size_t GetDspCount() const { return SortTable.size(); }
88 bool GetEncrypt() const { return Encrypt; }
89 std::vector<LHAZFILE*>& GetExtFile() { return ExtFile; }
90 LONGLONG GetExtMemberTotal() const;
91 LHAZFILE* GetFile(int idx) const;
92 const WSTR& GetFname(int idx) const;
93 int GetImage(int idx) const;
94 const std::vector<LHAZFILE*>& GetList() const { return List; }
95 const WSTR& GetMethodText(int idx) const;
96 const WSTR& GetName() const { return Name; }
97 const WSTR& GetName(int idx) const;
98 const WSTR& GetOneDir() const { return OneDir; }
99 const WSTR& GetRatioText(int idx) const;
100 LONGLONG GetSize(int idx) const;
101 const WSTR& GetSizeText(int idx) const;
102 const WSTR& GetSizeTextKB(int idx) const;
103 const WSTR& GetTimeText(int idx) const;
104 LONGLONG GetTotal() const { return Total; }
105 LHAZFILETREE* GetTree() const { return Tree; }
106 LHAZFILETREE* GetTree(int idx) const;
107 TYPE GetType() const { return Type; }
108 const WSTR& GetType(int idx) const;
109 bool IsDir(int idx) const;
110 bool IsVirtual(int idx) const;
111 void ListAllMember();
112 void ListExtMember(const std::vector<int>& indxs, bool add = false);
113 void ListExtMemberDescendant(const WSTR& dir, const WSTR& filter);
114 void SetName(const WSTR& name);
115 void Sort(int kind, int rev);
116
117protected:
118 static const size_t SFXSIZE; /* 自己解凍ルーチンスキップサイズ */
119 //
120 HWND Hwnd; /* 親ウィンドウハンドル */
121 WSTR Name; /* 書庫ファイル名 */
122 TYPE Type; /* 書庫種別 */
123 LONGLONG Total; /* 書庫内総ファイルサイズ */
124 bool MakeDir; /* フォルダ作成必要か */
125 WSTR OneDir; /* ひとつのフォルダ配下 */
126 bool Encrypt; /* 暗号化 */
127 std::vector<LHAZFILE*> List; /* 書庫内ファイルリスト */
128 std::vector<LHAZFILE*> SortTable; /* ソートテーブル */
129 std::vector<LHAZFILE*> ExtFile; /* 解凍対象 */
130 LHAZFILETREE* Tree; /* ツリー */
131 //
132 bool IsSameDir(WSTR& dirbuf, const WSTR& curdir);
133 void AppendList(const WSTR& name, std::vector<WSTR>& list);
134 void AppendListProcFile(const WSTR& name, std::vector<LHAZPROCFILE>& list);
135 void AppendListWithDir(const WSTR& name, std::vector<WSTR>& list, bool& unicode_file_exist);
136 int ShareError(const WSTR& name);
137
138private:
139 struct EXT_TABLE {
141 const TCHAR* ext;
142 };
143 //
144 static const EXT_TABLE m_ext_table[]; /* Extensions table */
145 static const char MZHEADER[]; /* EXEヘッダ */
146 //
147 static bool IsOfficeOpenXML(const WSTR& name);
148
149};
Definition lhazarc.h:25
const WSTR & GetAllName(int idx) const
Definition lhazarc.cpp:783
const WSTR & GetRatioText(int idx) const
Definition lhazarc.cpp:863
static const EXT_TABLE m_ext_table[]
Definition lhazarc.h:66
virtual COMPLETE Extract(bool verify, const WSTR &temp, const WSTR &password)=0
void AppendListProcFile(const WSTR &name, std::vector< LHAZPROCFILE > &list)
Definition lhazarc.cpp:527
static const size_t SFXSIZE
Definition lhazarc.h:118
static const char MZHEADER[]
Definition lhazarc.h:64
const WSTR & GetCsizeTextKB(int idx) const
Definition lhazarc.cpp:847
TYPE GetType() const
Definition lhazarc.h:107
void SetName(const WSTR &name)
Definition lhazarc.cpp:367
const WSTR & GetDir(int idx) const
Definition lhazarc.cpp:879
std::vector< LHAZFILE * > ExtFile
Definition lhazarc.h:129
bool IsSameDir(WSTR &dirbuf, const WSTR &curdir)
Definition lhazarc.cpp:375
LHAZFILETREE * GetTree() const
Definition lhazarc.h:105
void Sort(int kind, int rev)
Definition lhazarc.cpp:350
LONGLONG GetTotal() const
Definition lhazarc.h:104
bool MakeDir
Definition lhazarc.h:124
static ARCHIVE * Create(HWND hwnd, const WSTR &name, TYPE type)
Definition lhazarc.cpp:154
std::vector< LHAZFILE * > SortTable
Definition lhazarc.h:128
const WSTR & GetFname(int idx) const
Definition lhazarc.cpp:855
const std::vector< LHAZFILE * > & GetList() const
Definition lhazarc.h:94
bool DoMakeDir() const
Definition lhazarc.h:79
WSTR Name
Definition lhazarc.h:121
LHAZFILETREE * Tree
Definition lhazarc.h:130
bool IsVirtual(int idx) const
Definition lhazarc.cpp:903
int GetImage(int idx) const
Definition lhazarc.cpp:887
LONGLONG GetSize(int idx) const
Definition lhazarc.cpp:799
HWND Hwnd
Definition lhazarc.h:120
virtual ‾ARCHIVE()
Definition lhazarc.cpp:264
void ListAllMember()
Definition lhazarc.cpp:340
COMPLETE
Definition lhazarc.h:56
@ ARC_ERROR
Definition lhazarc.h:56
@ ARC_CANCELED
Definition lhazarc.h:56
@ ARC_NO_ERROR
Definition lhazarc.h:56
@ ARC_STOPPED
Definition lhazarc.h:56
const WSTR & GetName() const
Definition lhazarc.h:96
bool IsDir(int idx) const
Definition lhazarc.cpp:895
bool Encrypt
Definition lhazarc.h:126
::size_t GetDspCount() const
Definition lhazarc.h:87
std::vector< LHAZFILE * > List
Definition lhazarc.h:127
TYPE Type
Definition lhazarc.h:122
void AppendList(const WSTR &name, std::vector< WSTR > &list)
Definition lhazarc.cpp:499
const WSTR & GetCsizeText(int idx) const
Definition lhazarc.cpp:839
const WSTR & GetMethodText(int idx) const
Definition lhazarc.cpp:871
static bool IsUnicodeSupport(TYPE type)
Definition lhazarc.cpp:764
void ListExtMemberDescendant(const WSTR &dir, const WSTR &filter)
Definition lhazarc.cpp:321
WSTR OneDir
Definition lhazarc.h:125
LONGLONG GetExtMemberTotal() const
Definition lhazarc.cpp:919
bool CompExlude(const WSTR &name)
Definition lhazarc.cpp:447
virtual bool Delete(const std::vector< LHAZFILE * > &v)=0
static TYPE GetArchiveType(const WSTR &name, bool &pass_correct)
Definition lhazarc.cpp:555
const WSTR & GetOneDir() const
Definition lhazarc.h:98
LHAZFILE * GetFile(int idx) const
Definition lhazarc.cpp:930
std::size_t GetCount() const
Definition lhazarc.h:83
void Filt(const WSTR &filter)
Definition lhazarc.cpp:277
TYPE
Definition lhazarc.h:28
@ SFXCAB
Definition lhazarc.h:41
@ XZ
Definition lhazarc.h:45
@ ZIP
Definition lhazarc.h:31
@ ONEDRIVE
Definition lhazarc.h:52
@ LZH
Definition lhazarc.h:30
@ CAB
Definition lhazarc.h:33
@ SFXLZH
Definition lhazarc.h:40
@ ISCAB
Definition lhazarc.h:44
@ GZIP
Definition lhazarc.h:36
@ DROPBOX
Definition lhazarc.h:53
@ SZIP
Definition lhazarc.h:39
@ GOOGLE_DOC
Definition lhazarc.h:51
@ BZ2
Definition lhazarc.h:38
@ TXZ
Definition lhazarc.h:46
@ ENCZIP
Definition lhazarc.h:32
@ NON
Definition lhazarc.h:29
@ MAX
Definition lhazarc.h:54
@ TBZ
Definition lhazarc.h:37
@ ZSTD
Definition lhazarc.h:49
@ TAR
Definition lhazarc.h:35
@ RAR
Definition lhazarc.h:43
@ LZMA
Definition lhazarc.h:48
@ TGZ
Definition lhazarc.h:34
@ LZ4
Definition lhazarc.h:47
@ TZST
Definition lhazarc.h:50
@ SFXZIP
Definition lhazarc.h:42
virtual COMPLETE Extract(const WSTR &temp)=0
const WSTR & GetSizeTextKB(int idx) const
Definition lhazarc.cpp:815
const WSTR & GetSizeText(int idx) const
Definition lhazarc.cpp:807
static TYPE GetArchiveTypeByName(const WSTR &name)
Definition lhazarc.cpp:738
void ClearExtFile()
Definition lhazarc.h:77
LONGLONG Total
Definition lhazarc.h:123
bool CanAppend(UINT &mes_id)
Definition lhazarc.cpp:959
int ShareError(const WSTR &name)
Definition lhazarc.cpp:753
const WSTR & GetTimeText(int idx) const
Definition lhazarc.cpp:831
static bool IsSingleFileCompressed(TYPE type)
IsSingleFileCompressed
Definition lhazarc.cpp:430
std::vector< LHAZFILE * > & GetExtFile()
Definition lhazarc.h:89
void ListExtMember(const std::vector< int > &indxs, bool add=false)
Definition lhazarc.cpp:309
bool GetEncrypt() const
Definition lhazarc.h:88
void AppendListWithDir(const WSTR &name, std::vector< WSTR > &list, bool &unicode_file_exist)
Definition lhazarc.cpp:460
virtual bool Compress(int method, int header, const WSTR &pass, const PATH &temp, const std::vector< LHAZPROCFILE > &v)=0
static bool IsOfficeOpenXML(const WSTR &name)
Definition lhazarc.cpp:938
Definition lhazfiletree.h:22
Definition lhazfile.h:14
Definition lhazprocfile.h:11
Definition lhaztreeview.h:18
¥ type v
Definition lhazregs.h:21
Definition lhazbz2.h:17
Definition lhazarc.h:139
TYPE type
Definition lhazarc.h:140
const TCHAR * ext
Definition lhazarc.h:141