diff options
author | Vincent Richard <[email protected]> | 2005-01-28 17:50:53 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-01-28 17:50:53 +0000 |
commit | 4ae97ddb0957c626a01682e24c68710e608bcc43 (patch) | |
tree | b81b4898dbfae5a81a6ca6820c7530bc39acf3e9 /src/plainTextPart.cpp | |
parent | Fixed bug with signed/unsigned char. (diff) | |
download | vmime-4ae97ddb0957c626a01682e24c68710e608bcc43.tar.gz vmime-4ae97ddb0957c626a01682e24c68710e608bcc43.zip |
Splitted 'contentHandler' into three classes: 'emptyContentHandler', 'stringContentHandler' and 'streamContentHandler'.
Diffstat (limited to 'src/plainTextPart.cpp')
-rw-r--r-- | src/plainTextPart.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/plainTextPart.cpp b/src/plainTextPart.cpp index a1902bb6..cfaf35a4 100644 --- a/src/plainTextPart.cpp +++ b/src/plainTextPart.cpp @@ -21,11 +21,25 @@ #include "vmime/header.hpp" #include "vmime/exception.hpp" +#include "vmime/emptyContentHandler.hpp" + namespace vmime { +plainTextPart::plainTextPart() + : m_text(new emptyContentHandler) +{ +} + + +plainTextPart::~plainTextPart() +{ + delete (m_text); +} + + const mediaType plainTextPart::getType() const { return (mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN)); @@ -50,14 +64,15 @@ void plainTextPart::generateIn(bodyPart& /* message */, bodyPart& parent) const part->getHeader()->ContentTransferEncoding().setValue(encoding(encodingTypes::QUOTED_PRINTABLE)); // Set contents - part->getBody()->setContents(m_text); + part->getBody()->setContents(*m_text); } void plainTextPart::parse(const bodyPart& /* message */, const bodyPart& /* parent */, const bodyPart& textPart) { - m_text = textPart.getBody()->getContents(); + delete (m_text); + m_text = textPart.getBody()->getContents().clone(); try { @@ -91,13 +106,14 @@ void plainTextPart::setCharset(const charset& ch) const contentHandler& plainTextPart::getText() const { - return (m_text); + return (*m_text); } void plainTextPart::setText(const contentHandler& text) { - m_text = text; + delete (m_text); + m_text = text.clone(); } |