diff options
author | Vincent Richard <[email protected]> | 2005-11-04 23:21:22 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-11-04 23:21:22 +0000 |
commit | acfa9ffc64f56de42049bf5049810c15477729ed (patch) | |
tree | 3bb84a7319fb209c00f656927c83965f03bd5329 /src/contentTypeField.cpp | |
parent | Fixed typo for 'ac_cv_sizeof_long'. (diff) | |
download | vmime-acfa9ffc64f56de42049bf5049810c15477729ed.tar.gz vmime-acfa9ffc64f56de42049bf5049810c15477729ed.zip |
Refactored header field values and parameters.
Diffstat (limited to 'src/contentTypeField.cpp')
-rw-r--r-- | src/contentTypeField.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
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 <mediaType>() + : headerField(), parameterizedHeaderField() { } const string contentTypeField::getBoundary() const { - return (dynamic_cast <const defaultParameter&>(*findParameter("boundary")).getValue().getBuffer()); + return findParameter("boundary")->getValue().getBuffer(); } void contentTypeField::setBoundary(const string& boundary) { - dynamic_cast <defaultParameter&>(*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 <const charsetParameter&>(*findParameter("charset")).getValue()); + return findParameter("charset")->getValueAs <charset>(); } void contentTypeField::setCharset(const charset& ch) { - dynamic_cast <charsetParameter&>(*getParameter("charset")).setValue(ch); + getParameter("charset")->setValue(ch); } const string contentTypeField::getReportType() const { - return (dynamic_cast <const defaultParameter&>(*findParameter("report-type")).getValue().getBuffer()); + return findParameter("report-type")->getValue().getBuffer(); } void contentTypeField::setReportType(const string& reportType) { - dynamic_cast <defaultParameter&>(*getParameter("report-type")).setValue(word(reportType)); + getParameter("report-type")->setValue(word(reportType, vmime::charsets::US_ASCII)); } } // vmime + |