view src/win32/7zip/7zip.h @ 6:458a4f18f3cd

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