mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 05:15:00 -06:00
17.01
This commit is contained in:
@@ -42,6 +42,14 @@ unsigned ParseStringToUInt32(const UString &srcString, UInt32 &number)
|
||||
return (unsigned)(end - start);
|
||||
}
|
||||
|
||||
static unsigned ParseStringToUInt64(const UString &srcString, UInt64 &number)
|
||||
{
|
||||
const wchar_t *start = srcString;
|
||||
const wchar_t *end;
|
||||
number = ConvertStringToUInt64(start, &end);
|
||||
return (unsigned)(end - start);
|
||||
}
|
||||
|
||||
HRESULT ParsePropToUInt32(const UString &name, const PROPVARIANT &prop, UInt32 &resValue)
|
||||
{
|
||||
// =VT_UI4
|
||||
@@ -263,7 +271,11 @@ static const CNameToPropID g_NameToPropID[] =
|
||||
{ VT_UI4, "mt" },
|
||||
{ VT_BOOL, "eos" },
|
||||
{ VT_UI4, "x" },
|
||||
{ VT_UI4, "reduceSize" }
|
||||
{ VT_UI8, "reduce" },
|
||||
{ VT_UI8, "expect" },
|
||||
{ VT_UI4, "b" },
|
||||
{ VT_UI4, "check" },
|
||||
{ VT_BSTR, "filter" }
|
||||
};
|
||||
|
||||
static int FindPropIdExact(const UString &name)
|
||||
@@ -345,7 +357,8 @@ static bool IsLogSizeProp(PROPID propid)
|
||||
case NCoderPropID::kDictionarySize:
|
||||
case NCoderPropID::kUsedMemorySize:
|
||||
case NCoderPropID::kBlockSize:
|
||||
case NCoderPropID::kReduceSize:
|
||||
case NCoderPropID::kBlockSize2:
|
||||
// case NCoderPropID::kReduceSize:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -378,9 +391,22 @@ HRESULT CMethodProps::SetParam(const UString &name, const UString &value)
|
||||
}
|
||||
else if (!value.IsEmpty())
|
||||
{
|
||||
UInt32 number;
|
||||
if (ParseStringToUInt32(value, number) == value.Len())
|
||||
propValue = number;
|
||||
if (nameToPropID.VarType == VT_UI4)
|
||||
{
|
||||
UInt32 number;
|
||||
if (ParseStringToUInt32(value, number) == value.Len())
|
||||
propValue = number;
|
||||
else
|
||||
propValue = value;
|
||||
}
|
||||
else if (nameToPropID.VarType == VT_UI8)
|
||||
{
|
||||
UInt64 number;
|
||||
if (ParseStringToUInt64(value, number) == value.Len())
|
||||
propValue = number;
|
||||
else
|
||||
propValue = value;
|
||||
}
|
||||
else
|
||||
propValue = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user