Removing lua_reader and lua_writer from StreamBuffer

This commit is contained in:
2023-10-18 14:03:05 -04:00
parent b4c2d21aee
commit 67b0265092
5 changed files with 56 additions and 61 deletions

View File

@@ -724,6 +724,24 @@ public:
lua_State *state() const { return L_; }
};
////////////////////////////////////////////////////////////////////
//
// Lua Byte Reader
//
// Converts a block of bytes in RAM into a lua_reader.
//
////////////////////////////////////////////////////////////////////
class LuaByteReader {
private:
const char *data_;
int64_t size_;
public:
LuaByteReader(const char *d, int64_t s) : data_(d), size_(s) {}
void *lua_reader_userdata() { return this; }
static const char *lua_reader(lua_State *L, void *ud, size_t *size);
};
////////////////////////////////////////////////////////////////////
//
// The Lua Constant Registry