mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
do_string / do_file synonyms. I have to document all this...
This commit is contained in:
parent
0859af3203
commit
c9728b7e27
|
@ -222,6 +222,16 @@ namespace sol {
|
||||||
return require_core(key, [this, &filename]() {stack::script_file(L, filename); }, create_global);
|
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) {
|
function_result script(const std::string& code) {
|
||||||
int index = (::std::max)(lua_gettop(L), 1);
|
int index = (::std::max)(lua_gettop(L), 1);
|
||||||
stack::script(L, code);
|
stack::script(L, code);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user