added a length() method for checking message length

This commit is contained in:
Kjistóf 2016-12-04 14:30:13 +01:00
parent eed5fc25d9
commit 09c2dafba5

View File

@ -36,6 +36,9 @@ namespace chat
std::string get_content() const std::string get_content() const
{ return _content; } { return _content; }
size_t length() const
{ return sizeof(char) + _content.size() + sizeof(char); }
}; };
std::ostream& operator<<(std::ostream& os, const chat_message& msg) std::ostream& operator<<(std::ostream& os, const chat_message& msg)