Lhaz
読み取り中…
検索中…
一致する文字列を見つけられません
lhaziscab.h
[詳解]
1/*==========================================================================*/
2/* Lhaz InstallShield CAB Interface lhaz@chitora.jp */
3/*==========================================================================*/
4#ifdef FEATURE_ISCAB
5#ifndef _LHAZISCAB_H
6#define _LHAZISCAB_H
7
8#include <windows.h>
9#include <vector>
10#include "mystr.h"
11#include "lhazarc.h"
12#include "../i6comp/rsa/global.h"
13#include "../i6comp/rsa/md5.h"
14#include "../i6comp/is6cab.h"
15#include "../i6comp/i6comp.h"
16#include "../i6comp/zdatas.h"
17
18#define CSFG_MAX 512
19#define CSCP_MAX 512
20
21#define CRYPT_NONE 0
22//#define CRYPT_DECRYPT 1
23//#define CRYPT_ENCRYPT 2
24
25using namespace std;
26
27class PATH;
28
29class ARCISCAB : public ARCHIVE {
30
31public:
32 static bool IsArchiveISCab(const WSTR& name);
33 //
34 ARCISCAB(HWND hwnd, const WSTR& name, TYPE type);
35 ARCISCAB(HWND hwnd, const WSTR& name, TYPE type, const WSTR& filter);
36 ‾ARCISCAB(void);
37 // 全解凍
38 bool Extract(bool verify, const WSTR& temp, const WSTR& password);
39 // 部分解凍
40 bool Extract(const WSTR& temp);
41 bool Compress(int method, int header, const WSTR& pass, const PATH& temp, const vector<LHAZPROCFILE>& v);
42 bool Delete(const vector<LHAZFILE*>& v);
43
44private:
45 static const char _MonthDays[];
46 //
47 static const DWORD FileAttrVals[4];
48 static const char FileAttrChars[];
49 //
50 MYSTR pCabPattern;
51 LPCABDESC pCabDesc;
52 CABHEADER CabHdr;
53 DWORD cSetupTypes;
54 SETUPTYPETABLE SetupTypes;
55 FILEGROUPDESC* FileGroups[CSFG_MAX];
56 DWORD cFileGroups;
57 COMPONENTDESC* Components[CSCP_MAX];
58 DWORD cComponents;
59 DIRARRAY* Dirs;
60 FILEDESC* Files;
61 DWORD optFileGroup;
62 BOOL optRecurseSubdirs;
63 BOOL optFGasDir;
64 LPCABFILELIST pFileList;
65 DWORD FileCount;
66 BOOL optMatchWithDirs;
67 char* pZBuf;
68 //
69 static MYSTR GetName(const char* pPattern, int voln, const char* ext);
70 static MYSTR GetCabPattern(const MYSTR& cabfile);
71 static int __cdecl CompareFileGroups(const FILEGROUPDESC** pFG1, const FILEGROUPDESC** pFG2);
72 static int ZDCALLBACK ReadData(void* pbuf, DWORD* size, RWHANDLES* pHnd);
73 static int ZDCALLBACK WriteData(void* pbuf, DWORD* size, RWHANDLES* pHnd);
74 static int ZDCALLBACK ExtractRead(void* pbuf, DWORD* size, EXTRACTINFO* pHnd);
75 //
76 bool Constructor(const MYSTR& name);
77 ARCHIVE::COMPLETE ExtractSub(bool ext_part);
78 bool TranslateFileGroup(void);
79 DWORD GetGroupIndexByName(LPSTR GroupName);
80 void CabBasedFileList(LPSTR CabParam, LPSTR DiskParam);
81 void ListFiles(void);
82 LPDIRARRAY DirsArrayBuild(DFTABLE DFT);
83 void InitZData(void* pHnds, ZDProcess proc);
84 FILEHANDLE OpenCabReadHeader(int VolN, LPSTR ext, int Access, LPCABHEADER pHdr);
85 FILEHANDLE OpenCabForAccess(int VolN, LPSTR ext, int Access);
86 FILEHANDLE OpenForAccess(LPSTR filename, int Access);
87 void ReadCabHeader(FILEHANDLE hCab, LPCABHEADER pHdr);
88 void SetFileAttrs(char* filename, DWORD Attrs);
89 void SetFileDosTime(char* filename, WORD DosDate, WORD DosTime);
90 time_t DosTimeToFileTime(WORD DosDate, WORD DosTime);
91 void ExtractData(EXTRACTINFO* pHnd, DWORD Crypt);
92 void DecryptBuffer(BYTE* Buf, DWORD dwTran, DWORD* pTotal);
93 FILEHANDLE OpenForWrite(LPSTR filename, int Flags);
94 void CreateDir(LPSTR dirname);
95 BOOL DirExists(LPSTR DirName);
96 void TranslateChars(char* str, char* sFrom, char* sTo);
97 BOOL WildMatch(LPSTR str, LPSTR wildcard);
98 LPSTR GetGroupNameByFile(DWORD Index);
99 BOOL IsMask(LPSTR str);
100 BOOL TranslatePathToGroup(LPSTR* ppPath, LPSTR* ppFGName);
101 long strtolong(char* str);
102 void DosTimeToSysTime(WORD DosDate, WORD DosTime, SYSTIME* systime);
103 LPFILEGROUPDESC GetGroupByFile(DWORD index);
104
105};
106#endif // _LHAZISCAB_H
107#endif // FEATURE_ISCAB
Definition lhazarc.h:25
COMPLETE
Definition lhazarc.h:55
const WSTR & GetName() const
Definition lhazarc.h:94
virtual bool Delete(const std::vector< LHAZFILE * > &v)=0
virtual bool Extract(bool verify, const WSTR &temp, const WSTR &password)=0
virtual bool Compress(int method, int header, const WSTR &pass, const PATH &temp, const std::vector< LHAZPROCFILE > &v)=0
Archive
¥ type v
Definition lhazregs.h:21