00001
00002
00003 #include <sstream>
00004
00005 #include "Message.h"
00006
00007 using namespace Yosokumo;
00008
00009
00010
00011 Message::Message() :
00012 type(Message::INFORMATION),
00013 text("")
00014 {}
00015
00016 Message::Message(Type type, const std::string &text) :
00017 type(type),
00018 text(text)
00019 {}
00020
00021
00022
00023 std::string Message::getText() const
00024 {
00025 return text;
00026 }
00027
00028 Message::Type Message::getType() const
00029 {
00030 return type;
00031 }
00032
00033 void Message::setText(const std::string &text)
00034 {
00035 this->text = text;
00036 }
00037
00038 void Message::setType(Type type)
00039 {
00040 this->type = type;
00041 }
00042
00043
00044
00045 std::string Message::toString() const
00046 {
00047 std::stringstream s;
00048
00049 s <<
00050 "Message:" << "\n" <<
00051 " type = " << getType() << "\n" <<
00052 " text = " << getText() << "\n"
00053 ;
00054
00055 return s.str();
00056 }
00057
00058