From c9728b7e278a2a77179c57058c7185440b59fb58 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 30 Oct 2016 05:56:56 -0400 Subject: [PATCH] do_string / do_file synonyms. I have to document all this... --- sol/state_view.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sol/state_view.hpp b/sol/state_view.hpp index a6ec3290..a9dcd5d9 100644 --- a/sol/state_view.hpp +++ b/sol/state_view.hpp @@ -222,6 +222,16 @@ namespace sol { return require_core(key, [this, &filename]() {stack::script_file(L, filename); }, create_global); } + protected_function_result do_string(const std::string& code) { + sol::protected_function pf = load(code); + return pf(); + } + + protected_function_result do_file(const std::string& filename) { + sol::protected_function pf = load_file(filename); + return pf(); + } + function_result script(const std::string& code) { int index = (::std::max)(lua_gettop(L), 1); stack::script(L, code);