diff --git a/src/attachmentHelper.cpp b/src/attachmentHelper.cpp index 84da47a7..e8ec82c2 100644 --- a/src/attachmentHelper.cpp +++ b/src/attachmentHelper.cpp @@ -251,7 +251,7 @@ void attachmentHelper::addAttachment(ref msg, ref att) } // Generate the attachment part - att->generateIn(*part); + att->generateIn(part); } diff --git a/src/bodyPartAttachment.cpp b/src/bodyPartAttachment.cpp index 9780aeff..0156ab61 100644 --- a/src/bodyPartAttachment.cpp +++ b/src/bodyPartAttachment.cpp @@ -153,7 +153,7 @@ ref bodyPartAttachment::getContentType() const } -void bodyPartAttachment::generateIn(bodyPart& /* parent */) const +void bodyPartAttachment::generateIn(ref /* parent */) const { // Not used } diff --git a/src/defaultAttachment.cpp b/src/defaultAttachment.cpp index 2e10eb3c..8861131c 100644 --- a/src/defaultAttachment.cpp +++ b/src/defaultAttachment.cpp @@ -76,56 +76,56 @@ defaultAttachment& defaultAttachment::operator=(const defaultAttachment& attach) } -void defaultAttachment::generateIn(bodyPart& parent) const +void defaultAttachment::generateIn(ref parent) const { // Create and append a new part for this attachment ref part = vmime::create (); - parent.getBody()->appendPart(part); + parent->getBody()->appendPart(part); - generatePart(*part); + generatePart(part); } -void defaultAttachment::generatePart(bodyPart& part) const +void defaultAttachment::generatePart(ref part) const { // Set header fields - part.getHeader()->ContentType()->setValue(m_type); - if (!m_desc.isEmpty()) part.getHeader()->ContentDescription()->setValue(m_desc); - part.getHeader()->ContentTransferEncoding()->setValue(m_encoding); - part.getHeader()->ContentDisposition()->setValue(contentDisposition(contentDispositionTypes::ATTACHMENT)); + part->getHeader()->ContentType()->setValue(m_type); + if (!m_desc.isEmpty()) part->getHeader()->ContentDescription()->setValue(m_desc); + part->getHeader()->ContentTransferEncoding()->setValue(m_encoding); + part->getHeader()->ContentDisposition()->setValue(contentDisposition(contentDispositionTypes::ATTACHMENT)); // Set contents - part.getBody()->setContents(m_data); + part->getBody()->setContents(m_data); } const mediaType defaultAttachment::getType() const { - return (m_type); + return m_type; } const text defaultAttachment::getDescription() const { - return (m_desc); + return m_desc; } const word defaultAttachment::getName() const { - return (m_name); + return m_name; } const ref defaultAttachment::getData() const { - return (m_data); + return m_data; } const encoding defaultAttachment::getEncoding() const { - return (m_encoding); + return m_encoding; } diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp index ece0abc3..988cc0fb 100644 --- a/src/fileAttachment.cpp +++ b/src/fileAttachment.cpp @@ -66,7 +66,7 @@ void fileAttachment::setData(const string& filename) if (!*file) { - delete (file); + delete file; throw exceptions::open_file_error(); } @@ -76,11 +76,11 @@ void fileAttachment::setData(const string& filename) } -void fileAttachment::generatePart(bodyPart& part) const +void fileAttachment::generatePart(ref part) const { defaultAttachment::generatePart(part); - ref cdf = part.getHeader()->ContentDisposition(). + ref cdf = part->getHeader()->ContentDisposition(). dynamicCast (); if (m_fileInfo.hasSize()) cdf->setSize(utility::stringUtils::toString(m_fileInfo.getSize())); @@ -93,13 +93,13 @@ void fileAttachment::generatePart(bodyPart& part) const const fileAttachment::fileInfo& fileAttachment::getFileInfo() const { - return (m_fileInfo); + return m_fileInfo; } fileAttachment::fileInfo& fileAttachment::getFileInfo() { - return (m_fileInfo); + return m_fileInfo; } diff --git a/src/generatedMessageAttachment.cpp b/src/generatedMessageAttachment.cpp index 76229fea..50ad94d1 100644 --- a/src/generatedMessageAttachment.cpp +++ b/src/generatedMessageAttachment.cpp @@ -95,7 +95,7 @@ ref generatedMessageAttachment::getMessage() const } -void generatedMessageAttachment::generateIn(bodyPart& /* parent */) const +void generatedMessageAttachment::generateIn(ref /* parent */) const { // Not used (see 'parsedMessageAttachment') } diff --git a/src/messageBuilder.cpp b/src/messageBuilder.cpp index d22d31ef..4f5d3a92 100644 --- a/src/messageBuilder.cpp +++ b/src/messageBuilder.cpp @@ -132,7 +132,7 @@ ref messageBuilder::construct() const for (std::vector >::const_iterator a = m_attach.begin() ; a != m_attach.end() ; ++a) { - (*a)->generateIn(*msg); + (*a)->generateIn(msg); } } diff --git a/src/parsedMessageAttachment.cpp b/src/parsedMessageAttachment.cpp index 349f6881..b60715bb 100644 --- a/src/parsedMessageAttachment.cpp +++ b/src/parsedMessageAttachment.cpp @@ -95,11 +95,11 @@ ref parsedMessageAttachment::getMessage() const } -void parsedMessageAttachment::generateIn(bodyPart& parent) const +void parsedMessageAttachment::generateIn(ref parent) const { // Create and append a new part for this attachment ref part = vmime::create (); - parent.getBody()->appendPart(part); + parent->getBody()->appendPart(part); // Set header fields part->getHeader()->ContentType()->setValue(getType()); diff --git a/vmime/attachment.hpp b/vmime/attachment.hpp index 67bab8d0..527a2171 100644 --- a/vmime/attachment.hpp +++ b/vmime/attachment.hpp @@ -108,7 +108,7 @@ protected: * * @param parent body part in which to generate the attachment */ - virtual void generateIn(bodyPart& parent) const = 0; + virtual void generateIn(ref parent) const = 0; }; diff --git a/vmime/bodyPartAttachment.hpp b/vmime/bodyPartAttachment.hpp index b1b7ce6c..4138470b 100644 --- a/vmime/bodyPartAttachment.hpp +++ b/vmime/bodyPartAttachment.hpp @@ -62,7 +62,7 @@ public: private: - void generateIn(bodyPart& parent) const; + void generateIn(ref parent) const; ref getContentDisposition() const; ref getContentType() const; diff --git a/vmime/defaultAttachment.hpp b/vmime/defaultAttachment.hpp index 4e54c75f..bfa72377 100644 --- a/vmime/defaultAttachment.hpp +++ b/vmime/defaultAttachment.hpp @@ -74,11 +74,11 @@ protected: private: // No need to override "generateIn", use "generatePart" instead (see below). - void generateIn(bodyPart& parent) const; + void generateIn(ref parent) const; protected: - virtual void generatePart(bodyPart& part) const; + virtual void generatePart(ref part) const; }; diff --git a/vmime/fileAttachment.hpp b/vmime/fileAttachment.hpp index 6ec686a4..50351ecb 100644 --- a/vmime/fileAttachment.hpp +++ b/vmime/fileAttachment.hpp @@ -166,7 +166,7 @@ private: fileInfo m_fileInfo; - void generatePart(bodyPart& part) const; + void generatePart(ref part) const; }; diff --git a/vmime/generatedMessageAttachment.hpp b/vmime/generatedMessageAttachment.hpp index c62cdf58..f0443d38 100644 --- a/vmime/generatedMessageAttachment.hpp +++ b/vmime/generatedMessageAttachment.hpp @@ -60,7 +60,7 @@ public: protected: - void generateIn(bodyPart& parent) const; + void generateIn(ref parent) const; private: diff --git a/vmime/parsedMessageAttachment.hpp b/vmime/parsedMessageAttachment.hpp index ada88df8..5add8a0c 100644 --- a/vmime/parsedMessageAttachment.hpp +++ b/vmime/parsedMessageAttachment.hpp @@ -59,7 +59,7 @@ public: protected: - void generateIn(bodyPart& parent) const; + void generateIn(ref parent) const; private: