Initial implementation of StringDecoder
This commit is contained in:
13
Source/Integration/StringDecoder.cpp
Normal file
13
Source/Integration/StringDecoder.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user