diff options
| author | Vincent Richard <[email protected]> | 2005-11-04 23:21:22 +0000 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2005-11-04 23:21:22 +0000 |
| commit | acfa9ffc64f56de42049bf5049810c15477729ed (patch) | |
| tree | 3bb84a7319fb209c00f656927c83965f03bd5329 /src/attachmentHelper.cpp | |
| parent | Fixed typo for 'ac_cv_sizeof_long'. (diff) | |
| download | vmime-acfa9ffc64f56de42049bf5049810c15477729ed.tar.gz vmime-acfa9ffc64f56de42049bf5049810c15477729ed.zip | |
Refactored header field values and parameters.
Diffstat (limited to 'src/attachmentHelper.cpp')
| -rw-r--r-- | src/attachmentHelper.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/attachmentHelper.cpp b/src/attachmentHelper.cpp index 82e19f3f..9c080472 100644 --- a/src/attachmentHelper.cpp +++ b/src/attachmentHelper.cpp @@ -24,6 +24,7 @@ #include "vmime/attachmentHelper.hpp" #include "vmime/bodyPartAttachment.hpp" +#include "vmime/disposition.hpp" namespace vmime @@ -38,10 +39,13 @@ const bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part) const contentDispositionField& cdf = dynamic_cast<contentDispositionField&> (*part->getHeader()->findField(fields::CONTENT_DISPOSITION)); - if (cdf.getValue().getName() != contentDispositionTypes::INLINE) + const contentDisposition disp = *cdf.getValue() + .dynamicCast <const contentDisposition>(); + + if (disp.getName() != contentDispositionTypes::INLINE) return true; } - catch (exceptions::no_such_field) + catch (exceptions::no_such_field&) { // No "Content-disposition" field: assume "attachment" if // type is not "text/..." or "multipart/...". @@ -52,9 +56,9 @@ const bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part) const contentTypeField& ctf = dynamic_cast<contentTypeField&> (*part->getHeader()->findField(fields::CONTENT_TYPE)); - type = ctf.getValue(); + type = *ctf.getValue().dynamicCast <const mediaType>(); } - catch (exceptions::no_such_field) + catch (exceptions::no_such_field&) { // No "Content-type" field: assume "application/octet-stream". type = mediaType(mediaTypes::APPLICATION, |
