diff options
author | weidai <weidai11@users.noreply.github.com> | 2009-03-15 09:44:42 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2009-03-15 09:44:42 +0000 |
commit | eeb9ff5e0b636456e46ae5f8dc96bd0a097eb178 (patch) | |
tree | 856e6cb973a9c21ed128b3a0029354bb22e3a40a /algparam.h | |
parent | 3961b41d8f2426caa4a47509a743837c24f1438d (diff) | |
download | cryptopp-git-eeb9ff5e0b636456e46ae5f8dc96bd0a097eb178.tar.gz |
fix C++Builder 2009 compile, update Readme and License
Diffstat (limited to 'algparam.h')
-rw-r--r-- | algparam.h | 29 |
1 files changed, 21 insertions, 8 deletions
@@ -335,12 +335,21 @@ class CRYPTOPP_DLL AlgorithmParameters : public NameValuePairs public: AlgorithmParameters(); - AlgorithmParameters(const AlgorithmParameters &x); +#ifdef __BORLANDC__ + template <class T> + AlgorithmParameters(const char *name, const T &value, bool throwIfNotUsed=true) + : m_next(new AlgorithmParametersTemplate<T>(name, value, throwIfNotUsed)) + , m_defaultThrowIfNotUsed(throwIfNotUsed) + { + } +#endif - AlgorithmParameters & operator=(const AlgorithmParameters &x); + AlgorithmParameters(const AlgorithmParameters &x); - template <class T> - AlgorithmParameters & operator()(const char *name, const T &value, bool throwIfNotUsed) + AlgorithmParameters & operator=(const AlgorithmParameters &x); + + template <class T> + AlgorithmParameters & operator()(const char *name, const T &value, bool throwIfNotUsed) { member_ptr<AlgorithmParametersBase> p(new AlgorithmParametersTemplate<T>(name, value, throwIfNotUsed)); p->m_next.reset(m_next.release()); @@ -349,14 +358,14 @@ public: return *this; } - template <class T> - AlgorithmParameters & operator()(const char *name, const T &value) + template <class T> + AlgorithmParameters & operator()(const char *name, const T &value) { return operator()(name, value, m_defaultThrowIfNotUsed); } - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; - + bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; + protected: member_ptr<AlgorithmParametersBase> m_next; bool m_defaultThrowIfNotUsed; @@ -370,11 +379,15 @@ protected: repeatedly using operator() on the object returned by MakeParameters, for example: AlgorithmParameters parameters = MakeParameters(name1, value1)(name2, value2)(name3, value3); */ +#ifdef __BORLANDC__ +typedef AlgorithmParameters MakeParameters; +#else template <class T> AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed = true) { return AlgorithmParameters()(name, value, throwIfNotUsed); } +#endif #define CRYPTOPP_GET_FUNCTION_ENTRY(name) (Name::name(), &ThisClass::Get##name) #define CRYPTOPP_SET_FUNCTION_ENTRY(name) (Name::name(), &ThisClass::Set##name) |