mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
(se)SerializeString: Include max length in the name
This commit clarifies the maximal length of the serialized strings. It will avoid accidental use of serializeString() when a larger string can be expected. Removes unused Wide String serialization functions
This commit is contained in:
parent
ca5c2dbefa
commit
947466ab28
23 changed files with 168 additions and 223 deletions
|
@ -440,16 +440,16 @@ MAKE_STREAM_WRITE_FXN(video::SColor, ARGB8, 4);
|
|||
////
|
||||
|
||||
// Creates a string with the length as the first two bytes
|
||||
std::string serializeString(const std::string &plain);
|
||||
std::string serializeString16(const std::string &plain);
|
||||
|
||||
// Reads a string with the length as the first two bytes
|
||||
std::string deSerializeString(std::istream &is);
|
||||
std::string deSerializeString16(std::istream &is);
|
||||
|
||||
// Creates a string with the length as the first four bytes
|
||||
std::string serializeLongString(const std::string &plain);
|
||||
std::string serializeString32(const std::string &plain);
|
||||
|
||||
// Reads a string with the length as the first four bytes
|
||||
std::string deSerializeLongString(std::istream &is);
|
||||
std::string deSerializeString32(std::istream &is);
|
||||
|
||||
// Creates a string encoded in JSON format (almost equivalent to a C string literal)
|
||||
std::string serializeJsonString(const std::string &plain);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue