mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
new object system
This commit is contained in:
parent
c0f0c6568b
commit
fd7a0735c9
15 changed files with 535 additions and 160 deletions
|
@ -1839,15 +1839,17 @@ inline std::string serializeString(const std::string plain)
|
|||
return s;
|
||||
}
|
||||
|
||||
// Reads a string with the length as the first two bytes
|
||||
/*// Reads a string with the length as the first two bytes
|
||||
inline std::string deSerializeString(const std::string encoded)
|
||||
{
|
||||
u16 s_size = readU16((u8*)&encoded.c_str()[0]);
|
||||
if(s_size > encoded.length() - 2)
|
||||
return "";
|
||||
std::string s;
|
||||
s.reserve(s_size);
|
||||
s.append(&encoded.c_str()[2], s_size);
|
||||
return s;
|
||||
}
|
||||
}*/
|
||||
|
||||
// Reads a string with the length as the first two bytes
|
||||
inline std::string deSerializeString(std::istream &is)
|
||||
|
@ -1878,15 +1880,17 @@ inline std::string serializeLongString(const std::string plain)
|
|||
return s;
|
||||
}
|
||||
|
||||
// Reads a string with the length as the first four bytes
|
||||
/*// Reads a string with the length as the first four bytes
|
||||
inline std::string deSerializeLongString(const std::string encoded)
|
||||
{
|
||||
u32 s_size = readU32((u8*)&encoded.c_str()[0]);
|
||||
if(s_size > encoded.length() - 4)
|
||||
return "";
|
||||
std::string s;
|
||||
s.reserve(s_size);
|
||||
s.append(&encoded.c_str()[2], s_size);
|
||||
s.append(&encoded.c_str()[4], s_size);
|
||||
return s;
|
||||
}
|
||||
}*/
|
||||
|
||||
// Reads a string with the length as the first four bytes
|
||||
inline std::string deSerializeLongString(std::istream &is)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue