michael@0: // ArchiverInfo.h michael@0: michael@0: #ifndef __ARCHIVERINFO_H michael@0: #define __ARCHIVERINFO_H michael@0: michael@0: #include "Common/String.h" michael@0: #include "Common/Types.h" michael@0: #include "Common/Buffer.h" michael@0: michael@0: struct CArchiverExtInfo michael@0: { michael@0: UString Ext; michael@0: UString AddExt; michael@0: CArchiverExtInfo() {} michael@0: CArchiverExtInfo(const UString &ext): Ext(ext) {} michael@0: CArchiverExtInfo(const UString &ext, const UString &addExt): Ext(ext), AddExt(addExt) {} michael@0: }; michael@0: michael@0: struct CArchiverInfo michael@0: { michael@0: #ifndef EXCLUDE_COM michael@0: UString FilePath; michael@0: CLSID ClassID; michael@0: #endif michael@0: UString Name; michael@0: CObjectVector Extensions; michael@0: #ifndef _SFX michael@0: CByteBuffer StartSignature; michael@0: CByteBuffer FinishSignature; michael@0: bool Associate; michael@0: #endif michael@0: int FindExtension(const UString &ext) const michael@0: { michael@0: for (int i = 0; i < Extensions.Size(); i++) michael@0: if (ext.CompareNoCase(Extensions[i].Ext) == 0) michael@0: return i; michael@0: return -1; michael@0: } michael@0: UString GetAllExtensions() const michael@0: { michael@0: UString s; michael@0: for (int i = 0; i < Extensions.Size(); i++) michael@0: { michael@0: if (i > 0) michael@0: s += ' '; michael@0: s += Extensions[i].Ext; michael@0: } michael@0: return s; michael@0: } michael@0: const UString &GetMainExtension() const michael@0: { michael@0: return Extensions[0].Ext; michael@0: } michael@0: bool UpdateEnabled; michael@0: bool KeepName; michael@0: michael@0: CArchiverInfo(): UpdateEnabled(false), KeepName(false) michael@0: #ifndef _SFX michael@0: ,Associate(true) michael@0: #endif michael@0: {} michael@0: }; michael@0: michael@0: void ReadArchiverInfoList(CObjectVector &archivers); michael@0: michael@0: #endif