From 2949fb51f13e1236d5c161f02e1c2c8541100e9f Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Oct 2004 15:05:47 +0000 Subject: Refactoring (see ChangeLog). --- src/contentTypeField.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/contentTypeField.cpp') diff --git a/src/contentTypeField.cpp b/src/contentTypeField.cpp index 3149606e..69da97ae 100644 --- a/src/contentTypeField.cpp +++ b/src/contentTypeField.cpp @@ -20,6 +20,8 @@ #include "contentTypeField.hpp" #include "exception.hpp" +#include "standardParams.hpp" + namespace vmime { @@ -30,32 +32,33 @@ contentTypeField::contentTypeField() } -void contentTypeField::parseValue(const string& buffer, - const string::size_type position, const string::size_type end) +contentTypeField::contentTypeField(contentTypeField&) + : headerField(), parameterizedHeaderField(), genericField () { - m_value.parse(buffer, position, end); } -const string contentTypeField::generateValue() const +const string contentTypeField::getBoundary() const { - return (m_value.generate()); + return (dynamic_cast (*findParameter("boundary")).getValue()); } -contentTypeField& contentTypeField::operator=(const mediaType& type) +void contentTypeField::setBoundary(const string& boundary) { - m_value = type; - return (*this); + dynamic_cast (*getParameter("boundary")).setValue(boundary); } -void contentTypeField::copyFrom(const headerField& field) +const charset& contentTypeField::getCharset() const { - const contentTypeField& source = dynamic_cast(field); - m_value = source.m_value; + return (dynamic_cast (*findParameter("charset")).getValue()); +} - parameterizedHeaderField::copyFrom(field); + +void contentTypeField::setCharset(const charset& ch) +{ + dynamic_cast (*getParameter("charset")).setValue(ch); } -- cgit v1.2.3