return *this;
}
-NetworkPacket& NetworkPacket::operator<<(std::string src)
+NetworkPacket& NetworkPacket::operator<<(const std::string &src)
{
u16 msgsize = src.size();
if (msgsize > STRING_MAX_LEN) {
return *this;
}
-void NetworkPacket::putLongString(std::string src)
+void NetworkPacket::putLongString(const std::string &src)
{
u32 msgsize = src.size();
if (msgsize > LONG_STRING_MAX_LEN) {
return *this;
}
-NetworkPacket& NetworkPacket::operator<<(std::wstring src)
+NetworkPacket& NetworkPacket::operator<<(const std::wstring &src)
{
u16 msgsize = src.size();
if (msgsize > WIDE_STRING_MAX_LEN) {
{ putRawString(src.c_str(), src.size()); }
NetworkPacket& operator>>(std::string& dst);
- NetworkPacket& operator<<(std::string src);
+ NetworkPacket& operator<<(const std::string &src);
- void putLongString(std::string src);
+ void putLongString(const std::string &src);
NetworkPacket& operator>>(std::wstring& dst);
- NetworkPacket& operator<<(std::wstring src);
+ NetworkPacket& operator<<(const std::wstring &src);
std::string readLongString();