added a length() method for checking message length
This commit is contained in:
parent
eed5fc25d9
commit
09c2dafba5
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user