diff --git a/deps/first/JSON/include/JSON/String.hpp b/deps/first/JSON/include/JSON/String.hpp index da6dc0716..d45ab7b2b 100644 --- a/deps/first/JSON/include/JSON/String.hpp +++ b/deps/first/JSON/include/JSON/String.hpp @@ -32,8 +32,8 @@ namespace RC::JSON } public: - RC_JSON_API JSON_DEPRECATED auto serialize(ShouldFormat should_format = ShouldFormat::No, int32_t* indent_level = nullptr) -> StringType override; - RC_JSON_API JSON_DEPRECATED auto get_type() const -> Type override + JSON_DEPRECATED RC_JSON_API auto serialize(ShouldFormat should_format = ShouldFormat::No, int32_t* indent_level = nullptr) -> StringType override; + JSON_DEPRECATED RC_JSON_API auto get_type() const -> Type override { return Type::String; } diff --git a/deps/first/LuaMadeSimple/include/LuaMadeSimple/LuaMadeSimple.hpp b/deps/first/LuaMadeSimple/include/LuaMadeSimple/LuaMadeSimple.hpp index dabb37263..8295b86c5 100644 --- a/deps/first/LuaMadeSimple/include/LuaMadeSimple/LuaMadeSimple.hpp +++ b/deps/first/LuaMadeSimple/include/LuaMadeSimple/LuaMadeSimple.hpp @@ -32,55 +32,22 @@ namespace RC::LuaMadeSimple { const class Lua* lua{}; - [[nodiscard]] auto is_nil() -> bool - { - return lua_isnil(lua->get_lua_state(), StackIndex); - } + [[nodiscard]] auto is_nil() -> bool; - [[nodiscard]] auto is_string() const -> bool - { - return lua_type(lua->get_lua_state(), StackIndex) == LUA_TSTRING; - } - [[nodiscard]] auto get_string() const -> std::string_view - { - return lua_tostring(lua->get_lua_state(), StackIndex); - } + [[nodiscard]] auto is_string() const -> bool; + [[nodiscard]] auto get_string() const -> std::string_view; - [[nodiscard]] auto is_number() const -> bool - { - return lua_isnumber(lua->get_lua_state(), StackIndex); - } - [[nodiscard]] auto get_number() const -> double - { - return lua_tonumber(lua->get_lua_state(), StackIndex); - } - [[nodiscard]] auto get_float(int32_t force_index = 1) -> float // Safe to use after a call to is_number - { - return static_cast(lua_tonumber(lua->get_lua_state(), force_index)); - } + [[nodiscard]] auto is_number() const -> bool; + [[nodiscard]] auto get_number() const -> double; + [[nodiscard]] auto get_float(int32_t force_index = 1) -> float; // Safe to use after a call to is_number - [[nodiscard]] auto is_integer() const -> bool - { - return lua_isinteger(lua->get_lua_state(), StackIndex); - } - [[nodiscard]] auto get_integer() const -> int64_t - { - return lua_tointeger(lua->get_lua_state(), StackIndex); - } + [[nodiscard]] auto is_integer() const -> bool; + [[nodiscard]] auto get_integer() const -> int64_t; - [[nodiscard]] auto is_bool() const -> bool - { - return lua_isboolean(lua->get_lua_state(), StackIndex); - } - [[nodiscard]] auto get_bool() const -> bool - { - return lua_toboolean(lua->get_lua_state(), StackIndex); - } + [[nodiscard]] auto is_bool() const -> bool; + [[nodiscard]] auto get_bool() const -> bool; - [[nodiscard]] auto is_table() const -> bool - { - return lua_istable(lua->get_lua_state(), StackIndex); - } + [[nodiscard]] auto is_table() const -> bool; }; /** diff --git a/deps/first/LuaMadeSimple/src/LuaMadeSimple.cpp b/deps/first/LuaMadeSimple/src/LuaMadeSimple.cpp index 7f4675a3a..131bdeb20 100644 --- a/deps/first/LuaMadeSimple/src/LuaMadeSimple.cpp +++ b/deps/first/LuaMadeSimple/src/LuaMadeSimple.cpp @@ -16,6 +16,118 @@ namespace RC::LuaMadeSimple // Current errors for all lua states static std::unordered_map lua_state_errors; + template <> + auto LuaTableData<-1>::is_nil() -> bool + { + return lua_isnil(lua->get_lua_state(), -1); + } + template <> + auto LuaTableData<-1>::is_string() const -> bool + { + return lua_type(lua->get_lua_state(), -1) == LUA_TSTRING; + } + template <> + auto LuaTableData<-1>::get_string() const -> std::string_view + { + return lua_tostring(lua->get_lua_state(), -1); + } + template <> + auto LuaTableData<-1>::is_number() const -> bool + { + return lua_isnumber(lua->get_lua_state(), -1); + } + template <> + auto LuaTableData<-1>::get_number() const -> double + { + return lua_tonumber(lua->get_lua_state(), -1); + } + template <> + auto LuaTableData<-1>::get_float(int32_t force_index) -> float // Safe to use after a call to is_number + { + return static_cast(lua_tonumber(lua->get_lua_state(), force_index)); + } + template <> + auto LuaTableData<-1>::is_integer() const -> bool + { + return lua_isinteger(lua->get_lua_state(), -1); + } + template <> + auto LuaTableData<-1>::get_integer() const -> int64_t + { + return lua_tointeger(lua->get_lua_state(), -1); + } + template <> + auto LuaTableData<-1>::is_bool() const -> bool + { + return lua_isboolean(lua->get_lua_state(), -1); + } + template <> + auto LuaTableData<-1>::get_bool() const -> bool + { + return lua_toboolean(lua->get_lua_state(), -1); + } + template <> + auto LuaTableData<-1>::is_table() const -> bool + { + return lua_istable(lua->get_lua_state(), -1); + } + + template <> + auto LuaTableData<-2>::is_nil() -> bool + { + return lua_isnil(lua->get_lua_state(), -2); + } + template <> + auto LuaTableData<-2>::is_string() const -> bool + { + return lua_type(lua->get_lua_state(), -2) == LUA_TSTRING; + } + template <> + auto LuaTableData<-2>::get_string() const -> std::string_view + { + return lua_tostring(lua->get_lua_state(), -2); + } + template <> + auto LuaTableData<-2>::is_number() const -> bool + { + return lua_isnumber(lua->get_lua_state(), -2); + } + template <> + auto LuaTableData<-2>::get_number() const -> double + { + return lua_tonumber(lua->get_lua_state(), -2); + } + template <> + auto LuaTableData<-2>::get_float(int32_t force_index) -> float // Safe to use after a call to is_number + { + return static_cast(lua_tonumber(lua->get_lua_state(), force_index)); + } + template <> + auto LuaTableData<-2>::is_integer() const -> bool + { + return lua_isinteger(lua->get_lua_state(), -2); + } + template <> + auto LuaTableData<-2>::get_integer() const -> int64_t + { + return lua_tointeger(lua->get_lua_state(), -2); + } + template <> + auto LuaTableData<-2>::is_bool() const -> bool + { + return lua_isboolean(lua->get_lua_state(), -2); + } + template <> + auto LuaTableData<-2>::get_bool() const -> bool + { + return lua_toboolean(lua->get_lua_state(), -2); + } + template <> + auto LuaTableData<-2>::is_table() const -> bool + { + return lua_istable(lua->get_lua_state(), -2); + } + Lua::Lua(lua_State* lua_state) : m_lua_state(lua_state), m_registry(*this) { } diff --git a/deps/first/Unreal b/deps/first/Unreal index 209e0cad3..57bd800c0 160000 --- a/deps/first/Unreal +++ b/deps/first/Unreal @@ -1 +1 @@ -Subproject commit 209e0cad3716e4cbd4d7ae49c7f92cf41f35aad9 +Subproject commit 57bd800c0623e3392761489dccf22d83fb1aac07