cpp11chat/text_message.cpp

33 lines
557 B
C++
Raw Normal View History

#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) {}
std::string text_message::get_text()
{ return _text; }
std::string text_message::get_message_length()
{
auto sizetext = std::to_string(_text.size());
return std::string(sizeof(size_t) - sizetext.size(), '0').append(sizetext);
}
std::string text_message::get_message()
2016-11-19 23:18:14 +00:00
{ return _text; }
2016-11-19 23:18:14 +00:00
void text_message::process_data(std::string& string)
{ _text = string; }
2016-11-19 23:18:14 +00:00
text_message::~text_message() {}