aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-10-13 18:58:33 +0000
committerVincent Richard <[email protected]>2005-10-13 18:58:33 +0000
commitb9471c9543312a7a51ce4bccb23dd02a72b07e61 (patch)
tree5f58f4d9357dea6d70306d122069b53b97df4a24
parentDon't return references. (diff)
downloadvmime-b9471c9543312a7a51ce4bccb23dd02a72b07e61.tar.gz
vmime-b9471c9543312a7a51ce4bccb23dd02a72b07e61.zip
Added getPart() and getHeader() on attachment.
-rw-r--r--src/defaultAttachment.cpp12
-rw-r--r--vmime/attachment.hpp15
-rw-r--r--vmime/defaultAttachment.hpp4
3 files changed, 31 insertions, 0 deletions
diff --git a/src/defaultAttachment.cpp b/src/defaultAttachment.cpp
index 9b1e86e1..909dca10 100644
--- a/src/defaultAttachment.cpp
+++ b/src/defaultAttachment.cpp
@@ -127,4 +127,16 @@ const encoding defaultAttachment::getEncoding() const
}
+ref <const object> defaultAttachment::getPart() const
+{
+ return NULL;
+}
+
+
+ref <const header> defaultAttachment::getHeader() const
+{
+ return NULL;
+}
+
+
} // vmime
diff --git a/vmime/attachment.hpp b/vmime/attachment.hpp
index 5787c05e..222b5fa7 100644
--- a/vmime/attachment.hpp
+++ b/vmime/attachment.hpp
@@ -86,6 +86,21 @@ public:
*/
virtual const encoding getEncoding() const = 0;
+ /** Return the part in which the attachment has been found.
+ * This can be a vmime::bodyPart or a vmime::net::part object.
+ *
+ * @return attachment part or NULL if the attachment is not
+ * attached to a part
+ */
+ virtual ref <const object> getPart() const = 0;
+
+ /** Return the header of the attachment part.
+ *
+ * @return attachment part header or NULL if the attachment
+ * is not attached to a part
+ */
+ virtual ref <const header> getHeader() const = 0;
+
protected:
/** Generate the attachment in the specified body part.
diff --git a/vmime/defaultAttachment.hpp b/vmime/defaultAttachment.hpp
index e33c2269..b4e9ce54 100644
--- a/vmime/defaultAttachment.hpp
+++ b/vmime/defaultAttachment.hpp
@@ -59,6 +59,10 @@ public:
const ref <const contentHandler> getData() const;
const encoding getEncoding() const;
+ ref <const object> getPart() const;
+
+ ref <const header> getHeader() const;
+
protected:
mediaType m_type; /**< Media type (eg. "application/octet-stream") */