diff options
Diffstat (limited to 'CPP/7zip/Archive/Common/HandlerOut.cpp')
-rw-r--r-- | CPP/7zip/Archive/Common/HandlerOut.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/CPP/7zip/Archive/Common/HandlerOut.cpp b/CPP/7zip/Archive/Common/HandlerOut.cpp index 18ad5580..9c11b31d 100644 --- a/CPP/7zip/Archive/Common/HandlerOut.cpp +++ b/CPP/7zip/Archive/Common/HandlerOut.cpp @@ -29,6 +29,7 @@ void CMultiMethodProps::SetGlobalLevelAndThreads(COneMethodInfo &oneMethodInfo UInt32 level = _level; if (level != (UInt32)(Int32)-1) SetMethodProp32(oneMethodInfo, NCoderPropID::kLevel, (UInt32)level); + #ifndef _7ZIP_ST SetMethodProp32(oneMethodInfo, NCoderPropID::kNumThreads, numThreads); #endif @@ -41,6 +42,8 @@ void CMultiMethodProps::Init() #endif _level = (UInt32)(Int32)-1; + _analysisLevel = -1; + _autoFilter = true; _crcSize = 4; _filterMethod.Clear(); @@ -60,8 +63,17 @@ HRESULT CMultiMethodProps::SetProperty(const wchar_t *nameSpec, const PROPVARIAN _level = 9; return ParsePropToUInt32(name, value, _level); } + + if (name.IsPrefixedBy_Ascii_NoCase("yx")) + { + name.Delete(0, 2); + UInt32 v = 9; + RINOK(ParsePropToUInt32(name, value, v)); + _analysisLevel = (int)v; + return S_OK; + } - if (name == L"crc") + if (name.IsEqualTo("crc")) { name.Delete(0, 3); _crcSize = 4; @@ -73,11 +85,12 @@ HRESULT CMultiMethodProps::SetProperty(const wchar_t *nameSpec, const PROPVARIAN UString realName = name.Ptr(index); if (index == 0) { - if (name.IsPrefixedBy(L"mt")) + if (name.IsPrefixedBy_Ascii_NoCase("mt")) { #ifndef _7ZIP_ST RINOK(ParseMtProp(name.Ptr(2), value, _numProcessors, _numThreads)); #endif + return S_OK; } if (name.IsEqualTo("f")) @@ -87,7 +100,7 @@ HRESULT CMultiMethodProps::SetProperty(const wchar_t *nameSpec, const PROPVARIAN return res; if (value.vt != VT_BSTR) return E_INVALIDARG; - return _filterMethod.ParseMethodFromPROPVARIANT(L"", value); + return _filterMethod.ParseMethodFromPROPVARIANT(UString(), value); } number = 0; } @@ -101,14 +114,15 @@ HRESULT CMultiMethodProps::SetProperty(const wchar_t *nameSpec, const PROPVARIAN void CSingleMethodProps::Init() { Clear(); + _level = (UInt32)(Int32)-1; + #ifndef _7ZIP_ST _numProcessors = _numThreads = NWindows::NSystem::GetNumberOfProcessors(); - AddNumThreadsProp(_numThreads); + AddProp_NumThreads(_numThreads); #endif - _level = (UInt32)(Int32)-1; } -HRESULT CSingleMethodProps::SetProperties(const wchar_t **names, const PROPVARIANT *values, UInt32 numProps) +HRESULT CSingleMethodProps::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps) { Init(); for (UInt32 i = 0; i < numProps; i++) @@ -123,13 +137,13 @@ HRESULT CSingleMethodProps::SetProperties(const wchar_t **names, const PROPVARIA UInt32 a = 9; RINOK(ParsePropToUInt32(name.Ptr(1), value, a)); _level = a; - AddLevelProp(a); + AddProp_Level(a); } - else if (name.IsPrefixedBy(L"mt")) + else if (name.IsPrefixedBy_Ascii_NoCase("mt")) { #ifndef _7ZIP_ST RINOK(ParseMtProp(name.Ptr(2), value, _numProcessors, _numThreads)); - AddNumThreadsProp(_numThreads); + AddProp_NumThreads(_numThreads); #endif } else |