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/bodyPartAttachment.cpp | |
parent | Per-protocol include files. (diff) | |
download | vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip |
Boost/C++11 shared pointers.
Diffstat (limited to 'src/bodyPartAttachment.cpp')
-rw-r--r-- | src/bodyPartAttachment.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/bodyPartAttachment.cpp b/src/bodyPartAttachment.cpp index 5ae433ad..c8361238 100644 --- a/src/bodyPartAttachment.cpp +++ b/src/bodyPartAttachment.cpp @@ -28,7 +28,7 @@ namespace vmime { -bodyPartAttachment::bodyPartAttachment(ref <const bodyPart> part) +bodyPartAttachment::bodyPartAttachment(shared_ptr <const bodyPart> part) : m_part(part) { } @@ -40,7 +40,7 @@ const mediaType bodyPartAttachment::getType() const try { - type = *getContentType()->getValue().dynamicCast <const mediaType>(); + type = *getContentType()->getValue <mediaType>(); } catch (exceptions::no_such_field&) { @@ -76,7 +76,7 @@ const word bodyPartAttachment::getName() const { try { - ref <parameter> prm = getContentType()->findParameter("name"); + shared_ptr <parameter> prm = getContentType()->findParameter("name"); if (prm != NULL) name = prm->getValue(); @@ -101,10 +101,10 @@ const text bodyPartAttachment::getDescription() const try { - ref <const headerField> cd = + shared_ptr <const headerField> cd = getHeader()->findField(fields::CONTENT_DESCRIPTION); - description = *cd->getValue().dynamicCast <const text>(); + description = *cd->getValue <text>(); } catch (exceptions::no_such_field&) { @@ -121,39 +121,37 @@ const encoding bodyPartAttachment::getEncoding() const } -const ref <const contentHandler> bodyPartAttachment::getData() const +const shared_ptr <const contentHandler> bodyPartAttachment::getData() const { return m_part->getBody()->getContents(); } -ref <const object> bodyPartAttachment::getPart() const +shared_ptr <const object> bodyPartAttachment::getPart() const { return m_part; } -ref <const header> bodyPartAttachment::getHeader() const +shared_ptr <const header> bodyPartAttachment::getHeader() const { return m_part->getHeader(); } -ref <const contentDispositionField> bodyPartAttachment::getContentDisposition() const +shared_ptr <const contentDispositionField> bodyPartAttachment::getContentDisposition() const { - return getHeader()->findField(fields::CONTENT_DISPOSITION). - dynamicCast <const contentDispositionField>(); + return getHeader()->findField <contentDispositionField>(fields::CONTENT_DISPOSITION); } -ref <const contentTypeField> bodyPartAttachment::getContentType() const +shared_ptr <const contentTypeField> bodyPartAttachment::getContentType() const { - return getHeader()->findField(fields::CONTENT_TYPE). - dynamicCast <const contentTypeField>(); + return getHeader()->findField <contentTypeField>(fields::CONTENT_TYPE); } -void bodyPartAttachment::generateIn(ref <bodyPart> /* parent */) const +void bodyPartAttachment::generateIn(shared_ptr <bodyPart> /* parent */) const { // Not used } |