Initial implementation of StringDecoder

This commit is contained in:
2023-09-07 05:35:02 -04:00
parent f4f62613ca
commit 5af9741cd5
2 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#include "StringDecoder.h"
std::string_view StringDecoder::read_string_view() {
size_t length = read_length();
if (length > Size) {
ErrBeyondEOF = true;
return std::string_view();
}
std::string_view result(Text, length);
Text += length;
Size -= length;
return result;
}