Implement FlxStreamBuffer and beginnings of ConsoleCommands in unreal

This commit is contained in:
2023-10-24 01:44:09 -04:00
parent 9dc9d31d54
commit 5381b5708a
6 changed files with 106 additions and 219 deletions

View File

@@ -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;
}