X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=include%2Ffreenet%2Fmessagexml.h;h=c04e955f579d01b25eed42bcf9677ae06bb55397;hb=109c20e6f822c6efa465af31249e5608469253b6;hp=04f97e2b6041da731f59984aa4878af052520b95;hpb=6b896a9e1dc143bba86795be1e9336549db9b85f;p=fms.git diff --git a/include/freenet/messagexml.h b/include/freenet/messagexml.h index 04f97e2..c04e955 100644 --- a/include/freenet/messagexml.h +++ b/include/freenet/messagexml.h @@ -1,27 +1,36 @@ #ifndef _messagexml_ #define _messagexml_ -#include "../ifmsxmldocument.h" #include #include +#include "../ifmsxmldocument.h" + class MessageXML:public IFMSXMLDocument { public: MessageXML(); - std::string GetXML(); - const bool ParseXML(const std::string &xml); - - std::string GetDate() { return m_date; } - std::string GetTime() { return m_time; } - std::string GetSubject() { return m_subject; } - std::string GetMessageID() { return m_messageid; } - std::string GetReplyBoard() { return m_replyboard; } - std::string GetBody() { return m_body; } - std::vector GetBoards() { return m_boards; } - std::map GetInReplyTo() { return m_inreplyto; } + virtual std::string GetXML(); + virtual const bool ParseXML(const std::string &xml); + + struct fileattachment + { + fileattachment(const std::string &key, const int size):m_key(key),m_size(size) {} + std::string m_key; + int m_size; + }; + + const std::string GetDate() const { return m_date; } + const std::string GetTime() const { return m_time; } + const std::string GetSubject() const { return m_subject; } + const std::string GetMessageID() const { return m_messageid; } + const std::string GetReplyBoard() const { return m_replyboard; } + const std::string GetBody() const { return m_body; } + const std::vector GetBoards() const { return m_boards; } + const std::map GetInReplyTo() const { return m_inreplyto; } + const std::vector GetFileAttachments() const { return m_fileattachments; } void SetDate(const std::string &date) { m_date=date; } void SetTime(const std::string &time) { m_time=time; } @@ -31,8 +40,9 @@ public: void SetBody(const std::string &body) { m_body=body; } void AddBoard(const std::string &board) { m_boards.push_back(board); } void AddInReplyTo(const long index, const std::string &messageid) { m_inreplyto[index]=messageid; } + void AddFileAttachment(const std::string &key, const int size) { m_fileattachments.push_back(fileattachment(key,size)); } -private: +protected: void Initialize(); std::string m_date; @@ -42,6 +52,7 @@ private: std::vector m_boards; std::string m_replyboard; std::map m_inreplyto; + std::vector m_fileattachments; std::string m_body; };