From acfa9ffc64f56de42049bf5049810c15477729ed Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 4 Nov 2005 23:21:22 +0000 Subject: Refactored header field values and parameters. --- src/contentTypeField.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/contentTypeField.cpp') diff --git a/src/contentTypeField.cpp b/src/contentTypeField.cpp index 1b46ffc3..852f9961 100644 --- a/src/contentTypeField.cpp +++ b/src/contentTypeField.cpp @@ -24,8 +24,6 @@ #include "vmime/contentTypeField.hpp" #include "vmime/exception.hpp" -#include "vmime/standardParams.hpp" - namespace vmime { @@ -37,45 +35,46 @@ contentTypeField::contentTypeField() contentTypeField::contentTypeField(contentTypeField&) - : headerField(), parameterizedHeaderField(), genericField () + : headerField(), parameterizedHeaderField() { } const string contentTypeField::getBoundary() const { - return (dynamic_cast (*findParameter("boundary")).getValue().getBuffer()); + return findParameter("boundary")->getValue().getBuffer(); } void contentTypeField::setBoundary(const string& boundary) { - dynamic_cast (*getParameter("boundary")).setValue(word(boundary)); + getParameter("boundary")->setValue(word(boundary, vmime::charsets::US_ASCII)); } -const charset& contentTypeField::getCharset() const +const charset contentTypeField::getCharset() const { - return (dynamic_cast (*findParameter("charset")).getValue()); + return findParameter("charset")->getValueAs (); } void contentTypeField::setCharset(const charset& ch) { - dynamic_cast (*getParameter("charset")).setValue(ch); + getParameter("charset")->setValue(ch); } const string contentTypeField::getReportType() const { - return (dynamic_cast (*findParameter("report-type")).getValue().getBuffer()); + return findParameter("report-type")->getValue().getBuffer(); } void contentTypeField::setReportType(const string& reportType) { - dynamic_cast (*getParameter("report-type")).setValue(word(reportType)); + getParameter("report-type")->setValue(word(reportType, vmime::charsets::US_ASCII)); } } // vmime + -- cgit v1.2.3