cpp11chat/text_message.cpp

33 lines
557 B
C++

#include "text_message.h"
using namespace boost;
text_message::text_message() {}
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()
{ return _text; }
void text_message::process_data(std::string& string)
{ _text = string; }
text_message::~text_message() {}