diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-12-31 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:58 +0300 |
commit | 3a524e5ba2d7bb0c46e11502822f8093dd2ab0f4 (patch) | |
tree | b33da9cac0a5fc22a16bdf4de106c8a9eefd1465 /CPP/7zip/Archive/Common | |
parent | c1f1243a70558e86e14b1ea09dc287737378894b (diff) |
4.634.63
Diffstat (limited to 'CPP/7zip/Archive/Common')
-rwxr-xr-x | CPP/7zip/Archive/Common/HandlerOut.cpp | 76 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/HandlerOut.h | 4 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/OutStreamWithCRC.h | 4 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Common/OutStreamWithSha1.h | 6 |
4 files changed, 42 insertions, 48 deletions
diff --git a/CPP/7zip/Archive/Common/HandlerOut.cpp b/CPP/7zip/Archive/Common/HandlerOut.cpp index 63899fe4..3e817beb 100755 --- a/CPP/7zip/Archive/Common/HandlerOut.cpp +++ b/CPP/7zip/Archive/Common/HandlerOut.cpp @@ -1,17 +1,21 @@ -// HandlerOutCommon.cpp +// HandlerOut.cpp #include "StdAfx.h" -#include "HandlerOut.h" -#include "../../../Windows/PropVariant.h" #include "../../../Common/StringToInt.h" -#include "../../ICoder.h" -#include "../Common/ParseProperties.h" + +#include "../../../Windows/PropVariant.h" #ifdef COMPRESS_MT #include "../../../Windows/System.h" #endif +#include "../../ICoder.h" + +#include "../Common/ParseProperties.h" + +#include "HandlerOut.h" + using namespace NWindows; namespace NArchive { @@ -161,13 +165,13 @@ static int FindPropIdFromStringName(const UString &name) static void SetOneMethodProp(COneMethodInfo &oneMethodInfo, PROPID propID, const NWindows::NCOM::CPropVariant &value) { - for (int j = 0; j < oneMethodInfo.Properties.Size(); j++) - if (oneMethodInfo.Properties[j].Id == propID) + for (int j = 0; j < oneMethodInfo.Props.Size(); j++) + if (oneMethodInfo.Props[j].Id == propID) return; - CProp property; - property.Id = propID; - property.Value = value; - oneMethodInfo.Properties.Add(property); + CProp prop; + prop.Id = propID; + prop.Value = value; + oneMethodInfo.Props.Add(prop); } void COutHandler::SetCompressionMethod2(COneMethodInfo &oneMethodInfo @@ -311,19 +315,16 @@ static void SplitParam(const UString ¶m, UString &name, UString &value) HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name, const UString &value) { - CProp property; - if ( - name.CompareNoCase(L"D") == 0 || - name.CompareNoCase(L"MEM") == 0) + CProp prop; + if (name.CompareNoCase(L"D") == 0 || + name.CompareNoCase(L"MEM") == 0) { UInt32 dicSize; RINOK(ParsePropDictionaryValue(value, dicSize)); - if (name.CompareNoCase(L"D") == 0) - property.Id = NCoderPropID::kDictionarySize; - else - property.Id = NCoderPropID::kUsedMemorySize; - property.Value = dicSize; - oneMethodInfo.Properties.Add(property); + prop.Id = (name.CompareNoCase(L"D") == 0) ? + NCoderPropID::kDictionarySize : + NCoderPropID::kUsedMemorySize; + prop.Value = dicSize; } else { @@ -332,7 +333,7 @@ HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name return E_INVALIDARG; const CNameToPropID &nameToPropID = g_NameToPropID[index]; - property.Id = nameToPropID.PropID; + prop.Id = nameToPropID.PropID; NCOM::CPropVariant propValue; @@ -354,11 +355,10 @@ HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name propValue = value; } - if (!ConvertProperty(propValue, nameToPropID.VarType, property.Value)) + if (!ConvertProperty(propValue, nameToPropID.VarType, prop.Value)) return E_INVALIDARG; - - oneMethodInfo.Properties.Add(property); } + oneMethodInfo.Props.Add(prop); return S_OK; } @@ -576,14 +576,13 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val } else { - CProp property; + CProp prop; if (realName.Left(1).CompareNoCase(L"D") == 0) { UInt32 dicSize; RINOK(ParsePropDictionaryValue(realName.Mid(1), value, dicSize)); - property.Id = NCoderPropID::kDictionarySize; - property.Value = dicSize; - oneMethodInfo.Properties.Add(property); + prop.Id = NCoderPropID::kDictionarySize; + prop.Value = dicSize; if (number <= mainDicMethodIndex) mainDicSize = dicSize; } @@ -591,17 +590,15 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val { UInt32 blockSize; RINOK(ParsePropDictionaryValue(realName.Mid(1), value, blockSize)); - property.Id = NCoderPropID::kBlockSize; - property.Value = blockSize; - oneMethodInfo.Properties.Add(property); + prop.Id = NCoderPropID::kBlockSize; + prop.Value = blockSize; } else if (realName.Left(3).CompareNoCase(L"MEM") == 0) { UInt32 dicSize; RINOK(ParsePropDictionaryValue(realName.Mid(3), value, dicSize)); - property.Id = NCoderPropID::kUsedMemorySize; - property.Value = dicSize; - oneMethodInfo.Properties.Add(property); + prop.Id = NCoderPropID::kUsedMemorySize; + prop.Value = dicSize; if (number <= mainDicMethodIndex) mainDicSize = dicSize; } @@ -610,15 +607,12 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val int index = FindPropIdFromStringName(realName); if (index < 0) return E_INVALIDARG; - const CNameToPropID &nameToPropID = g_NameToPropID[index]; - property.Id = nameToPropID.PropID; - - if (!ConvertProperty(value, nameToPropID.VarType, property.Value)) + prop.Id = nameToPropID.PropID; + if (!ConvertProperty(value, nameToPropID.VarType, prop.Value)) return E_INVALIDARG; - - oneMethodInfo.Properties.Add(property); } + oneMethodInfo.Props.Add(prop); } return S_OK; } diff --git a/CPP/7zip/Archive/Common/HandlerOut.h b/CPP/7zip/Archive/Common/HandlerOut.h index b6095a6b..89c81c1f 100755 --- a/CPP/7zip/Archive/Common/HandlerOut.h +++ b/CPP/7zip/Archive/Common/HandlerOut.h @@ -3,14 +3,14 @@ #ifndef __HANDLER_OUT_H #define __HANDLER_OUT_H -#include "../../Common/MethodProps.h" #include "../../../Common/MyString.h" +#include "../../Common/MethodProps.h" namespace NArchive { struct COneMethodInfo { - CObjectVector<CProp> Properties; + CObjectVector<CProp> Props; UString MethodName; }; diff --git a/CPP/7zip/Archive/Common/OutStreamWithCRC.h b/CPP/7zip/Archive/Common/OutStreamWithCRC.h index 32870235..a034ee9b 100755 --- a/CPP/7zip/Archive/Common/OutStreamWithCRC.h +++ b/CPP/7zip/Archive/Common/OutStreamWithCRC.h @@ -1,7 +1,7 @@ // OutStreamWithCRC.h -#ifndef __OUTSTREAMWITHCRC_H -#define __OUTSTREAMWITHCRC_H +#ifndef __OUT_STREAM_WITH_CRC_H +#define __OUT_STREAM_WITH_CRC_H #include "../../../Common/MyCom.h" #include "../../IStream.h" diff --git a/CPP/7zip/Archive/Common/OutStreamWithSha1.h b/CPP/7zip/Archive/Common/OutStreamWithSha1.h index 6df23080..4eab42a7 100755 --- a/CPP/7zip/Archive/Common/OutStreamWithSha1.h +++ b/CPP/7zip/Archive/Common/OutStreamWithSha1.h @@ -1,14 +1,14 @@ // OutStreamWithSha1.h -#ifndef __OUTSTREAMWITHSHA1_H -#define __OUTSTREAMWITHSHA1_H +#ifndef __OUT_STREAM_WITH_SHA1_H +#define __OUT_STREAM_WITH_SHA1_H #include "../../../Common/MyCom.h" #include "../../IStream.h" -#include "../../Crypto/Hash/Sha1.h" +#include "../../Crypto/Sha1.h" class COutStreamWithSha1: |