diff src/win32/7zip/7zip.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/win32/7zip/7zip.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,45 @@
     1.4 +#ifndef _7ZIP_DEC_HEADER
     1.5 +#define _7ZIP_DEC_HEADER
     1.6 +
     1.7 +// 7zip file extraction
     1.8 +// NOTE: if you want to add support for opening files within archives to something,
     1.9 +// consider using the higher-level interface provided by OpenArchive.h instead
    1.10 +
    1.11 +void InitDecoder();
    1.12 +void CleanupDecoder();
    1.13 +const char* GetSupportedFormatsFilter();
    1.14 +
    1.15 +// simplest way of extracting a file after calling InitDecoder():
    1.16 +// int size = ArchiveFile(filename).ExtractItem(0, buf, sizeof(buf));
    1.17 +
    1.18 +struct ArchiveFile
    1.19 +{
    1.20 +	ArchiveFile(const char* filename, const char* displayFilename=0);
    1.21 +	virtual ~ArchiveFile();
    1.22 +
    1.23 +	int GetNumItems();
    1.24 +	int GetItemSize(int item);
    1.25 +	const char* GetItemName(int item);
    1.26 +	int ExtractItem(int item, unsigned char* outBuffer, int bufSize) const; // returns size, or 0 if failed
    1.27 +	int ExtractItem(int item, const char* outFilename) const;
    1.28 +
    1.29 +	bool IsCompressed();
    1.30 +	const char* GetArchiveTypeName();
    1.31 +	const char* GetArchiveFileName() { return m_displayFilename ? m_displayFilename : m_filename; }
    1.32 +
    1.33 +	bool m_userMadeSelection;
    1.34 +
    1.35 +protected:
    1.36 +	struct ArchiveItem
    1.37 +	{
    1.38 +		int size;
    1.39 +		char* name;
    1.40 +	};
    1.41 +	ArchiveItem* m_items;
    1.42 +	int m_numItems;
    1.43 +	int m_typeIndex;
    1.44 +	char* m_filename;
    1.45 +	char* m_displayFilename;
    1.46 +};
    1.47 +
    1.48 +#endif