1
// algparam.cpp - written and placed in the public domain by Wei Dai
5
#ifndef CRYPTOPP_IMPORTS
9
NAMESPACE_BEGIN(CryptoPP)
11
PAssignIntToInteger g_pAssignIntToInteger = NULL;
13
bool CombinedNameValuePairs::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
15
if (strcmp(name, "ValueNames") == 0)
16
return m_pairs1.GetVoidValue(name, valueType, pValue) && m_pairs2.GetVoidValue(name, valueType, pValue);
18
return m_pairs1.GetVoidValue(name, valueType, pValue) || m_pairs2.GetVoidValue(name, valueType, pValue);
21
void AlgorithmParametersBase::operator=(const AlgorithmParametersBase& rhs)
26
bool AlgorithmParametersBase::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
28
if (strcmp(name, "ValueNames") == 0)
30
NameValuePairs::ThrowIfTypeMismatch(name, typeid(std::string), valueType);
32
m_next->GetVoidValue(name, valueType, pValue);
33
(*reinterpret_cast<std::string *>(pValue) += m_name) += ";";
36
else if (strcmp(name, m_name) == 0)
38
AssignValue(name, valueType, pValue);
42
else if (m_next.get())
43
return m_next->GetVoidValue(name, valueType, pValue);
48
AlgorithmParameters::AlgorithmParameters()
49
: m_defaultThrowIfNotUsed(true)
53
AlgorithmParameters::AlgorithmParameters(const AlgorithmParameters &x)
54
: m_defaultThrowIfNotUsed(x.m_defaultThrowIfNotUsed)
56
m_next.reset(const_cast<AlgorithmParameters &>(x).m_next.release());
59
AlgorithmParameters & AlgorithmParameters::operator=(const AlgorithmParameters &x)
61
m_next.reset(const_cast<AlgorithmParameters &>(x).m_next.release());
65
bool AlgorithmParameters::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
68
return m_next->GetVoidValue(name, valueType, pValue);