This commit is contained in:
Igor Pavlov
2015-06-15 00:00:00 +00:00
committed by Kornel Lesiński
parent 0713a3ab80
commit 54490d51d5
591 changed files with 34932 additions and 16390 deletions

View File

@@ -123,15 +123,16 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
case kpidPath:
{
UString us;
if (ConvertUTF8ToUnicode(item.Name, us))
// if (
ConvertUTF8ToUnicode(item.Name, us);
{
if (!m_Database.LowLevel)
{
if (us.Len() > 1)
if (us[0] == L'/')
us.Delete(0);
if (us.Len() > 1 && us[0] == L'/')
us.Delete(0);
}
prop = NItemName::GetOSName2(us);
NItemName::ConvertToOSName2(us);
prop = us;
}
break;
}
@@ -141,7 +142,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
{
if (!item.IsDir())
if (item.Section == 0)
prop = L"Copy";
prop = "Copy";
else if (item.Section < m_Database.Sections.Size())
prop = m_Database.Sections[(int)item.Section].GetMethodName();
break;
@@ -734,30 +735,30 @@ STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
namespace NChm {
IMP_CreateArcIn_2(CHandler(false))
static const Byte k_Signature[] = { 'I', 'T', 'S', 'F', 3, 0, 0, 0, 0x60, 0, 0, 0 };
static CArcInfo g_ArcInfo =
{ "Chm", "chm chi chq chw", 0, 0xE9,
12, { 'I', 'T', 'S', 'F', 3, 0, 0, 0, 0x60, 0, 0, 0 },
REGISTER_ARC_I_CLS(
CHandler(false),
"Chm", "chm chi chq chw", 0, 0xE9,
k_Signature,
0,
0,
CreateArc };
NULL)
REGISTER_ARC(Chm)
}
namespace NHxs {
IMP_CreateArcIn_2(CHandler(true))
static const Byte k_Signature[] = { 'I', 'T', 'O', 'L', 'I', 'T', 'L', 'S', 1, 0, 0, 0, 0x28, 0, 0, 0 };
static CArcInfo g_ArcInfo =
{ "Hxs", "hxs hxi hxr hxq hxw lit", 0, 0xCE,
16, { 'I', 'T', 'O', 'L', 'I', 'T', 'L', 'S', 1, 0, 0, 0, 0x28, 0, 0, 0 },
REGISTER_ARC_I_CLS(
CHandler(true),
"Hxs", "hxs hxi hxr hxq hxw lit", 0, 0xCE,
k_Signature,
0,
NArcInfoFlags::kFindSignature,
CreateArc };
NULL)
REGISTER_ARC(Hxs)
}
}}

View File

@@ -107,10 +107,10 @@ UString CMethodInfo::GetName() const
UString s;
if (IsLzx())
{
s = L"LZX:";
wchar_t temp[16];
s.SetFromAscii("LZX:");
char temp[16];
ConvertUInt32ToString(LzxInfo.GetNumDictBits(), temp);
s += temp;
s.AddAscii(temp);
}
else
{
@@ -147,12 +147,12 @@ UString CSectionInfo::GetMethodName() const
UString temp;
if (ConvertUTF8ToUnicode(Name, temp))
s += temp;
s += L": ";
s.AddAscii(": ");
}
FOR_VECTOR (i, Methods)
{
if (i != 0)
s += L' ';
s.Add_Space();
s += Methods[i].GetName();
}
return s;
@@ -584,9 +584,9 @@ HRESULT CInArchive::OpenHelp2(IInStream *inStream, CDatabase &database)
AString s;
ConvertUnicodeToUTF8(name, s);
Byte b = ReadByte();
s += ' ';
s.Add_Space();
PrintByte(b, s);
s += ' ';
s.Add_Space();
UInt64 len = ReadEncInt();
// then number of items ?
// then length ?
@@ -641,7 +641,10 @@ static const char *kTransformList = "List";
static AString GetSectionPrefix(const AString &name)
{
return AString(kStorage) + name + AString("/");
AString s = kStorage;
s += name;
s += '/';
return s;
}
#define RINOZ(x) { int __tt = (x); if (__tt != 0) return __tt; }
@@ -721,8 +724,8 @@ HRESULT CInArchive::OpenHighLevel(IInStream *inStream, CFilesDatabase &database)
ReadUString(nameLen, name);
if (ReadUInt16() != 0)
return S_FALSE;
if (!ConvertUnicodeToUTF8(name, section.Name))
return S_FALSE;
ConvertUnicodeToUTF8(name, section.Name);
// if (!ConvertUnicodeToUTF8(name, section.Name)) return S_FALSE;
database.Sections.Add(section);
}
}

View File

@@ -120,10 +120,10 @@ struct CLzxInfo
return 0;
}
UInt64 GetFolderSize() const { return ResetTable.BlockSize * ResetInterval; };
UInt64 GetFolder(UInt64 offset) const { return offset / GetFolderSize(); };
UInt64 GetFolderPos(UInt64 folderIndex) const { return folderIndex * GetFolderSize(); };
UInt64 GetBlockIndexFromFolderIndex(UInt64 folderIndex) const { return folderIndex * ResetInterval; };
UInt64 GetFolderSize() const { return ResetTable.BlockSize * ResetInterval; }
UInt64 GetFolder(UInt64 offset) const { return offset / GetFolderSize(); }
UInt64 GetFolderPos(UInt64 folderIndex) const { return folderIndex * GetFolderSize(); }
UInt64 GetBlockIndexFromFolderIndex(UInt64 folderIndex) const { return folderIndex * ResetInterval; }
bool GetOffsetOfFolder(UInt64 folderIndex, UInt64 &offset) const
{
UInt64 blockIndex = GetBlockIndexFromFolderIndex(folderIndex);