MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / deserialiseString

Function deserialiseString

src/OpenLoco/src/Objects/ObjectIndex.cpp:235–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233 }
234
235 static std::string deserialiseString(Stream& stream)
236 {
237 std::string result;
238 const auto size = stream.readValue<uint32_t>();
239 if (size > kMaxStringLength) // Arbitrary max length to prevent issues of massive allocation on bad data
240 {
241 return result;
242 }
243 result.resize(size);
244 stream.read(result.data(), result.size());
245 return result;
246 }
247
248 static ObjectIndexEntry deserialiseEntry(Stream& stream)
249 {

Callers 2

deserialiseEntryFunction · 0.85
deserialiseFolderStateFunction · 0.85

Calls 4

resizeMethod · 0.45
readMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected