summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/7zip/Common/MethodProps.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/lzma/CPP/7zip/Common/MethodProps.h')
-rw-r--r--3rdparty/lzma/CPP/7zip/Common/MethodProps.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/3rdparty/lzma/CPP/7zip/Common/MethodProps.h b/3rdparty/lzma/CPP/7zip/Common/MethodProps.h
index 0bdddc6b711..765e425df6d 100644
--- a/3rdparty/lzma/CPP/7zip/Common/MethodProps.h
+++ b/3rdparty/lzma/CPP/7zip/Common/MethodProps.h
@@ -11,7 +11,7 @@
bool StringToBool(const UString &s, bool &res);
HRESULT PROPVARIANT_to_bool(const PROPVARIANT &prop, bool &dest);
-int ParseStringToUInt32(const UString &srcString, UInt32 &number);
+unsigned ParseStringToUInt32(const UString &srcString, UInt32 &number);
HRESULT ParsePropToUInt32(const UString &name, const PROPVARIANT &prop, UInt32 &resValue);
HRESULT ParseMtProp(const UString &name, const PROPVARIANT &prop, UInt32 defaultNumThreads, UInt32 &numThreads);
@@ -32,7 +32,7 @@ struct CProps
bool AreThereNonOptionalProps() const
{
- for (int i = 0; i < Props.Size(); i++)
+ FOR_VECTOR (i, Props)
if (!Props[i].IsOptional)
return true;
return false;
@@ -40,13 +40,12 @@ struct CProps
void AddProp32(PROPID propid, UInt32 level);
- void AddPropString(PROPID propid, const wchar_t *s)
+ void AddProp_Ascii(PROPID propid, const char *s)
{
- CProp prop;
+ CProp &prop = Props.AddNew();
prop.IsOptional = true;
prop.Id = propid;
prop.Value = s;
- Props.Add(prop);
}
HRESULT SetCoderProps(ICompressSetCoderProperties *scp, const UInt64 *dataSizeReduce) const;
@@ -100,6 +99,14 @@ public:
return level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26));
}
+ bool Are_Lzma_Model_Props_Defined() const
+ {
+ if (FindProp(NCoderPropID::kPosStateBits) >= 0) return true;
+ if (FindProp(NCoderPropID::kLitContextBits) >= 0) return true;
+ if (FindProp(NCoderPropID::kLitPosBits) >= 0) return true;
+ return false;
+ }
+
UInt32 Get_Lzma_NumThreads(bool &fixedNumber) const
{
fixedNumber = false;
@@ -153,12 +160,12 @@ public:
return level >= 9 ? (192 << 20) : ((UInt32)1 << (level + 19));
}
- void AddLevelProp(UInt32 level)
+ void AddProp_Level(UInt32 level)
{
AddProp32(NCoderPropID::kLevel, level);
}
- void AddNumThreadsProp(UInt32 numThreads)
+ void AddProp_NumThreads(UInt32 numThreads)
{
AddProp32(NCoderPropID::kNumThreads, numThreads);
}
@@ -170,15 +177,18 @@ public:
class COneMethodInfo: public CMethodProps
{
public:
- UString MethodName;
+ AString MethodName;
+ UString PropsString;
void Clear()
{
CMethodProps::Clear();
MethodName.Empty();
+ PropsString.Empty();
}
bool IsEmpty() const { return MethodName.IsEmpty() && Props.IsEmpty(); }
HRESULT ParseMethodFromPROPVARIANT(const UString &realName, const PROPVARIANT &value);
+ HRESULT ParseMethodFromString(const UString &s);
};
#endif