00001
00007 #pragma once
00008
00009 #include <string>
00010
00011 #include <boost/date_time/posix_time/posix_time.hpp>
00012
00013 namespace Tool {
00014
00016 enum MessageType {
00017 Default,
00018 Debug,
00019 Warning,
00020 Error
00021 };
00022
00024
00027 class Message {
00028 protected:
00029 std::string author;
00030
00031 std::string title;
00032 std::string message;
00033
00034 MessageType type;
00035 boost::posix_time::ptime msgtime;
00036
00037 public:
00039
00043 static std::string convertToString(const MessageType &type);
00044
00046
00051 static std::string convertToString(const boost::posix_time::ptime &time,
00052 const std::string &format);
00053
00055
00058 Message();
00059
00061
00064 Message(const Message &message);
00065
00067
00070 Message(const std::string &author,
00071 const std::string &title,
00072 const std::string &message,
00073 const MessageType &type);
00074
00076
00079 Message(const std::string &author,
00080 const std::string &title,
00081 const std::string &message,
00082 const MessageType &type,
00083 const boost::posix_time::ptime &msgtime);
00084
00086
00089 virtual Message &operator=(const Message &message);
00090
00092
00095 const std::string &getAuthor() const;
00096
00098
00101 const std::string &getTitle() const;
00102
00104
00107 const std::string &getMessage() const;
00108
00110
00113 const MessageType &getType() const;
00114
00116
00119 const boost::posix_time::ptime &getTime() const;
00120 };
00121 }
00122