Read a string of bytes until the given terminator character is seen.
Declared in <folly/io/Cursor.h>
std::string
readTerminatedString(
char termChar = '\0',
size_t maxLength = std::numeric_limits<size_t>::max());
methodset Consumers
Raises an std::length_error if maxLength bytes have been processed before the terminator is seen.
See comments in readFixedString() about when it's appropriate to use this vs. using pull().
The bytes read, up to but excluding the terminator.
| Name | Description |
|---|---|
| termChar | The byte that terminates the string. |
| maxLength | The maximum number of bytes to read. |