aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/defaultAttachment.cpp8
-rw-r--r--vmime/attachment.hpp24
-rw-r--r--vmime/defaultAttachment.hpp8
3 files changed, 25 insertions, 15 deletions
diff --git a/src/defaultAttachment.cpp b/src/defaultAttachment.cpp
index db701b0b..9b1e86e1 100644
--- a/src/defaultAttachment.cpp
+++ b/src/defaultAttachment.cpp
@@ -97,19 +97,19 @@ void defaultAttachment::generatePart(bodyPart& part) const
}
-const mediaType& defaultAttachment::getType() const
+const mediaType defaultAttachment::getType() const
{
return (m_type);
}
-const text& defaultAttachment::getDescription() const
+const text defaultAttachment::getDescription() const
{
return (m_desc);
}
-const word& defaultAttachment::getName() const
+const word defaultAttachment::getName() const
{
return (m_name);
}
@@ -121,7 +121,7 @@ const ref <const contentHandler> defaultAttachment::getData() const
}
-const encoding& defaultAttachment::getEncoding() const
+const encoding defaultAttachment::getEncoding() const
{
return (m_encoding);
}
diff --git a/vmime/attachment.hpp b/vmime/attachment.hpp
index 066c8d75..5787c05e 100644
--- a/vmime/attachment.hpp
+++ b/vmime/attachment.hpp
@@ -55,31 +55,41 @@ public:
virtual ~attachment() { }
/** Return the media type of this attachment.
+ *
* @return content type of the attachment
*/
- virtual const mediaType& getType() const = 0;
+ virtual const mediaType getType() const = 0;
/** Return the description of this attachment.
- * @return attachment description
+ *
+ * @return attachment description, or an empty text
+ * if no description is available
*/
- virtual const text& getDescription() const = 0;
+ virtual const text getDescription() const = 0;
- /** Return the name of this attachment.
- * @return attachment name
+ /** Return the (file) name of this attachment.
+ *
+ * @return attachment name, or an empty word if no
+ * name is available
*/
- virtual const word& getName() const = 0;
+ virtual const word getName() const = 0;
/** Return the data contained in this attachment.
+ *
* @return attachment data
*/
virtual const ref <const contentHandler> getData() const = 0;
/** Return the encoding used for this attachment.
+ *
* @return attachment data encoding
*/
- virtual const encoding& getEncoding() const = 0;
+ virtual const encoding getEncoding() const = 0;
+
+protected:
/** Generate the attachment in the specified body part.
+ *
* @param parent body part in which to generate the attachment
*/
virtual void generateIn(bodyPart& parent) const = 0;
diff --git a/vmime/defaultAttachment.hpp b/vmime/defaultAttachment.hpp
index 2b048298..e33c2269 100644
--- a/vmime/defaultAttachment.hpp
+++ b/vmime/defaultAttachment.hpp
@@ -53,11 +53,11 @@ public:
defaultAttachment& operator=(const defaultAttachment& attach);
- const mediaType& getType() const;
- const text& getDescription() const;
- const word& getName() const;
+ const mediaType getType() const;
+ const text getDescription() const;
+ const word getName() const;
const ref <const contentHandler> getData() const;
- const encoding& getEncoding() const;
+ const encoding getEncoding() const;
protected: