diff options
Diffstat (limited to 'source/core')
-rw-r--r-- | source/core/StarDirectives.cpp | 5 | ||||
-rw-r--r-- | source/core/StarLua.hpp | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/source/core/StarDirectives.cpp b/source/core/StarDirectives.cpp index bf3dcc1..3381f1f 100644 --- a/source/core/StarDirectives.cpp +++ b/source/core/StarDirectives.cpp @@ -162,10 +162,7 @@ bool Directives::empty() const { return !shared || shared->empty(); } -Directives::operator bool() const { - return !empty(); -} - +Directives::operator bool() const { return !empty(); } DataStream& operator>>(DataStream& ds, Directives& directives) { String string; diff --git a/source/core/StarLua.hpp b/source/core/StarLua.hpp index 9241ec4..2c108ef 100644 --- a/source/core/StarLua.hpp +++ b/source/core/StarLua.hpp @@ -9,6 +9,7 @@ #include "StarString.hpp" #include "StarJson.hpp" #include "StarRefPtr.hpp" +#include "StarDirectives.hpp" namespace Star { @@ -826,6 +827,16 @@ struct LuaConverter<char[s]> { }; template <> +struct LuaConverter<Directives> { + static LuaValue from(LuaEngine& engine, Directives const& v) { + if (String const* ptr = v.stringPtr()) + return engine.createString(*ptr); + else + return engine.createString(""); + } +}; + +template <> struct LuaConverter<LuaString> { static LuaValue from(LuaEngine&, LuaString v) { return LuaValue(move(v)); |