Renamed class 'disposition' to 'contentDisposition'.

This commit is contained in:
Vincent Richard 2004-12-24 12:37:52 +00:00
parent e32a8a5e1a
commit e90dbe0dd3
12 changed files with 51 additions and 46 deletions

View File

@ -2,6 +2,11 @@
VERSION 0.6.1-cvs VERSION 0.6.1-cvs
================= =================
2004-12-24 Vincent Richard <vincent@vincent-richard.net>
* Renamed class 'disposition' to 'contentDisposition' and the enum
namespace 'dispositionTypes' to 'contentDispositionTypes'.
2004-12-23 Vincent Richard <vincent@vincent-richard.net> 2004-12-23 Vincent Richard <vincent@vincent-richard.net>
* maildir: when connecting to the store, create root directory on the * maildir: when connecting to the store, create root directory on the

View File

@ -36,12 +36,12 @@ libvmime_sources = [
'charset.cpp', 'charset.hpp', 'charset.cpp', 'charset.hpp',
'component.cpp', 'component.hpp', 'component.cpp', 'component.hpp',
'constants.cpp', 'constants.hpp', 'constants.cpp', 'constants.hpp',
'contentDisposition.cpp', 'contentDisposition.hpp',
'contentDispositionField.cpp', 'contentDispositionField.hpp', 'contentDispositionField.cpp', 'contentDispositionField.hpp',
'contentHandler.cpp', 'contentHandler.hpp', 'contentHandler.cpp', 'contentHandler.hpp',
'contentTypeField.cpp', 'contentTypeField.hpp', 'contentTypeField.cpp', 'contentTypeField.hpp',
'dateTime.cpp', 'dateTime.hpp', 'dateTime.cpp', 'dateTime.hpp',
'defaultAttachment.cpp', 'defaultAttachment.hpp', 'defaultAttachment.cpp', 'defaultAttachment.hpp',
'disposition.cpp', 'disposition.hpp',
'encoder.cpp', 'encoder.hpp', 'encoder.cpp', 'encoder.hpp',
'encoder7bit.cpp', 'encoder7bit.hpp', 'encoder7bit.cpp', 'encoder7bit.hpp',
'encoder8bit.cpp', 'encoder8bit.hpp', 'encoder8bit.cpp', 'encoder8bit.hpp',

View File

@ -75,8 +75,8 @@ namespace encodingTypes
} }
// Disposition types = "RFC-2183) // Content disposition types
namespace dispositionTypes namespace contentDispositionTypes
{ {
const string::value_type* const INLINE = "inline"; const string::value_type* const INLINE = "inline";
const string::value_type* const ATTACHMENT = "attachment"; const string::value_type* const ATTACHMENT = "attachment";

View File

@ -79,8 +79,8 @@ namespace vmime
} }
/** Constants for disposition types (RFC-2183). */ /** Constants for content disposition types (RFC-2183). */
namespace dispositionTypes namespace contentDispositionTypes
{ {
extern const string::value_type* const INLINE; extern const string::value_type* const INLINE;
extern const string::value_type* const ATTACHMENT; extern const string::value_type* const ATTACHMENT;

View File

@ -17,7 +17,7 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// //
#include "disposition.hpp" #include "contentDisposition.hpp"
#include "utility/stringUtils.hpp" #include "utility/stringUtils.hpp"
@ -25,25 +25,25 @@ namespace vmime
{ {
disposition::disposition() contentDisposition::contentDisposition()
: m_name(dispositionTypes::INLINE) : m_name(contentDispositionTypes::INLINE)
{ {
} }
disposition::disposition(const string& name) contentDisposition::contentDisposition(const string& name)
: m_name(stringUtils::toLower(name)) : m_name(stringUtils::toLower(name))
{ {
} }
disposition::disposition(const disposition& type) contentDisposition::contentDisposition(const contentDisposition& type)
: component(), m_name(type.m_name) : 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) const string::size_type end, string::size_type* newPosition)
{ {
m_name = stringUtils::toLower(string(buffer.begin() + position, buffer.begin() + end)); 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 const string::size_type curLinePos, string::size_type* newLinePos) const
{ {
os << m_name; 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); m_name = stringUtils::toLower(name);
return (*this); 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); 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); 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 <const disposition&>(other); const contentDisposition& d = dynamic_cast <const contentDisposition&>(other);
m_name = d.m_name; m_name = d.m_name;
} }
disposition& disposition::operator=(const disposition& other) contentDisposition& contentDisposition::operator=(const contentDisposition& other)
{ {
copyFrom(other); copyFrom(other);
return (*this); return (*this);
} }
const string& disposition::getName() const const string& contentDisposition::getName() const
{ {
return (m_name); return (m_name);
} }
void disposition::setName(const string& name) void contentDisposition::setName(const string& name)
{ {
m_name = name; m_name = name;
} }
const std::vector <const component*> disposition::getChildComponents() const const std::vector <const component*> contentDisposition::getChildComponents() const
{ {
return std::vector <const component*>(); return std::vector <const component*>();
} }

View File

@ -17,8 +17,8 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// //
#ifndef VMIME_DISPOSITION_HPP_INCLUDED #ifndef VMIME_CONTENTDISPOSITION_HPP_INCLUDED
#define VMIME_DISPOSITION_HPP_INCLUDED #define VMIME_CONTENTDISPOSITION_HPP_INCLUDED
#include "base.hpp" #include "base.hpp"
@ -32,40 +32,40 @@ namespace vmime
/** Content disposition (basic type). /** Content disposition (basic type).
*/ */
class disposition : public component class contentDisposition : public component
{ {
public: public:
disposition(); contentDisposition();
disposition(const string& name); contentDisposition(const string& name);
disposition(const disposition& disp); contentDisposition(const contentDisposition& disp);
/** Return the disposition type. /** Return the content disposition type.
* See the constants in vmime::dispositionTypes. * 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; const string& getName() const;
/** Set the disposition type. /** Set the content disposition type.
* See the constants in vmime::dispositionTypes. * See the constants in vmime::dispositionTypes.
* *
* @param name name of the encoding * @param name name of the disposition type
*/ */
void setName(const string& name); void setName(const string& name);
disposition* clone() const; contentDisposition* clone() const;
void copyFrom(const component& other); void copyFrom(const component& other);
disposition& operator=(const disposition& other); contentDisposition& operator=(const contentDisposition& other);
const std::vector <const component*> getChildComponents() const; const std::vector <const component*> getChildComponents() const;
disposition& operator=(const string& name); contentDisposition& operator=(const string& name);
const bool operator==(const disposition& value) const; const bool operator==(const contentDisposition& value) const;
const bool operator!=(const disposition& value) const; const bool operator!=(const contentDisposition& value) const;
private: private:
@ -85,4 +85,4 @@ public:
} // vmime } // vmime
#endif // VMIME_DISPOSITION_HPP_INCLUDED #endif // VMIME_CONTENTDISPOSITION_HPP_INCLUDED

View File

@ -33,7 +33,7 @@ contentDispositionField::contentDispositionField()
contentDispositionField::contentDispositionField(contentDispositionField&) contentDispositionField::contentDispositionField(contentDispositionField&)
: headerField(), parameterizedHeaderField(), genericField <disposition>() : headerField(), parameterizedHeaderField(), genericField <contentDisposition>()
{ {
} }

View File

@ -24,7 +24,7 @@
#include "parameterizedHeaderField.hpp" #include "parameterizedHeaderField.hpp"
#include "genericField.hpp" #include "genericField.hpp"
#include "disposition.hpp" #include "contentDisposition.hpp"
#include "dateTime.hpp" #include "dateTime.hpp"
@ -32,7 +32,7 @@ namespace vmime
{ {
class contentDispositionField : public parameterizedHeaderField, public genericField <disposition> class contentDispositionField : public parameterizedHeaderField, public genericField <contentDisposition>
{ {
friend class headerFieldFactory::registerer <contentDispositionField>; friend class headerFieldFactory::registerer <contentDispositionField>;

View File

@ -78,7 +78,7 @@ void defaultAttachment::generatePart(bodyPart& part) const
part.getHeader()->ContentType().setValue(m_type); part.getHeader()->ContentType().setValue(m_type);
if (!m_desc.isEmpty()) part.getHeader()->ContentDescription().setValue(m_desc); if (!m_desc.isEmpty()) part.getHeader()->ContentDescription().setValue(m_desc);
part.getHeader()->ContentTransferEncoding().setValue(m_encoding); part.getHeader()->ContentTransferEncoding().setValue(m_encoding);
part.getHeader()->ContentDisposition().setValue(disposition(dispositionTypes::ATTACHMENT)); part.getHeader()->ContentDisposition().setValue(contentDisposition(contentDispositionTypes::ATTACHMENT));
// Set contents // Set contents
part.getBody()->getContents() = m_data; part.getBody()->getContents() = m_data;

View File

@ -100,7 +100,7 @@ void htmlTextPart::generateIn(bodyPart& /* message */, bodyPart& parent) const
objPart->getHeader()->ContentType().setValue((*it)->getType()); objPart->getHeader()->ContentType().setValue((*it)->getType());
objPart->getHeader()->ContentId().setValue(messageId("<" + id + ">")); 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()); objPart->getHeader()->ContentTransferEncoding().setValue((*it)->getEncoding());
//encoding(encodingTypes::BASE64); //encoding(encodingTypes::BASE64);

View File

@ -125,7 +125,7 @@ void messageParser::findAttachments(const bodyPart& part)
const contentDispositionField& cdf = dynamic_cast<contentDispositionField&> const contentDispositionField& cdf = dynamic_cast<contentDispositionField&>
(*hdr.findField(fields::CONTENT_DISPOSITION)); (*hdr.findField(fields::CONTENT_DISPOSITION));
if (cdf.getValue().getName() != dispositionTypes::INLINE) if (cdf.getValue().getName() != contentDispositionTypes::INLINE)
{ {
contentDispField = &cdf; contentDispField = &cdf;
isAttachment = true; isAttachment = true;

View File

@ -37,7 +37,7 @@
#include "charset.hpp" #include "charset.hpp"
#include "text.hpp" #include "text.hpp"
#include "encoding.hpp" #include "encoding.hpp"
#include "disposition.hpp" #include "contentDisposition.hpp"
#include "mailbox.hpp" #include "mailbox.hpp"
#include "mailboxGroup.hpp" #include "mailboxGroup.hpp"
#include "mailboxList.hpp" #include "mailboxList.hpp"