2016-11-19 16:25:39 +00:00
|
|
|
#include "text_message.h"
|
|
|
|
|
|
|
|
using namespace boost;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text_message::text_message() {}
|
|
|
|
|
|
|
|
|
2016-11-19 23:18:14 +00:00
|
|
|
text_message::text_message(std::string text):_text(text) {}
|
2016-11-19 16:25:39 +00:00
|
|
|
|
|
|
|
|
2016-11-19 22:52:43 +00:00
|
|
|
std::string text_message::get_text()
|
|
|
|
{ return _text; }
|
|
|
|
|
|
|
|
|
2016-11-19 16:40:00 +00:00
|
|
|
std::string text_message::get_message_length()
|
2016-11-19 16:25:39 +00:00
|
|
|
{
|
2016-11-19 22:52:43 +00:00
|
|
|
auto sizetext = std::to_string(_text.size());
|
|
|
|
return std::string(sizeof(size_t) - sizetext.size(), '0').append(sizetext);
|
2016-11-19 16:40:00 +00:00
|
|
|
}
|
2016-11-19 16:25:39 +00:00
|
|
|
|
|
|
|
|
2016-11-19 16:40:00 +00:00
|
|
|
std::string text_message::get_message()
|
2016-11-19 23:18:14 +00:00
|
|
|
{ return _text; }
|
2016-11-19 22:52:43 +00:00
|
|
|
|
|
|
|
|
2016-11-19 23:18:14 +00:00
|
|
|
void text_message::process_data(std::string& string)
|
|
|
|
{ _text = string; }
|
2016-11-19 16:25:39 +00:00
|
|
|
|
|
|
|
|
2016-11-19 23:18:14 +00:00
|
|
|
text_message::~text_message() {}
|