a8/a8/pyengine.h
2018-08-26 20:34:01 +08:00

37 lines
887 B
C++

#ifndef A8_PYENGINE_H
#define A8_PYENGINE_H
namespace a8
{
struct PyEngineImpl;
class PyEngine
{
public:
std::string work_path;
PyEngine();
~PyEngine();
void Init();
void UnInit();
bool IsInitialized();
bool LoadModule(const char* module);
bool ExecString(const char* script_str);
std::string GetLastError();
std::tuple<bool, a8::XValue> CallGlobalFunc(const char* func_name,
std::initializer_list<a8::XValue> args);
std::tuple<bool, a8::XValue> CallModuleFunc(const char* module_name,
const char* func_name,
std::initializer_list<a8::XValue> args);
private:
PyEngineImpl* impl_ = nullptr;
};
}
#endif