summaryrefslogtreecommitdiff
path: root/algparam.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-18 04:35:30 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-18 04:35:30 +0000
commita89df27c0f7ded0a673dc84ce0b0e24c6d05e0d0 (patch)
treea25c153b42dc3f510a7981a031bd04dfa0a7a712 /algparam.h
parent656db5504c8c656d3981fed232da44b2f28b1feb (diff)
downloadcryptopp-a89df27c0f7ded0a673dc84ce0b0e24c6d05e0d0.tar.gz
misc changes
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@103 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'algparam.h')
-rw-r--r--algparam.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/algparam.h b/algparam.h
index 95a9077..b6f2102 100644
--- a/algparam.h
+++ b/algparam.h
@@ -67,7 +67,7 @@ private:
unsigned int m_size;
};
-class CombinedNameValuePairs : public NameValuePairs
+class CRYPTOPP_DLL CombinedNameValuePairs : public NameValuePairs
{
public:
CombinedNameValuePairs(const NameValuePairs &pairs1, const NameValuePairs &pairs2)
@@ -323,6 +323,12 @@ public:
return AlgorithmParameters<AlgorithmParameters<PARENT,T>, R>(*this, name, value, m_throwIfNotUsed);
}
+ template <class R>
+ AlgorithmParameters<AlgorithmParameters<PARENT,T>, R> operator()(const char *name, const R &value, bool throwIfNotUsed) const
+ {
+ return AlgorithmParameters<AlgorithmParameters<PARENT,T>, R>(*this, name, value, throwIfNotUsed);
+ }
+
private:
const NameValuePairs & GetParent() const {return m_parent;}
PARENT m_parent;
@@ -331,7 +337,11 @@ private:
//! Create an object that implements NameValuePairs for passing parameters
/*! \param throwIfNotUsed if true, the object will throw an exception if the value is not accessed
\note throwIfNotUsed is ignored if using a compiler that does not support std::uncaught_exception(),
- such as MSVC 7.0 and earlier. */
+ such as MSVC 7.0 and earlier.
+ \note A NameValuePairs object containing an arbitrary number of name value pairs may be constructed by
+ repeatedly using operator() on the object returned by MakeParameters, for example:
+ const NameValuePairs &parameters = MakeParameters(name1, value1)(name2, value2)(name3, value3);
+*/
template <class T>
AlgorithmParameters<NullNameValuePairs,T> MakeParameters(const char *name, const T &value, bool throwIfNotUsed = true)
{