Content handler constness.
This commit is contained in:
parent
bd925cef1c
commit
8de88d9e37
@ -417,7 +417,7 @@ static void connectStore()
|
||||
case 3:
|
||||
|
||||
f->fetchMessage(msg, vmime::messaging::folder::FETCH_FULL_HEADER);
|
||||
std::cout << msg->getHeader().generate() << std::endl;
|
||||
std::cout << msg->getHeader()->generate() << std::endl;
|
||||
break;
|
||||
|
||||
// Show message envelope
|
||||
@ -426,7 +426,7 @@ static void connectStore()
|
||||
f->fetchMessage(msg, vmime::messaging::folder::FETCH_ENVELOPE);
|
||||
|
||||
#define ENV_HELPER(x) \
|
||||
try { std::cout << msg->getHeader().x()->generate() << std::endl; } \
|
||||
try { std::cout << msg->getHeader()->x()->generate() << std::endl; } \
|
||||
catch (vmime::exception) { /* In case the header field does not exist. */ }
|
||||
|
||||
ENV_HELPER(From)
|
||||
|
@ -515,7 +515,7 @@ const ref <const contentHandler> body::getContents() const
|
||||
}
|
||||
|
||||
|
||||
void body::setContents(ref <contentHandler> contents)
|
||||
void body::setContents(ref <const contentHandler> contents)
|
||||
{
|
||||
m_contents = contents;
|
||||
}
|
||||
|
@ -30,14 +30,14 @@ defaultAttachment::defaultAttachment()
|
||||
}
|
||||
|
||||
|
||||
defaultAttachment::defaultAttachment(ref <contentHandler> data,
|
||||
defaultAttachment::defaultAttachment(ref <const contentHandler> data,
|
||||
const encoding& enc, const mediaType& type, const text& desc, const word& name)
|
||||
: m_type(type), m_desc(desc), m_data(data), m_encoding(enc), m_name(name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
defaultAttachment::defaultAttachment(ref <contentHandler> data,
|
||||
defaultAttachment::defaultAttachment(ref <const contentHandler> data,
|
||||
const mediaType& type, const text& desc, const word& name)
|
||||
: m_type(type), m_desc(desc), m_data(data),
|
||||
m_encoding(encoding::decide(data)), m_name(name)
|
||||
|
@ -178,7 +178,7 @@ public:
|
||||
*
|
||||
* @param contents new body contents
|
||||
*/
|
||||
void setContents(ref <contentHandler> contents);
|
||||
void setContents(ref <const contentHandler> contents);
|
||||
|
||||
/** Return the media type of the data contained in the body contents.
|
||||
* This is a shortcut for getHeader()->ContentType()->getValue()
|
||||
@ -231,7 +231,7 @@ private:
|
||||
string m_prologText;
|
||||
string m_epilogText;
|
||||
|
||||
ref <contentHandler> m_contents;
|
||||
ref <const contentHandler> m_contents;
|
||||
|
||||
weak_ref <bodyPart> m_part;
|
||||
weak_ref <header> m_header;
|
||||
|
@ -41,8 +41,8 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
defaultAttachment(ref <contentHandler> data, const encoding& enc, const mediaType& type, const text& desc = NULL_TEXT, const word& name = NULL_WORD);
|
||||
defaultAttachment(ref <contentHandler> data, const mediaType& type, const text& desc = NULL_TEXT, const word& name = NULL_WORD);
|
||||
defaultAttachment(ref <const contentHandler> data, const encoding& enc, const mediaType& type, const text& desc = NULL_TEXT, const word& name = NULL_WORD);
|
||||
defaultAttachment(ref <const contentHandler> data, const mediaType& type, const text& desc = NULL_TEXT, const word& name = NULL_WORD);
|
||||
defaultAttachment(const defaultAttachment& attach);
|
||||
|
||||
~defaultAttachment();
|
||||
@ -57,11 +57,11 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
mediaType m_type; // Media type (eg. "application/octet-stream")
|
||||
text m_desc; // Description (eg. "The image you requested")
|
||||
ref <contentHandler> m_data; // Attachment data (eg. the file contents)
|
||||
encoding m_encoding; // Encoding
|
||||
word m_name; // Name/filename (eg. "sunset.jpg")
|
||||
mediaType m_type; /**< Media type (eg. "application/octet-stream") */
|
||||
text m_desc; /**< Description (eg. "The image you requested") */
|
||||
ref <const contentHandler> m_data; /**< Attachment data (eg. the file contents) */
|
||||
encoding m_encoding; /**< Encoding */
|
||||
word m_name; /**< Name/filename (eg. "sunset.jpg") */
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user