2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 17:52:17 +00:00

exec/eval(): add overloads for char const*

Many times the caller may have a string created in C++,
so there is no need to wrap it in a Python object when
the only thing done with the object is extract<char*>.
This commit is contained in:
John Zwinck
2016-10-21 15:55:06 +08:00
committed by Stefan Seefeld
parent 3844c4fc5f
commit b2f53e1acf
3 changed files with 56 additions and 18 deletions

View File

@@ -20,6 +20,10 @@ object
BOOST_PYTHON_DECL
eval(str string, object global = object(), object local = object());
object
BOOST_PYTHON_DECL
eval(char const *string, object global = object(), object local = object());
// Execute an individual python statement from str.
// global and local are the global and local scopes respectively,
// used during execution.
@@ -27,6 +31,10 @@ object
BOOST_PYTHON_DECL
exec_statement(str string, object global = object(), object local = object());
object
BOOST_PYTHON_DECL
exec_statement(char const *string, object global = object(), object local = object());
// Execute python source code from str.
// global and local are the global and local scopes respectively,
// used during execution.
@@ -34,6 +42,10 @@ object
BOOST_PYTHON_DECL
exec(str string, object global = object(), object local = object());
object
BOOST_PYTHON_DECL
exec(char const *string, object global = object(), object local = object());
// Execute python source code from file filename.
// global and local are the global and local scopes respectively,
// used during execution.
@@ -41,6 +53,10 @@ object
BOOST_PYTHON_DECL
exec_file(str filename, object global = object(), object local = object());
object
BOOST_PYTHON_DECL
exec_file(char const *filename, object global = object(), object local = object());
}
}