other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,66 @@
     1.4 +// ArchiverInfo.h
     1.5 +
     1.6 +#ifndef __ARCHIVERINFO_H
     1.7 +#define __ARCHIVERINFO_H
     1.8 +
     1.9 +#include "Common/String.h"
    1.10 +#include "Common/Types.h"
    1.11 +#include "Common/Buffer.h"
    1.12 +
    1.13 +struct CArchiverExtInfo
    1.14 +{
    1.15 +  UString Ext;
    1.16 +  UString AddExt;
    1.17 +  CArchiverExtInfo() {}
    1.18 +  CArchiverExtInfo(const UString &ext): Ext(ext) {}
    1.19 +  CArchiverExtInfo(const UString &ext, const UString &addExt): Ext(ext), AddExt(addExt) {}
    1.20 +};
    1.21 +
    1.22 +struct CArchiverInfo
    1.23 +{
    1.24 +  #ifndef EXCLUDE_COM
    1.25 +  UString FilePath;
    1.26 +  CLSID ClassID;
    1.27 +  #endif
    1.28 +  UString Name;
    1.29 +  CObjectVector<CArchiverExtInfo> Extensions;
    1.30 +  #ifndef _SFX
    1.31 +  CByteBuffer StartSignature;
    1.32 +  CByteBuffer FinishSignature;
    1.33 +  bool Associate;
    1.34 +  #endif
    1.35 +  int FindExtension(const UString &ext) const
    1.36 +  {
    1.37 +    for (int i = 0; i < Extensions.Size(); i++)
    1.38 +      if (ext.CompareNoCase(Extensions[i].Ext) == 0)
    1.39 +        return i;
    1.40 +    return -1;
    1.41 +  }
    1.42 +  UString GetAllExtensions() const
    1.43 +  {
    1.44 +    UString s;
    1.45 +    for (int i = 0; i < Extensions.Size(); i++)
    1.46 +    {
    1.47 +      if (i > 0)
    1.48 +        s += ' ';
    1.49 +      s += Extensions[i].Ext;
    1.50 +    }
    1.51 +    return s;
    1.52 +  }
    1.53 +  const UString &GetMainExtension() const 
    1.54 +  { 
    1.55 +    return Extensions[0].Ext;
    1.56 +  }
    1.57 +  bool UpdateEnabled;
    1.58 +  bool KeepName;
    1.59 +
    1.60 +  CArchiverInfo(): UpdateEnabled(false), KeepName(false)
    1.61 +  #ifndef _SFX
    1.62 +  ,Associate(true)
    1.63 +  #endif
    1.64 +  {}
    1.65 +};
    1.66 +
    1.67 +void ReadArchiverInfoList(CObjectVector<CArchiverInfo> &archivers);
    1.68 +
    1.69 +#endif

mercurial