|
template<class T > |
bool | GetThisObject (T &object) const |
| Get a copy of this object or subobject.
|
|
template<class T > |
bool | GetThisPointer (T *&ptr) const |
| Get a pointer to this object.
|
|
template<class T > |
bool | GetValue (const char *name, T &value) const |
| Get a named value.
|
|
template<class T > |
T | GetValueWithDefault (const char *name, T defaultValue) const |
| Get a named value.
|
|
CRYPTOPP_DLL std::string | GetValueNames () const |
| Get a list of value names that can be retrieved.
|
|
CRYPTOPP_DLL bool | GetIntValue (const char *name, int &value) const |
| Get a named value with type int.
|
|
CRYPTOPP_DLL int | GetIntValueWithDefault (const char *name, int defaultValue) const |
| Get a named value with type int, with default.
|
|
CRYPTOPP_DLL bool | GetWord64Value (const char *name, word64 &value) const |
| Get a named value with type word64.
|
|
CRYPTOPP_DLL word64 | GetWord64ValueWithDefault (const char *name, word64 defaultValue) const |
| Get a named value with type word64, with default.
|
|
template<class T > |
void | GetRequiredParameter (const char *className, const char *name, T &value) const |
| Retrieves a required name/value pair.
|
|
CRYPTOPP_DLL void | GetRequiredIntParameter (const char *className, const char *name, int &value) const |
| Retrieves a required name/value pair.
|
|
virtual CRYPTOPP_DLL bool | GetVoidValue (const char *name, const std::type_info &valueType, void *pValue) const =0 |
| Get a named value.
|
|
Interface for retrieving values given their names.
This class is used to safely pass a variable number of arbitrarily typed arguments to functions and to read values from keys and crypto parameters.
To obtain an object that implements NameValuePairs for the purpose of parameter passing, use the MakeParameters() function.
To get a value from NameValuePairs, you need to know the name and the type of the value. Call GetValueNames() on a NameValuePairs object to obtain a list of value names that it supports. then look at the Name namespace documentation to see what the type of each value is, or alternatively, call GetIntValue() with the value name, and if the type is not int, a ValueTypeMismatch exception will be thrown and you can get the actual type from the exception object.
- See also
- NullNameValuePairs, g_nullNameValuePairs, NameValuePairs on the Crypto++ wiki
Definition at line 321 of file cryptlib.h.
virtual CRYPTOPP_DLL bool NameValuePairs::GetVoidValue |
( |
const char * |
name, |
|
|
const std::type_info & |
valueType, |
|
|
void * |
pValue |
|
) |
| const |
|
pure virtual |
Get a named value.
- Parameters
-
name | the name of the object or value to retrieve |
valueType | reference to a variable that receives the value |
pValue | void pointer to a variable that receives the value |
- Returns
- true if the value was retrieved, false otherwise
GetVoidValue() retrieves the value of name if it exists.
- Note
- GetVoidValue() is an internal function and should be implemented by derived classes. Users should use one of the other functions instead.
- See also
- GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), GetRequiredParameter() and GetRequiredIntParameter()
Implemented in CombinedNameValuePairs, AlgorithmParameters, NullNameValuePairs, DL_GroupParameters_EC< EC >, ESIGNFunction, InvertibleESIGNFunction, DL_GroupParameters_IntegerBased, DL_GroupParameters_IntegerBasedImpl< GROUP_PRECOMP, BASE_PRECOMP >, DL_GroupParameters_IntegerBasedImpl< DL_GroupPrecomputation_LUC, DL_BasePrecomputation_LUC >, DL_GroupParameters_IntegerBasedImpl< ModExpPrecomputation >, DL_GroupParameters_GFP, LUCFunction, InvertibleLUCFunction, DL_GroupParameters_LUC, DL_GroupParameters< T >, DL_GroupParameters< Integer >, DL_GroupParameters< typename GROUP_PRECOMP::Element >, DL_PrivateKeyImpl< GP >, DL_PublicKeyImpl< GP >, RabinFunction, InvertibleRabinFunction, RSAFunction, InvertibleRSAFunction, RWFunction, InvertibleRWFunction, x25519, ed25519PrivateKey, ed25519PublicKey, and XTR_DH.