version 0.3.33
[fms.git] / freenet / messagexml.h
1 #ifndef _messagexml_\r
2 #define _messagexml_\r
3 \r
4 #include <vector>\r
5 #include <map>\r
6 \r
7 #include "../ifmsxmldocument.h"\r
8 \r
9 class MessageXML:public IFMSXMLDocument\r
10 {\r
11 public:\r
12 \r
13         MessageXML();\r
14 \r
15         std::string GetXML();\r
16         const bool ParseXML(const std::string &xml);\r
17 \r
18         std::string GetDate()                                           { return m_date; }\r
19         std::string GetTime()                                           { return m_time; }\r
20         std::string GetSubject()                                        { return m_subject; }\r
21         std::string GetMessageID()                                      { return m_messageid; }\r
22         std::string GetReplyBoard()                                     { return m_replyboard; }\r
23         std::string GetBody()                                           { return m_body; }\r
24         std::vector<std::string> GetBoards()            { return m_boards; }\r
25         std::map<long,std::string> GetInReplyTo()       { return m_inreplyto; }\r
26 \r
27         void SetDate(const std::string &date)                                                           { m_date=date; }\r
28         void SetTime(const std::string &time)                                                           { m_time=time; }\r
29         void SetSubject(const std::string &subject)                                                     { m_subject=subject; }\r
30         void SetMessageID(const std::string &messageid)                                         { m_messageid=messageid; }\r
31         void SetReplyBoard(const std::string &replyboard)                                       { m_replyboard=replyboard; }\r
32         void SetBody(const std::string &body)                                                           { m_body=body; }\r
33         void AddBoard(const std::string &board)                                                         { m_boards.push_back(board); }\r
34         void AddInReplyTo(const long index, const std::string &messageid)       { m_inreplyto[index]=messageid; }\r
35 \r
36 private:\r
37         void Initialize();\r
38 \r
39         std::string m_date;\r
40         std::string m_time;\r
41         std::string m_subject;\r
42         std::string m_messageid;\r
43         std::vector<std::string> m_boards;\r
44         std::string m_replyboard;\r
45         std::map<long,std::string> m_inreplyto;\r
46         std::string m_body;\r
47 \r
48 };\r
49 \r
50 #endif  // _messagexml_\r