root/msg/message_entity.hh

Revision 99057e4d73dbb905f06f5ccc4ea49708b8aaa0a8, 1.5 KB (checked in by Antti-Juhani Kaijanaho <antti-juhani@…>, 20 months ago)

Rework entity handling

Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>

  • Property mode set to 100644
Line 
1/*  This file is part of Alue, the multiprotocol Internet discussion daemon
2
3    Copyright © 2010 Antti-Juhani Kaijanaho
4
5    Alue is free software: you can redistribute it and/or modify it
6    under the terms of the GNU General Public License as published by
7    the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9
10    Alue is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with Alue.  If not, see <http://www.gnu.org/licenses/>.
17
18 */
19
20#ifndef GUARD_MSG_MESSAGE_ENTITY_HH
21#define GUARD_MSG_MESSAGE_ENTITY_HH
22
23#include "entity.hh"
24
25namespace msg
26{
27        class message_entity : public entity
28        {
29                entity::ptr m;
30
31        public:
32                message_entity(entity_header::ptr hdr, std::string body)
33                        : entity(hdr)
34                        , m(entity::mk(body, false))
35                        {}
36
37                entity::ptr clone() const {
38                        entity::ptr rv(new message_entity(*this));
39                        return rv;
40                }
41
42                std::string get_body() const { return m->get_entity(); }
43
44                boost::shared_ptr<tlate::value> get_tlate_value(bool) const;
45        };
46}
47
48#endif /* GUARD_MSG_MESSAGE_ENTITY_HH */
Note: See TracBrowser for help on using the browser.