From a89df27c0f7ded0a673dc84ce0b0e24c6d05e0d0 Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 18 Jul 2003 04:35:30 +0000 Subject: misc changes git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@103 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- algparam.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'algparam.h') 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, R>(*this, name, value, m_throwIfNotUsed); } + template + AlgorithmParameters, R> operator()(const char *name, const R &value, bool throwIfNotUsed) const + { + return AlgorithmParameters, 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 ¶meters = MakeParameters(name1, value1)(name2, value2)(name3, value3); +*/ template AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed = true) { -- cgit v1.2.1