Lhaz
lhazarc.h
[詳解]
1 /*************************************************************************/
6 #pragma once
7 
8 #include "altstr.hpp"
9 #include <vector>
10 #include <windows.h>
11 #include <commctrl.h>
12 
13 class LHAZPROCFILE;
14 class LHAZFILE;
15 class LHAZFILETREE;
16 class PATH;
17 
18 namespace gui {
19 
20 class LVCOLMS;
21 class LHAZTREEVIEW;
22 
23 } // namespace gui
24 
25 class ARCHIVE {
26 
27 public:
28  enum TYPE {
29  NON,
30  LZH,
31  ZIP,
33  CAB,
34  TGZ,
35  TAR,
37  TBZ,
38  BZ2,
43  RAR,
45  XZ,
46  TXZ,
47  LZ4,
51  MAX
52  };
53  enum COMPLETE { ARC_NO_ERROR, ARC_CANCELED, ARC_STOPPED, ARC_ERROR };
54  //
55  static TYPE GetArchiveType(const WSTR& name, bool& pass_correct);
56  static TYPE GetArchiveTypeByName(const WSTR& name);
57  static bool IsSingleFileCompressed(TYPE type);
58  static bool IsUnicodeSupport(TYPE type);
59  //
60  ARCHIVE(HWND hwnd, const WSTR& name, TYPE type, gui::LHAZTREEVIEW* treeview);
61  static ARCHIVE* Create(HWND hwnd, const WSTR& name, TYPE type);
62  static ARCHIVE* Create(HWND hwnd, const WSTR& name, TYPE type, TCHAR* filter, gui::LHAZTREEVIEW* treeview);
63  virtual ‾ARCHIVE();
64  // 全解凍
65  virtual bool Extract(bool verify, const WSTR& temp, const WSTR& password) = 0;
66  // 部分解凍
67  virtual bool Extract(const WSTR& temp) = 0;
68  // 圧縮
69  virtual bool Compress(int method, int header, const WSTR& pass, const PATH& temp, const std::vector<LHAZPROCFILE>& v) = 0;
70  // 削除
71  virtual bool Delete(const std::vector<LHAZFILE*>& v) = 0;
72  //
73  bool CanAppend(UINT& mes_id);
74  void ClearExtFile() { ExtFile.clear(); }
75  bool DoMakeDir() const { return MakeDir; }
76  void Filt(const WSTR& filter);
77  void Filt(const WSTR& filter, const LHAZFILETREE* node);
78  const WSTR& GetAllName(int idx) const;
79  std::size_t GetCount() const { return List.size(); }
80  const WSTR& GetCsizeText(int idx) const;
81  const WSTR& GetCsizeTextKB(int idx) const;
82  const WSTR& GetDir(int idx) const;
83  ::size_t GetDspCount() const { return SortTable.size(); }
84  bool GetEncrypt() const { return Encrypt; }
85  std::vector<LHAZFILE*>& GetExtFile() { return ExtFile; }
86  LONGLONG GetExtMemberTotal() const;
87  LHAZFILE* GetFile(int idx) const;
88  const WSTR& GetFname(int idx) const;
89  int GetImage(int idx) const;
90  const std::vector<LHAZFILE*>& GetList() const { return List; }
91  const WSTR& GetMethodText(int idx) const;
92  const WSTR& GetName() const { return Name; }
93  const WSTR& GetName(int idx) const;
94  const WSTR& GetOneDir() const { return OneDir; }
95  const WSTR& GetRatioText(int idx) const;
96  LONGLONG GetSize(int idx) const;
97  const WSTR& GetSizeText(int idx) const;
98  const WSTR& GetSizeTextKB(int idx) const;
99  const WSTR& GetTimeText(int idx) const;
100  LONGLONG GetTotal() const { return Total; }
101  LHAZFILETREE* GetTree() const { return Tree; }
102  LHAZFILETREE* GetTree(int idx) const;
103  TYPE GetType() const { return Type; }
104  const WSTR& GetType(int idx) const;
105  bool IsDir(int idx) const;
106  bool IsVirtual(int idx) const;
107  void ListAllMember();
108  void ListExtMember(const std::vector<int>& indxs, bool add = false);
109  void ListExtMemberDescendant(const WSTR& dir, const WSTR& filter);
110  void SetName(const WSTR& name);
111  void Sort(int kind, int rev);
112 
113 protected:
114  static const size_t SFXSIZE; /* 自己解凍ルーチンスキップサイズ */
115  //
116  HWND Hwnd; /* 親ウィンドウハンドル */
117  WSTR Name; /* 書庫ファイル名 */
118  TYPE Type; /* 書庫種別 */
119  LONGLONG Total; /* 書庫内総ファイルサイズ */
120  bool MakeDir; /* フォルダ作成必要か */
121  WSTR OneDir; /* ひとつのフォルダ配下 */
122  bool Encrypt; /* 暗号化 */
123  std::vector<LHAZFILE*> List; /* 書庫内ファイルリスト */
124  std::vector<LHAZFILE*> SortTable; /* ソートテーブル */
125  std::vector<LHAZFILE*> ExtFile; /* 解凍対象 */
126  LHAZFILETREE* Tree; /* ツリー */
127  //
128  bool IsSameDir(WSTR& dirbuf, const WSTR& curdir);
129  void AppendList(const WSTR& name, std::vector<WSTR>& list);
130  void AppendListWithDir(const WSTR& name, std::vector<WSTR>& list, bool& unicode_file_exist);
131  int ShareError(const WSTR& name);
132 
133 private:
134  struct EXT_TABLE {
136  const TCHAR* ext;
137  };
138  //
139  static const EXT_TABLE m_ext_table[]; /* Extensions table */
140  static const char MZHEADER[]; /* EXEヘッダ */
141  //
142  static bool IsOfficeOpenXML(const WSTR& name);
143 
144 };
TYPE type
Definition: lhazarc.h:135
Definition: lhazfile.h:14
COMPLETE
Definition: lhazarc.h:53
Definition: lhazarc.h:29
TYPE
Definition: lhazarc.h:28
WSTR OneDir
Definition: lhazarc.h:121
bool Encrypt
Definition: lhazarc.h:122
Definition: lhazarc.h:32
Definition: lhazarc.h:40
Definition: lhazarc.h:30
std::vector< LHAZFILE * > ExtFile
Definition: lhazarc.h:125
LHAZFILETREE * Tree
Definition: lhazarc.h:126
std::size_t GetCount() const
Definition: lhazarc.h:79
LONGLONG Total
Definition: lhazarc.h:119
Definition: lhazarc.h:41
Definition: lhazarc.h:25
Definition: lhazarc.h:31
Definition: lhazbz2.h:17
Definition: lhazfiletree.h:27
Definition: lhazarc.h:48
and that you are informed that you can do these things To protect your we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it For if you distribute copies of the whether gratis or for a you must give the recipients all the rights that we gave you You must make sure that receive or can get the source code If you link other code with the you must provide complete object files to the so that they can relink them with the library after making changes to the library and recompiling it And you must show them these terms so they know their rights We protect your rights with a two step method
Definition: copying.txt:35
const WSTR & GetOneDir() const
Definition: lhazarc.h:94
Definition: lhazarc.h:50
bool DoMakeDir() const
Definition: lhazarc.h:75
const WSTR & GetName() const
Definition: lhazarc.h:92
std::vector< LHAZFILE * > & GetExtFile()
Definition: lhazarc.h:85
static const size_t SFXSIZE
Definition: lhazarc.h:114
Definition: lhaztreeview.h:18
WSTR Name
Definition: lhazarc.h:117
Definition: lhazarc.h:43
Definition: lhazarc.h:134
Definition: lhazarc.h:37
Definition: lhazarc.h:42
void ClearExtFile()
Definition: lhazarc.h:74
Definition: lhazarc.h:46
::size_t GetDspCount() const
Definition: lhazarc.h:83
bool MakeDir
Definition: lhazarc.h:120
Definition: lhazarc.h:47
機能テストを実施するためのディレクトリです. *概要 Git Bash上で一部またはすべてのテストを自動的に実行することができます. *実行方法 call_test shを実行すると,配下に存在する全てのテストを順次実行します. 各テストケースのtest shを実行すると,そのテストだけが実行されます. call_test sh[-v 2][-a 86][-k][-r][types...] test sh[-v 2][-a 86][-k][types...] v
Definition: README.txt:18
std::vector< LHAZFILE * > List
Definition: lhazarc.h:123
LHAZFILETREE * GetTree() const
Definition: lhazarc.h:101
Definition: lhazarc.h:38
Definition: lhazarc.h:44
TYPE Type
Definition: lhazarc.h:118
const std::vector< LHAZFILE * > & GetList() const
Definition: lhazarc.h:90
Definition: lhazarc.h:36
Definition: lhazarc.h:45
Definition: lhazarc.h:34
Definition: lhazarc.h:49
Definition: lhazarc.h:33
Definition: lhazprocfile.h:11
std::vector< LHAZFILE * > SortTable
Definition: lhazarc.h:124
const TCHAR * ext
Definition: lhazarc.h:136
Definition: lhazarc.h:39
bool GetEncrypt() const
Definition: lhazarc.h:84
HWND Hwnd
Definition: lhazarc.h:116
LONGLONG GetTotal() const
Definition: lhazarc.h:100
Definition: lhazarc.h:35
TYPE GetType() const
Definition: lhazarc.h:103