diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2017-08-29 22:49:43 +0300 |
---|---|---|
committer | Kornel <kornel@geekhood.net> | 2017-08-29 22:49:43 +0300 |
commit | b5dc853b2496447f0a54b3b25cb2659b575c56ef (patch) | |
tree | 82b48a2ca0f97915b2aeeb7ae9456711f13cd49a /CPP/7zip/Common/MethodProps.cpp | |
parent | 2efa10565ac395d2ce9a679ead46e70fb2f963eb (diff) |
17.0117.01
Diffstat (limited to 'CPP/7zip/Common/MethodProps.cpp')
-rw-r--r-- | CPP/7zip/Common/MethodProps.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/CPP/7zip/Common/MethodProps.cpp b/CPP/7zip/Common/MethodProps.cpp index ef6f2e3f..9e82a115 100644 --- a/CPP/7zip/Common/MethodProps.cpp +++ b/CPP/7zip/Common/MethodProps.cpp @@ -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; } |