Implement FlxStreamBuffer and beginnings of ConsoleCommands in unreal
This commit is contained in:
@@ -1,38 +1,2 @@
|
||||
#include "StringDecoder.h"
|
||||
|
||||
FlxStringDecoder::FlxStringDecoder(std::string_view s) {
|
||||
Text = s.data();
|
||||
Size = s.size();
|
||||
ErrBeyondEOF = false;
|
||||
ErrStringTooLong = false;
|
||||
}
|
||||
|
||||
void FlxStringDecoder::Reset(std::string_view s, bool clear) {
|
||||
Text = s.data();
|
||||
Size = s.size();
|
||||
if (clear) {
|
||||
ErrBeyondEOF = false;
|
||||
ErrStringTooLong = false;
|
||||
}
|
||||
}
|
||||
|
||||
std::string_view FlxStringDecoder::GetRest() {
|
||||
return std::string_view(Text, Size);
|
||||
}
|
||||
|
||||
std::string_view FlxStringDecoder::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;
|
||||
}
|
||||
|
||||
void FlxStringDecoder::set_at_eof() {
|
||||
Text += Size;
|
||||
Size = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user