Big f***ing cleanup part 1
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <Nazara/Lua/Config.hpp>
|
||||
#include <Nazara/Lua/Enums.hpp>
|
||||
#include <cstddef>
|
||||
#include <filesystem>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -87,7 +88,7 @@ namespace Nz
|
||||
void Error(const String& message) const;
|
||||
|
||||
bool Execute(const String& code, int errorHandler = 0);
|
||||
bool ExecuteFromFile(const String& filePath, int errorHandler = 0);
|
||||
bool ExecuteFromFile(const std::filesystem::path& filePath, int errorHandler = 0);
|
||||
bool ExecuteFromMemory(const void* data, std::size_t size, int errorHandler = 0);
|
||||
bool ExecuteFromStream(Stream& stream, int errorHandler = 0);
|
||||
|
||||
@@ -115,7 +116,7 @@ namespace Nz
|
||||
bool IsValid(int index) const;
|
||||
|
||||
bool Load(const String& code);
|
||||
bool LoadFromFile(const String& filePath);
|
||||
bool LoadFromFile(const std::filesystem::path& filePath);
|
||||
bool LoadFromMemory(const void* data, std::size_t size);
|
||||
bool LoadFromStream(Stream& stream);
|
||||
|
||||
|
||||
@@ -43,6 +43,16 @@ namespace Nz
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaState& instance, int index, std::filesystem::path* arg, TypeTag<std::filesystem::path>)
|
||||
{
|
||||
std::size_t strLength = 0;
|
||||
const char* str = instance.CheckString(index, &strLength);
|
||||
|
||||
arg->assign(std::string_view(str, strLength));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline unsigned int LuaImplQueryArg(const LuaState& instance, int index, std::string* arg, TypeTag<std::string>)
|
||||
{
|
||||
std::size_t strLength = 0;
|
||||
@@ -272,6 +282,11 @@ namespace Nz
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline int LuaImplReplyVal(const LuaState& instance, std::filesystem::path&& val, TypeTag<std::filesystem::path>)
|
||||
{
|
||||
return LuaImplReplyVal(instance, val.generic_u8string(), TypeTag<std::string>());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline int LuaImplReplyVal(const LuaState& instance, std::vector<T>&& valContainer, TypeTag<std::vector<T>>)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user