From e90dbe0dd308fca3d6387209b50458bdfb2aeaa6 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 24 Dec 2004 12:37:52 +0000 Subject: [PATCH] Renamed class 'disposition' to 'contentDisposition'. --- ChangeLog | 5 +++ SConstruct | 2 +- src/constants.cpp | 4 +-- src/constants.hpp | 4 +-- ...disposition.cpp => contentDisposition.cpp} | 36 +++++++++---------- ...disposition.hpp => contentDisposition.hpp} | 32 ++++++++--------- src/contentDispositionField.cpp | 2 +- src/contentDispositionField.hpp | 4 +-- src/defaultAttachment.cpp | 2 +- src/htmlTextPart.cpp | 2 +- src/messageParser.cpp | 2 +- src/vmime | 2 +- 12 files changed, 51 insertions(+), 46 deletions(-) rename src/{disposition.cpp => contentDisposition.cpp} (59%) rename src/{disposition.hpp => contentDisposition.hpp} (69%) diff --git a/ChangeLog b/ChangeLog index 6220fbe3..a1c06768 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ VERSION 0.6.1-cvs ================= +2004-12-24 Vincent Richard + + * Renamed class 'disposition' to 'contentDisposition' and the enum + namespace 'dispositionTypes' to 'contentDispositionTypes'. + 2004-12-23 Vincent Richard * maildir: when connecting to the store, create root directory on the diff --git a/SConstruct b/SConstruct index e47c4f21..1ee4b4da 100644 --- a/SConstruct +++ b/SConstruct @@ -36,12 +36,12 @@ libvmime_sources = [ 'charset.cpp', 'charset.hpp', 'component.cpp', 'component.hpp', 'constants.cpp', 'constants.hpp', + 'contentDisposition.cpp', 'contentDisposition.hpp', 'contentDispositionField.cpp', 'contentDispositionField.hpp', 'contentHandler.cpp', 'contentHandler.hpp', 'contentTypeField.cpp', 'contentTypeField.hpp', 'dateTime.cpp', 'dateTime.hpp', 'defaultAttachment.cpp', 'defaultAttachment.hpp', - 'disposition.cpp', 'disposition.hpp', 'encoder.cpp', 'encoder.hpp', 'encoder7bit.cpp', 'encoder7bit.hpp', 'encoder8bit.cpp', 'encoder8bit.hpp', diff --git a/src/constants.cpp b/src/constants.cpp index f4bccee0..d59fea05 100644 --- a/src/constants.cpp +++ b/src/constants.cpp @@ -75,8 +75,8 @@ namespace encodingTypes } -// Disposition types = "RFC-2183) -namespace dispositionTypes +// Content disposition types +namespace contentDispositionTypes { const string::value_type* const INLINE = "inline"; const string::value_type* const ATTACHMENT = "attachment"; diff --git a/src/constants.hpp b/src/constants.hpp index 4e7d13c0..6dc21790 100644 --- a/src/constants.hpp +++ b/src/constants.hpp @@ -79,8 +79,8 @@ namespace vmime } - /** Constants for disposition types (RFC-2183). */ - namespace dispositionTypes + /** Constants for content disposition types (RFC-2183). */ + namespace contentDispositionTypes { extern const string::value_type* const INLINE; extern const string::value_type* const ATTACHMENT; diff --git a/src/disposition.cpp b/src/contentDisposition.cpp similarity index 59% rename from src/disposition.cpp rename to src/contentDisposition.cpp index 17dba56d..74fd42ae 100644 --- a/src/disposition.cpp +++ b/src/contentDisposition.cpp @@ -17,7 +17,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include "disposition.hpp" +#include "contentDisposition.hpp" #include "utility/stringUtils.hpp" @@ -25,25 +25,25 @@ namespace vmime { -disposition::disposition() - : m_name(dispositionTypes::INLINE) +contentDisposition::contentDisposition() + : m_name(contentDispositionTypes::INLINE) { } -disposition::disposition(const string& name) +contentDisposition::contentDisposition(const string& name) : m_name(stringUtils::toLower(name)) { } -disposition::disposition(const disposition& type) +contentDisposition::contentDisposition(const contentDisposition& type) : component(), m_name(type.m_name) { } -void disposition::parse(const string& buffer, const string::size_type position, +void contentDisposition::parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition) { m_name = stringUtils::toLower(string(buffer.begin() + position, buffer.begin() + end)); @@ -55,7 +55,7 @@ void disposition::parse(const string& buffer, const string::size_type position, } -void disposition::generate(utility::outputStream& os, const string::size_type /* maxLineLength */, +void contentDisposition::generate(utility::outputStream& os, const string::size_type /* maxLineLength */, const string::size_type curLinePos, string::size_type* newLinePos) const { os << m_name; @@ -65,59 +65,59 @@ void disposition::generate(utility::outputStream& os, const string::size_type /* } -disposition& disposition::operator=(const string& name) +contentDisposition& contentDisposition::operator=(const string& name) { m_name = stringUtils::toLower(name); return (*this); } -const bool disposition::operator==(const disposition& value) const +const bool contentDisposition::operator==(const contentDisposition& value) const { return (stringUtils::toLower(m_name) == value.m_name); } -const bool disposition::operator!=(const disposition& value) const +const bool contentDisposition::operator!=(const contentDisposition& value) const { return !(*this == value); } -disposition* disposition::clone() const +contentDisposition* contentDisposition::clone() const { - return new disposition(*this); + return new contentDisposition(*this); } -void disposition::copyFrom(const component& other) +void contentDisposition::copyFrom(const component& other) { - const disposition& d = dynamic_cast (other); + const contentDisposition& d = dynamic_cast (other); m_name = d.m_name; } -disposition& disposition::operator=(const disposition& other) +contentDisposition& contentDisposition::operator=(const contentDisposition& other) { copyFrom(other); return (*this); } -const string& disposition::getName() const +const string& contentDisposition::getName() const { return (m_name); } -void disposition::setName(const string& name) +void contentDisposition::setName(const string& name) { m_name = name; } -const std::vector disposition::getChildComponents() const +const std::vector contentDisposition::getChildComponents() const { return std::vector (); } diff --git a/src/disposition.hpp b/src/contentDisposition.hpp similarity index 69% rename from src/disposition.hpp rename to src/contentDisposition.hpp index 15ab4980..cdc036aa 100644 --- a/src/disposition.hpp +++ b/src/contentDisposition.hpp @@ -17,8 +17,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#ifndef VMIME_DISPOSITION_HPP_INCLUDED -#define VMIME_DISPOSITION_HPP_INCLUDED +#ifndef VMIME_CONTENTDISPOSITION_HPP_INCLUDED +#define VMIME_CONTENTDISPOSITION_HPP_INCLUDED #include "base.hpp" @@ -32,40 +32,40 @@ namespace vmime /** Content disposition (basic type). */ -class disposition : public component +class contentDisposition : public component { public: - disposition(); - disposition(const string& name); - disposition(const disposition& disp); + contentDisposition(); + contentDisposition(const string& name); + contentDisposition(const contentDisposition& disp); - /** Return the disposition type. + /** Return the content disposition type. * See the constants in vmime::dispositionTypes. * - * @return name of the encoding (eg. "inline") + * @return name of the disposition type (eg. "inline") */ const string& getName() const; - /** Set the disposition type. + /** Set the content disposition type. * See the constants in vmime::dispositionTypes. * - * @param name name of the encoding + * @param name name of the disposition type */ void setName(const string& name); - disposition* clone() const; + contentDisposition* clone() const; void copyFrom(const component& other); - disposition& operator=(const disposition& other); + contentDisposition& operator=(const contentDisposition& other); const std::vector getChildComponents() const; - disposition& operator=(const string& name); + contentDisposition& operator=(const string& name); - const bool operator==(const disposition& value) const; - const bool operator!=(const disposition& value) const; + const bool operator==(const contentDisposition& value) const; + const bool operator!=(const contentDisposition& value) const; private: @@ -85,4 +85,4 @@ public: } // vmime -#endif // VMIME_DISPOSITION_HPP_INCLUDED +#endif // VMIME_CONTENTDISPOSITION_HPP_INCLUDED diff --git a/src/contentDispositionField.cpp b/src/contentDispositionField.cpp index d3b3eb4a..a4a4c623 100644 --- a/src/contentDispositionField.cpp +++ b/src/contentDispositionField.cpp @@ -33,7 +33,7 @@ contentDispositionField::contentDispositionField() contentDispositionField::contentDispositionField(contentDispositionField&) - : headerField(), parameterizedHeaderField(), genericField () + : headerField(), parameterizedHeaderField(), genericField () { } diff --git a/src/contentDispositionField.hpp b/src/contentDispositionField.hpp index 38a7caa2..b896ce3e 100644 --- a/src/contentDispositionField.hpp +++ b/src/contentDispositionField.hpp @@ -24,7 +24,7 @@ #include "parameterizedHeaderField.hpp" #include "genericField.hpp" -#include "disposition.hpp" +#include "contentDisposition.hpp" #include "dateTime.hpp" @@ -32,7 +32,7 @@ namespace vmime { -class contentDispositionField : public parameterizedHeaderField, public genericField +class contentDispositionField : public parameterizedHeaderField, public genericField { friend class headerFieldFactory::registerer ; diff --git a/src/defaultAttachment.cpp b/src/defaultAttachment.cpp index db3f9ca3..48fbcdbb 100644 --- a/src/defaultAttachment.cpp +++ b/src/defaultAttachment.cpp @@ -78,7 +78,7 @@ void defaultAttachment::generatePart(bodyPart& part) const 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(disposition(dispositionTypes::ATTACHMENT)); + part.getHeader()->ContentDisposition().setValue(contentDisposition(contentDispositionTypes::ATTACHMENT)); // Set contents part.getBody()->getContents() = m_data; diff --git a/src/htmlTextPart.cpp b/src/htmlTextPart.cpp index 596d9718..fd39c78b 100644 --- a/src/htmlTextPart.cpp +++ b/src/htmlTextPart.cpp @@ -100,7 +100,7 @@ void htmlTextPart::generateIn(bodyPart& /* message */, bodyPart& parent) const objPart->getHeader()->ContentType().setValue((*it)->getType()); objPart->getHeader()->ContentId().setValue(messageId("<" + id + ">")); - objPart->getHeader()->ContentDisposition().setValue(disposition(dispositionTypes::INLINE)); + objPart->getHeader()->ContentDisposition().setValue(contentDisposition(contentDispositionTypes::INLINE)); objPart->getHeader()->ContentTransferEncoding().setValue((*it)->getEncoding()); //encoding(encodingTypes::BASE64); diff --git a/src/messageParser.cpp b/src/messageParser.cpp index d5338dc6..2834fc18 100644 --- a/src/messageParser.cpp +++ b/src/messageParser.cpp @@ -125,7 +125,7 @@ void messageParser::findAttachments(const bodyPart& part) const contentDispositionField& cdf = dynamic_cast (*hdr.findField(fields::CONTENT_DISPOSITION)); - if (cdf.getValue().getName() != dispositionTypes::INLINE) + if (cdf.getValue().getName() != contentDispositionTypes::INLINE) { contentDispField = &cdf; isAttachment = true; diff --git a/src/vmime b/src/vmime index e837093d..0c417f3a 100644 --- a/src/vmime +++ b/src/vmime @@ -37,7 +37,7 @@ #include "charset.hpp" #include "text.hpp" #include "encoding.hpp" -#include "disposition.hpp" +#include "contentDisposition.hpp" #include "mailbox.hpp" #include "mailboxGroup.hpp" #include "mailboxList.hpp"