diff options
Diffstat (limited to '7zip/Archive/7z/7zHandler.cpp')
-rwxr-xr-x | 7zip/Archive/7z/7zHandler.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/7zip/Archive/7z/7zHandler.cpp b/7zip/Archive/7z/7zHandler.cpp index 45ca1abe..ac1e2405 100755 --- a/7zip/Archive/7z/7zHandler.cpp +++ b/7zip/Archive/7z/7zHandler.cpp @@ -14,6 +14,12 @@ #include "../Common/MultiStream.h" #endif +#ifdef __7Z_SET_PROPERTIES +#ifdef EXTRACT_ONLY +#include "../Common/ParseProperties.h" +#endif +#endif + using namespace NWindows; namespace NArchive { @@ -21,6 +27,9 @@ namespace N7z { CHandler::CHandler() { + #ifdef COMPRESS_MT + _numThreads = NWindows::NSystem::GetNumberOfProcessors(); + #endif #ifndef EXTRACT_ONLY Init(); #endif @@ -708,4 +717,41 @@ STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream) } #endif + +#ifdef __7Z_SET_PROPERTIES +#ifdef EXTRACT_ONLY + +STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties) +{ + COM_TRY_BEGIN + const UInt32 numProcessors = NSystem::GetNumberOfProcessors(); + _numThreads = numProcessors; + + for (int i = 0; i < numProperties; i++) + { + UString name = names[i]; + name.MakeUpper(); + if (name.IsEmpty()) + return E_INVALIDARG; + const PROPVARIANT &value = values[i]; + UInt32 number; + int index = ParseStringToUInt32(name, number); + if (index == 0) + { + if(name.Left(2).CompareNoCase(L"MT") == 0) + { + RINOK(ParseMtProp(name.Mid(2), value, numProcessors, _numThreads)); + continue; + } + else + return E_INVALIDARG; + } + } + return S_OK; + COM_TRY_END +} + +#endif +#endif + }} |