diff options
author | Vincent Richard <[email protected]> | 2004-10-21 15:05:47 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2004-10-21 15:05:47 +0000 |
commit | 2949fb51f13e1236d5c161f02e1c2c8541100e9f (patch) | |
tree | 991edcf50483116ce83977a4d9e652de8c5328dc /src/contentTypeField.cpp | |
parent | header class unit tests added (diff) | |
download | vmime-2949fb51f13e1236d5c161f02e1c2c8541100e9f.tar.gz vmime-2949fb51f13e1236d5c161f02e1c2c8541100e9f.zip |
Refactoring (see ChangeLog).
Diffstat (limited to 'src/contentTypeField.cpp')
-rw-r--r-- | src/contentTypeField.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
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 <mediaType>() { - m_value.parse(buffer, position, end); } -const string contentTypeField::generateValue() const +const string contentTypeField::getBoundary() const { - return (m_value.generate()); + return (dynamic_cast <const defaultParameter&>(*findParameter("boundary")).getValue()); } -contentTypeField& contentTypeField::operator=(const mediaType& type) +void contentTypeField::setBoundary(const string& boundary) { - m_value = type; - return (*this); + dynamic_cast <defaultParameter&>(*getParameter("boundary")).setValue(boundary); } -void contentTypeField::copyFrom(const headerField& field) +const charset& contentTypeField::getCharset() const { - const contentTypeField& source = dynamic_cast<const contentTypeField&>(field); - m_value = source.m_value; + return (dynamic_cast <const charsetParameter&>(*findParameter("charset")).getValue()); +} - parameterizedHeaderField::copyFrom(field); + +void contentTypeField::setCharset(const charset& ch) +{ + dynamic_cast <charsetParameter&>(*getParameter("charset")).setValue(ch); } |