algparam.cpp

00001 // algparam.cpp - written and placed in the public domain by Wei Dai
00002 
00003 #include "pch.h"
00004 
00005 #ifndef CRYPTOPP_IMPORTS
00006 
00007 #include "algparam.h"
00008 
00009 NAMESPACE_BEGIN(CryptoPP)
00010 
00011 PAssignIntToInteger g_pAssignIntToInteger = NULL;
00012 
00013 bool CombinedNameValuePairs::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
00014 {
00015         if (strcmp(name, "ValueNames") == 0)
00016                 return m_pairs1.GetVoidValue(name, valueType, pValue) && m_pairs2.GetVoidValue(name, valueType, pValue);
00017         else
00018                 return m_pairs1.GetVoidValue(name, valueType, pValue) || m_pairs2.GetVoidValue(name, valueType, pValue);
00019 }
00020 
00021 bool AlgorithmParametersBase::GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
00022 {
00023         if (strcmp(name, "ValueNames") == 0)
00024         {
00025                 ThrowIfTypeMismatch(name, typeid(std::string), valueType);
00026                 GetParent().GetVoidValue(name, valueType, pValue);
00027                 (*reinterpret_cast<std::string *>(pValue) += m_name) += ";";
00028                 return true;
00029         }
00030         else if (strcmp(name, m_name) == 0)
00031         {
00032                 AssignValue(name, valueType, pValue);
00033                 m_used = true;
00034                 return true;
00035         }
00036         else
00037                 return GetParent().GetVoidValue(name, valueType, pValue);
00038 }
00039 
00040 NAMESPACE_END
00041 
00042 #endif

Generated on Sat Dec 23 02:07:05 2006 for Crypto++ by  doxygen 1.5.1-p1