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:
56 //
57 static TYPE GetArchiveType(const WSTR& name, bool& pass_correct);
58 static TYPE GetArchiveTypeByName(const WSTR& name);
59 static bool IsSingleFileCompressed(TYPE type);
60 static bool IsUnicodeSupport(TYPE type);
61 //
62 ARCHIVE(HWND hwnd, const WSTR& name, TYPE type, gui::LHAZTREEVIEW* treeview);
63 static ARCHIVE* Create(HWND hwnd, const WSTR& name, TYPE type);
64 static ARCHIVE* Create(HWND hwnd, const WSTR& name, TYPE type, TCHAR* filter, gui::LHAZTREEVIEW* treeview);
65 virtual ‾ARCHIVE();
66 // 全解凍
67 virtual bool Extract(bool verify, const WSTR& temp, const WSTR& password) = 0;
68 // 部分解凍
69 virtual bool Extract(const WSTR& temp) = 0;
70 // 圧縮
71 virtual bool Compress(int method, int header, const WSTR& pass, const PATH& temp, const std::vector<LHAZPROCFILE>& v) = 0;
72 // 削除
73 virtual bool Delete(const std::vector<LHAZFILE*>& v) = 0;
74 //
75 bool CanAppend(UINT& mes_id);
76 void ClearExtFile() { ExtFile.clear(); }
77 bool DoMakeDir() const { return MakeDir; }
78 void Filt(const WSTR& filter);
79 void Filt(const WSTR& filter, const LHAZFILETREE* node);
80 const WSTR& GetAllName(int idx) const;
81 std::size_t GetCount() const { return List.size(); }
82 const WSTR& GetCsizeText(int idx) const;
83 const WSTR& GetCsizeTextKB(int idx) const;
84 const WSTR& GetDir(int idx) const;
85 ::size_t GetDspCount() const { return SortTable.size(); }
86 bool GetEncrypt() const { return Encrypt; }
87 std::vector<LHAZFILE*>& GetExtFile() { return ExtFile; }
88 LONGLONG GetExtMemberTotal() const;
89 LHAZFILE* GetFile(int idx) const;
90 const WSTR& GetFname(int idx) const;
91 int GetImage(int idx) const;
92 const std::vector<LHAZFILE*>& GetList() const { return List; }
93 const WSTR& GetMethodText(int idx) const;
94 const WSTR& GetName() const { return Name; }
95 const WSTR& GetName(int idx) const;
96 const WSTR& GetOneDir() const { return OneDir; }
97 const WSTR& GetRatioText(int idx) const;
98 LONGLONG GetSize(int idx) const;
99 const WSTR& GetSizeText(int idx) const;
100 const WSTR& GetSizeTextKB(int idx) const;
101 const WSTR& GetTimeText(int idx) const;
102 LONGLONG GetTotal() const { return Total; }
103 LHAZFILETREE* GetTree() const { return Tree; }
104 LHAZFILETREE* GetTree(int idx) const;
105 TYPE GetType() const { return Type; }
106 const WSTR& GetType(int idx) const;
107 bool IsDir(int idx) const;
108 bool IsVirtual(int idx) const;
109 void ListAllMember();
110 void ListExtMember(const std::vector<int>& indxs, bool add = false);
111 void ListExtMemberDescendant(const WSTR& dir, const WSTR& filter);
112 void SetName(const WSTR& name);
113 void Sort(int kind, int rev);
114
115protected:
116 static const size_t SFXSIZE; /* 自己解凍ルーチンスキップサイズ */
117 //
118 HWND Hwnd; /* 親ウィンドウハンドル */
119 WSTR Name; /* 書庫ファイル名 */
120 TYPE Type; /* 書庫種別 */
121 LONGLONG Total; /* 書庫内総ファイルサイズ */
122 bool MakeDir; /* フォルダ作成必要か */
123 WSTR OneDir; /* ひとつのフォルダ配下 */
124 bool Encrypt; /* 暗号化 */
125 std::vector<LHAZFILE*> List; /* 書庫内ファイルリスト */
126 std::vector<LHAZFILE*> SortTable; /* ソートテーブル */
127 std::vector<LHAZFILE*> ExtFile; /* 解凍対象 */
128 LHAZFILETREE* Tree; /* ツリー */
129 //
130 bool IsSameDir(WSTR& dirbuf, const WSTR& curdir);
131 void AppendList(const WSTR& name, std::vector<WSTR>& list);
132 void AppendListWithDir(const WSTR& name, std::vector<WSTR>& list, bool& unicode_file_exist);
133 int ShareError(const WSTR& name);
134
135private:
136 struct EXT_TABLE {
138 const TCHAR* ext;
139 };
140 //
141 static const EXT_TABLE m_ext_table[]; /* Extensions table */
142 static const char MZHEADER[]; /* EXEヘッダ */
143 //
144 static bool IsOfficeOpenXML(const WSTR& name);
145
146};
Definition lhazarc.h:25
const WSTR & GetAllName(int idx) const
Definition lhazarc.cpp:723
const WSTR & GetRatioText(int idx) const
Definition lhazarc.cpp:803
static const EXT_TABLE m_ext_table[]
Definition lhazarc.h:61
static const size_t SFXSIZE
Definition lhazarc.h:116
static const char MZHEADER[]
Definition lhazarc.h:59
const WSTR & GetCsizeTextKB(int idx) const
Definition lhazarc.cpp:787
TYPE GetType() const
Definition lhazarc.h:105
virtual bool Extract(const WSTR &temp)=0
void SetName(const WSTR &name)
Definition lhazarc.cpp:355
const WSTR & GetDir(int idx) const
Definition lhazarc.cpp:819
std::vector< LHAZFILE * > ExtFile
Definition lhazarc.h:127
bool IsSameDir(WSTR &dirbuf, const WSTR &curdir)
Definition lhazarc.cpp:363
LHAZFILETREE * GetTree() const
Definition lhazarc.h:103
void Sort(int kind, int rev)
Definition lhazarc.cpp:338
LONGLONG GetTotal() const
Definition lhazarc.h:102
bool MakeDir
Definition lhazarc.h:122
static ARCHIVE * Create(HWND hwnd, const WSTR &name, TYPE type)
Definition lhazarc.cpp:148
std::vector< LHAZFILE * > SortTable
Definition lhazarc.h:126
const WSTR & GetFname(int idx) const
Definition lhazarc.cpp:795
const std::vector< LHAZFILE * > & GetList() const
Definition lhazarc.h:92
bool DoMakeDir() const
Definition lhazarc.h:77
WSTR Name
Definition lhazarc.h:119
LHAZFILETREE * Tree
Definition lhazarc.h:128
bool IsVirtual(int idx) const
Definition lhazarc.cpp:843
int GetImage(int idx) const
Definition lhazarc.cpp:827
LONGLONG GetSize(int idx) const
Definition lhazarc.cpp:739
HWND Hwnd
Definition lhazarc.h:118
virtual ‾ARCHIVE()
Definition lhazarc.cpp:252
void ListAllMember()
Definition lhazarc.cpp:328
COMPLETE
Definition lhazarc.h:55
@ ARC_ERROR
Definition lhazarc.h:55
@ ARC_CANCELED
Definition lhazarc.h:55
@ ARC_NO_ERROR
Definition lhazarc.h:55
@ ARC_STOPPED
Definition lhazarc.h:55
const WSTR & GetName() const
Definition lhazarc.h:94
bool IsDir(int idx) const
Definition lhazarc.cpp:835
bool Encrypt
Definition lhazarc.h:124
::size_t GetDspCount() const
Definition lhazarc.h:85
std::vector< LHAZFILE * > List
Definition lhazarc.h:125
TYPE Type
Definition lhazarc.h:120
void AppendList(const WSTR &name, std::vector< WSTR > &list)
Definition lhazarc.cpp:472
const WSTR & GetCsizeText(int idx) const
Definition lhazarc.cpp:779
const WSTR & GetMethodText(int idx) const
Definition lhazarc.cpp:811
static bool IsUnicodeSupport(TYPE type)
Definition lhazarc.cpp:704
void ListExtMemberDescendant(const WSTR &dir, const WSTR &filter)
Definition lhazarc.cpp:309
WSTR OneDir
Definition lhazarc.h:123
LONGLONG GetExtMemberTotal() const
Definition lhazarc.cpp:859
virtual bool Delete(const std::vector< LHAZFILE * > &v)=0
static TYPE GetArchiveType(const WSTR &name, bool &pass_correct)
Definition lhazarc.cpp:499
const WSTR & GetOneDir() const
Definition lhazarc.h:96
LHAZFILE * GetFile(int idx) const
Definition lhazarc.cpp:870
std::size_t GetCount() const
Definition lhazarc.h:81
void Filt(const WSTR &filter)
Definition lhazarc.cpp:265
TYPE
Definition lhazarc.h:28
@ SFXCAB
Definition lhazarc.h:41
@ XZ
Definition lhazarc.h:45
@ ZIP
Definition lhazarc.h:31
@ ONEDRIVE
Definition lhazarc.h:51
@ 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:52
@ SZIP
Definition lhazarc.h:39
@ GOOGLE_DOC
Definition lhazarc.h:50
@ BZ2
Definition lhazarc.h:38
@ TXZ
Definition lhazarc.h:46
@ ENCZIP
Definition lhazarc.h:32
@ NON
Definition lhazarc.h:29
@ MAX
Definition lhazarc.h:53
@ 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
@ SFXZIP
Definition lhazarc.h:42
const WSTR & GetSizeTextKB(int idx) const
Definition lhazarc.cpp:755
virtual bool Extract(bool verify, const WSTR &temp, const WSTR &password)=0
const WSTR & GetSizeText(int idx) const
Definition lhazarc.cpp:747
static TYPE GetArchiveTypeByName(const WSTR &name)
Definition lhazarc.cpp:678
void ClearExtFile()
Definition lhazarc.h:76
LONGLONG Total
Definition lhazarc.h:121
bool CanAppend(UINT &mes_id)
Definition lhazarc.cpp:899
int ShareError(const WSTR &name)
Definition lhazarc.cpp:693
const WSTR & GetTimeText(int idx) const
Definition lhazarc.cpp:771
static bool IsSingleFileCompressed(TYPE type)
IsSingleFileCompressed
Definition lhazarc.cpp:418
std::vector< LHAZFILE * > & GetExtFile()
Definition lhazarc.h:87
void ListExtMember(const std::vector< int > &indxs, bool add=false)
Definition lhazarc.cpp:297
bool GetEncrypt() const
Definition lhazarc.h:86
void AppendListWithDir(const WSTR &name, std::vector< WSTR > &list, bool &unicode_file_exist)
Definition lhazarc.cpp:435
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:878
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:136
TYPE type
Definition lhazarc.h:137
const TCHAR * ext
Definition lhazarc.h:138