This class represents a Message. More...
#include <Message.hpp>
Public Member Functions | |
Message () | |
Default Constructor;. | |
Message (const Message &message) | |
Copy Constructor;. | |
Message (const std::string &author, const std::string &title, const std::string &message, const MessageType &type) | |
Message Constructor. | |
Message (const std::string &author, const std::string &title, const std::string &message, const MessageType &type, const boost::posix_time::ptime &msgtime) | |
Message Constructor. | |
virtual Message & | operator= (const Message &message) |
Copy Operator. | |
const std::string & | getAuthor () const |
Get's the author of the message. | |
const std::string & | getTitle () const |
Get's the title of the message. | |
const std::string & | getMessage () const |
Get's the message of the message. | |
const MessageType & | getType () const |
Get's the type of the message. | |
const boost::posix_time::ptime & | getTime () const |
Get's the creation time of the message. | |
Static Public Member Functions | |
static std::string | convertToString (const MessageType &type) |
Converts a MessageType to the corresponding string. | |
static std::string | convertToString (const boost::posix_time::ptime &time, const std::string &format) |
Formats the boost::posix_time as specified. | |
Protected Attributes | |
std::string | author |
the author | |
std::string | title |
the title message | |
std::string | message |
the message | |
MessageType | type |
the type of the message | |
boost::posix_time::ptime | msgtime |
the creation time |
This class represents a Message.
It stores a string author, the string message, a MessageType type, and the creation time.
Tool::Message::Message | ( | ) |
Default Constructor;.
Creates a Message with an empty author, empty message, the Default MessageType and the creation time.
Tool::Message::Message | ( | const std::string & | author, | |
const std::string & | title, | |||
const std::string & | message, | |||
const MessageType & | type | |||
) |
Tool::Message::Message | ( | const std::string & | author, | |
const std::string & | title, | |||
const std::string & | message, | |||
const MessageType & | type, | |||
const boost::posix_time::ptime & | msgtime | |||
) |
std::string Tool::Message::convertToString | ( | const boost::posix_time::ptime & | time, | |
const std::string & | format | |||
) | [static] |
Formats the boost::posix_time as specified.
a | the MessageType to convert | |
format | how the time should be formated |
Reimplemented in Tool::Exception.
std::string Tool::Message::convertToString | ( | const MessageType & | type | ) | [static] |
Converts a MessageType to the corresponding string.
a | the MessageType to convert |
const std::string & Tool::Message::getAuthor | ( | ) | const |
Get's the author of the message.
const std::string & Tool::Message::getMessage | ( | ) | const |
Get's the message of the message.
const boost::posix_time::ptime & Tool::Message::getTime | ( | ) | const |
const std::string & Tool::Message::getTitle | ( | ) | const |
Get's the title of the message.
const MessageType & Tool::Message::getType | ( | ) | const |
Get's the type of the message.
Copy Operator.
Copies the data from the specified Message.