MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SlReadString

Function SlReadString

src/saveload/saveload.cpp:1039–1043  ·  view source on GitHub ↗

* Read the given amount of bytes from the buffer into the string. * @param str The string to write to. * @param length The amount of bytes to read into the string. * @note Does not perform any validation on validity of the string. */

Source from the content-addressed store, hash-verified

1037 * @note Does not perform any validation on validity of the string.
1038 */
1039void SlReadString(std::string &str, size_t length)
1040{
1041 str.resize(length);
1042 SlCopyBytes(str.data(), length);
1043}
1044
1045/**
1046 * Save/Load a \c std::string.

Callers 2

SlStdStringFunction · 0.85
LoadMethod · 0.85

Calls 3

SlCopyBytesFunction · 0.85
resizeMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected