/[debian]/mimetic/branches/upstream/current/mimetic/body.cxx
ViewVC logotype

Contents of /mimetic/branches/upstream/current/mimetic/body.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 128 - (show annotations)
Sat Feb 25 16:49:20 2006 UTC (15 years, 5 months ago) by gregoa
File size: 2006 byte(s)
[svn-inject] Installing original source of mimetic
1 /***************************************************************************
2 copyright : (C) 2002-2005 by Stefano Barbato
3 email : stefano@codesink.org
4
5 $Id: body.cxx,v 1.2 2005/02/23 10:26:14 tat Exp $
6 ***************************************************************************/
7
8 /***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16 #include <mimetic/mimeentity.h>
17 #include <mimetic/body.h>
18
19 namespace mimetic
20 {
21 using std::string;
22
23 Body::Body()
24 : m_owner(0)
25 {
26 }
27
28 void Body::set(const std::string& text)
29 {
30 this->assign(text);
31 }
32
33 void Body::owner(MimeEntity* owner)
34 {
35 m_owner = owner;
36 }
37
38 MimeEntity* Body::owner()
39 {
40 return m_owner;
41 }
42
43 const MimeEntity* Body::owner() const
44 {
45 return m_owner;
46 }
47
48 bool Body::load(const string& fqn)
49 {
50 File in(fqn);
51 if(!in)
52 return false;
53 File::iterator beg = in.begin(), end = in.end();
54 std::copy(beg, end, back_inserter(*this) );
55 return true;
56 }
57
58 MimeEntityList& Body::parts()
59 {
60 return m_parts;
61 }
62
63 const MimeEntityList& Body::parts() const
64 {
65 return m_parts;
66 }
67
68 void Body::preamble(const string& v)
69 {
70 m_preamble = v;
71 }
72
73 const string& Body::preamble() const
74 {
75 return m_preamble;
76 }
77
78 string& Body::preamble()
79 {
80 return m_preamble;
81 }
82
83 void Body::epilogue(const string& v)
84 {
85 m_epilogue = v;
86 }
87
88 const string& Body::epilogue() const
89 {
90 return m_epilogue;
91 }
92
93 string& Body::epilogue()
94 {
95 return m_epilogue;
96 }
97
98 }
99

  ViewVC Help
Powered by ViewVC 1.1.26