/** Adds one byte for the length of the string, and then (up to 255 of) * the characters of the given string. */ NetworkString& NetworkString::encodeString(const std::string &value) { int len = value.size(); if(len<=255) return addUInt8(len).addString(value); else return addUInt8(255).addString(value.substr(0, 255)); } // encodeString
inline NetworkString& ai8(const uint8_t& value) { return addUInt8(value); }