diff options
Diffstat (limited to '')
-rw-r--r-- | src/standardParams.hpp (renamed from src/dateParameter.hpp) | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/dateParameter.hpp b/src/standardParams.hpp index aa4ffd63..340f290b 100644 --- a/src/dateParameter.hpp +++ b/src/standardParams.hpp @@ -17,39 +17,40 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#ifndef VMIME_DATEPARAMETER_HPP_INCLUDED -#define VMIME_DATEPARAMETER_HPP_INCLUDED +#ifndef VMIME_STANDARDPARAMS_HPP_INCLUDED +#define VMIME_STANDARDPARAMS_HPP_INCLUDED -#include "defaultParameter.hpp" +#include "genericParameter.hpp" + +// Inclusion for field value types #include "dateTime.hpp" +#include "charset.hpp" namespace vmime { -class dateParameter : public defaultParameter -{ -protected: - - datetime m_value; - -public: +#define DECLARE_STANDARD_PARAM(paramClassName, valueTypeClassName) \ + class paramClassName : public genericParameter <valueTypeClassName> { \ + friend class parameterFactory::registerer <paramClassName>; \ + protected: \ + paramClassName() { } \ + paramClassName(const paramClassName&) \ + : genericParameter <valueTypeClassName>() { /* Not used */ } \ + } - void copyFrom(const parameter& param); - const datetime& value() const { return (m_value); } - datetime& value() { return (m_value); } +DECLARE_STANDARD_PARAM(defaultParameter, string); +DECLARE_STANDARD_PARAM(dateParameter, datetime); +DECLARE_STANDARD_PARAM(charsetParameter, charset); -protected: - void parseValue(const string& buffer, const string::size_type position, const string::size_type end); - const string generateValue() const; -}; +#undef DECLARE_STANDARD_PARAM } // vmime -#endif // VMIME_DATEPARAMETER_HPP_INCLUDED +#endif // VMIME_STANDARDPARAMS_HPP_INCLUDED |