aboutsummaryrefslogtreecommitdiffstats
path: root/src/bodyPart.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-02-18 22:00:29 +0100
committerVincent Richard <[email protected]>2013-02-18 22:00:29 +0100
commite3bb8020e0b91c81047a2f1e7008dd93af78a7e0 (patch)
treecb1879cef23175646f6518b5f4f73b40f82d45fb /src/bodyPart.cpp
parentAdded helper function to replace header field. (diff)
downloadvmime-e3bb8020e0b91c81047a2f1e7008dd93af78a7e0.tar.gz
vmime-e3bb8020e0b91c81047a2f1e7008dd93af78a7e0.zip
Process header before transmitting message via SMTP.
Diffstat (limited to 'src/bodyPart.cpp')
-rw-r--r--src/bodyPart.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bodyPart.cpp b/src/bodyPart.cpp
index 009a7b8c..fbe9f1ed 100644
--- a/src/bodyPart.cpp
+++ b/src/bodyPart.cpp
@@ -121,6 +121,12 @@ ref <header> bodyPart::getHeader()
}
+void bodyPart::setHeader(ref <header> h)
+{
+ m_header = h;
+}
+
+
const ref <const body> bodyPart::getBody() const
{
return (m_body);
@@ -133,6 +139,19 @@ ref <body> bodyPart::getBody()
}
+void bodyPart::setBody(ref <body> b)
+{
+ ref <bodyPart> oldPart = b->m_part.acquire();
+
+ m_body = b;
+ m_body->setParentPart(thisRef().dynamicCast <bodyPart>());
+
+ // A body is associated to one and only one part
+ if (oldPart != NULL)
+ oldPart->setBody(vmime::create <body>());
+}
+
+
ref <bodyPart> bodyPart::getParentPart()
{
return m_parent.acquire();