annotate src/win32/7zip/7zip.h @ 8:08a8e09ca414
add files required by automake
author |
Robert McIntyre <rlm@mit.edu> |
date |
Sat, 03 Mar 2012 10:54:39 -0600 |
parents |
f9f4f1b99eed |
children |
|
rev |
line source |
rlm@1
|
1 #ifndef _7ZIP_DEC_HEADER
|
rlm@1
|
2 #define _7ZIP_DEC_HEADER
|
rlm@1
|
3
|
rlm@1
|
4 // 7zip file extraction
|
rlm@1
|
5 // NOTE: if you want to add support for opening files within archives to something,
|
rlm@1
|
6 // consider using the higher-level interface provided by OpenArchive.h instead
|
rlm@1
|
7
|
rlm@1
|
8 void InitDecoder();
|
rlm@1
|
9 void CleanupDecoder();
|
rlm@1
|
10 const char* GetSupportedFormatsFilter();
|
rlm@1
|
11
|
rlm@1
|
12 // simplest way of extracting a file after calling InitDecoder():
|
rlm@1
|
13 // int size = ArchiveFile(filename).ExtractItem(0, buf, sizeof(buf));
|
rlm@1
|
14
|
rlm@1
|
15 struct ArchiveFile
|
rlm@1
|
16 {
|
rlm@1
|
17 ArchiveFile(const char* filename, const char* displayFilename=0);
|
rlm@1
|
18 virtual ~ArchiveFile();
|
rlm@1
|
19
|
rlm@1
|
20 int GetNumItems();
|
rlm@1
|
21 int GetItemSize(int item);
|
rlm@1
|
22 const char* GetItemName(int item);
|
rlm@1
|
23 int ExtractItem(int item, unsigned char* outBuffer, int bufSize) const; // returns size, or 0 if failed
|
rlm@1
|
24 int ExtractItem(int item, const char* outFilename) const;
|
rlm@1
|
25
|
rlm@1
|
26 bool IsCompressed();
|
rlm@1
|
27 const char* GetArchiveTypeName();
|
rlm@1
|
28 const char* GetArchiveFileName() { return m_displayFilename ? m_displayFilename : m_filename; }
|
rlm@1
|
29
|
rlm@1
|
30 bool m_userMadeSelection;
|
rlm@1
|
31
|
rlm@1
|
32 protected:
|
rlm@1
|
33 struct ArchiveItem
|
rlm@1
|
34 {
|
rlm@1
|
35 int size;
|
rlm@1
|
36 char* name;
|
rlm@1
|
37 };
|
rlm@1
|
38 ArchiveItem* m_items;
|
rlm@1
|
39 int m_numItems;
|
rlm@1
|
40 int m_typeIndex;
|
rlm@1
|
41 char* m_filename;
|
rlm@1
|
42 char* m_displayFilename;
|
rlm@1
|
43 };
|
rlm@1
|
44
|
rlm@1
|
45 #endif
|