More refactors in basebuffer

This commit is contained in:
2026-02-22 20:59:02 -05:00
parent bd2f927d6f
commit 5c258be507
3 changed files with 75 additions and 64 deletions

View File

@@ -3,13 +3,13 @@
#include "CoreMinimal.h"
#include "lpx-basebuffer.hpp"
class FlxStreamBufferCore {
class FlxStreamBufferConfig {
private:
bool err_eof_on_read_;
bool err_string_too_long_;
bool err_integer_truncated_;
protected:
using string_type = std::string;
void *basebuffer_malloc(size_t size) { return malloc(size); }
void basebuffer_free(void *p) { free(p); }
void clear_error_flags() { err_eof_on_read_ = err_string_too_long_ = err_integer_truncated_ = false; }
@@ -24,7 +24,7 @@ public:
bool any_error() const { return err_eof_on_read_ || err_string_too_long_ || err_integer_truncated_; }
};
class FlxStreamBuffer : public BaseBuffer<FlxStreamBufferCore, std::string> {
class FlxStreamBuffer : public BaseBuffer<FlxStreamBufferConfig> {
public:
using BaseBuffer::BaseBuffer;
using BaseBuffer::write_string;