diff options
author | Vincent Richard <[email protected]> | 2013-11-21 21:16:57 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-11-21 21:16:57 +0000 |
commit | f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 (patch) | |
tree | 2bdc90e361a8f6e0a81164cf67afec9f78f9b959 /src/mdn/receivedMDNInfos.cpp | |
parent | Per-protocol include files. (diff) | |
download | vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip |
Boost/C++11 shared pointers.
Diffstat (limited to 'src/mdn/receivedMDNInfos.cpp')
-rw-r--r-- | src/mdn/receivedMDNInfos.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mdn/receivedMDNInfos.cpp b/src/mdn/receivedMDNInfos.cpp index 876ba3d9..1c523be7 100644 --- a/src/mdn/receivedMDNInfos.cpp +++ b/src/mdn/receivedMDNInfos.cpp @@ -30,7 +30,7 @@ namespace vmime { namespace mdn { -receivedMDNInfos::receivedMDNInfos(const ref <const message> msg) +receivedMDNInfos::receivedMDNInfos(const shared_ptr <const message> msg) : m_msg(msg) { extract(); @@ -51,7 +51,7 @@ receivedMDNInfos& receivedMDNInfos::operator=(const receivedMDNInfos& other) } -const ref <const message> receivedMDNInfos::getMessage() const +const shared_ptr <const message> receivedMDNInfos::getMessage() const { return (m_msg); } @@ -86,17 +86,16 @@ void receivedMDNInfos::copyFrom(const receivedMDNInfos& other) void receivedMDNInfos::extract() { - const ref <const body> bdy = m_msg->getBody(); + const shared_ptr <const body> bdy = m_msg->getBody(); for (size_t i = 0 ; i < bdy->getPartCount() ; ++i) { - const ref <const bodyPart> part = bdy->getPartAt(i); + const shared_ptr <const bodyPart> part = bdy->getPartAt(i); if (!part->getHeader()->hasField(fields::CONTENT_TYPE)) continue; - const mediaType& type = *part->getHeader()->ContentType()-> - getValue().dynamicCast <const mediaType>(); + const mediaType& type = *part->getHeader()->ContentType()->getValue <mediaType>(); // Extract from second part (message/disposition-notification) if (type.getType() == vmime::mediaTypes::MESSAGE && @@ -111,15 +110,15 @@ void receivedMDNInfos::extract() header fields; fields.parse(oss.str()); - try { m_omid = *fields.OriginalMessageId()->getValue().dynamicCast <const messageId>(); } + try { m_omid = *fields.OriginalMessageId()->getValue <messageId>(); } catch (exceptions::no_such_field&) { /* Ignore */ } - try { m_disp = *fields.Disposition()->getValue().dynamicCast <const disposition>(); } + try { m_disp = *fields.Disposition()->getValue <disposition>(); } catch (exceptions::no_such_field&) { /* Ignore */ } try { - text t = *fields.findField("Received-content-MIC")->getValue().dynamicCast <const text>(); + text t = *fields.findField("Received-content-MIC")->getValue <text>(); m_contentMIC = t.generate(); } catch (exceptions::no_such_field&) { /* Ignore */ } |