00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 */ 00004 00005 #ifndef __ARCHIVERINFO_H 00006 #define __ARCHIVERINFO_H 00007 00008 #include "String.h" 00009 #include "Types.h" 00010 #include "Buffer.h" 00011 00012 struct CArchiverExtInfo 00013 { 00014 UString Ext; 00015 UString AddExt; 00016 CArchiverExtInfo() {} 00017 CArchiverExtInfo(const UString &ext): Ext(ext) {} 00018 CArchiverExtInfo(const UString &ext, const UString &addExt): Ext(ext), AddExt(addExt) {} 00019 }; 00020 00021 struct CArchiverInfo 00022 { 00023 #ifndef EXCLUDE_COM 00024 UString FilePath; 00025 CLSID ClassID; 00026 #endif 00027 UString Name; 00028 CObjectVector<CArchiverExtInfo> Extensions; 00029 #ifndef _SFX 00030 CByteBuffer StartSignature; 00031 CByteBuffer FinishSignature; 00032 bool Associate; 00033 #endif 00034 int FindExtension(const UString &ext) const 00035 { 00036 for (int i = 0; i < Extensions.Size(); i++) 00037 if (ext.CompareNoCase(Extensions[i].Ext) == 0) 00038 return i; 00039 return -1; 00040 } 00041 UString GetAllExtensions() const 00042 { 00043 UString s; 00044 for (int i = 0; i < Extensions.Size(); i++) 00045 { 00046 if (i > 0) 00047 s += ' '; 00048 s += Extensions[i].Ext; 00049 } 00050 return s; 00051 } 00052 const UString &GetMainExtension() const 00053 { 00054 return Extensions[0].Ext; 00055 } 00056 bool UpdateEnabled; 00057 bool KeepName; 00058 00059 CArchiverInfo(): UpdateEnabled(false), KeepName(false) 00060 #ifndef _SFX 00061 ,Associate(true) 00062 #endif 00063 {} 00064 }; 00065 00066 void ReadArchiverInfoList(CObjectVector<CArchiverInfo> &archivers); 00067 00068 #endif
1.5.6