aboutsummaryrefslogtreecommitdiffstats
path: root/src/bodyPart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bodyPart.cpp')
-rw-r--r--src/bodyPart.cpp53
1 files changed, 50 insertions, 3 deletions
diff --git a/src/bodyPart.cpp b/src/bodyPart.cpp
index 522a34cd..ec046ce2 100644
--- a/src/bodyPart.cpp
+++ b/src/bodyPart.cpp
@@ -25,7 +25,7 @@ namespace vmime
bodyPart::bodyPart()
- : m_body(*this), m_parent(NULL)
+ : m_body(this), m_parent(NULL)
{
}
@@ -64,12 +64,59 @@ bodyPart* bodyPart::clone() const
bodyPart* p = new bodyPart;
p->m_parent = NULL;
- p->m_header = m_header;
- p->m_body = m_body;
+
+ p->m_header.copyFrom(m_header);
+ p->m_body.copyFrom(m_body);
return (p);
}
+void bodyPart::copyFrom(const component& other)
+{
+ const bodyPart& bp = dynamic_cast <const bodyPart&>(other);
+
+ m_header = bp.m_header;
+ m_body = bp.m_body;
+}
+
+
+bodyPart& bodyPart::operator=(const bodyPart& other)
+{
+ copyFrom(other);
+ return (*this);
+}
+
+
+const header* bodyPart::getHeader() const
+{
+ return (&m_header);
+}
+
+
+header* bodyPart::getHeader()
+{
+ return (&m_header);
+}
+
+
+const body* bodyPart::getBody() const
+{
+ return (&m_body);
+}
+
+
+body* bodyPart::getBody()
+{
+ return (&m_body);
+}
+
+
+bodyPart* bodyPart::getParentPart() const
+{
+ return (m_parent);
+}
+
+
} // vmime