BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: pyInterpreter.h,v 1.15.18.1 2007/03/25 21:25:21 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_PYTHON_PYINTERPRETER_H 00008 #define BALL_PYTHON_PYINTERPRETER_H 00009 00010 #ifndef BALL_COMMON_H 00011 # include <BALL/common.h> 00012 #endif 00013 00014 #ifndef BALL_DATAYPE_STRING_H 00015 # include <BALL/DATATYPE/string.h> 00016 #endif 00017 00018 #ifndef BALL_SYSTEM_PATH_H 00019 # include <BALL/SYSTEM/path.h> 00020 #endif 00021 00022 #include <vector> 00023 00024 namespace BALL 00025 { 00032 class BALL_EXPORT PyInterpreter 00033 { 00034 private: 00035 // We don't want anybody to instantiate this! 00036 PyInterpreter(); 00037 ~PyInterpreter() {} 00038 00039 public: 00042 00043 typedef std::vector<String> PathStrings; 00045 00048 00057 static void initialize(); 00058 00063 static void finalize(); 00064 00068 static bool isInitialized(); 00069 00071 static void setSysPath(const PathStrings& path_strings); 00072 00074 static const PathStrings& getSysPath(); 00075 00077 static bool isValid() { return valid_;} 00078 00080 static String getStartupLog() { return start_log_;} 00081 00083 00084 00092 static String run(const String& s, bool& result); 00093 00097 static String runFile(const String& filename) 00098 throw(Exception::FileNotFound); 00099 00106 static bool importModule(const String& module_name); 00108 protected: 00109 static PathStrings sys_path_; 00110 static bool valid_; 00111 static String start_log_; 00112 }; 00113 00114 } // namespace BALL 00115 00116 #endif // BALL_PYTHON_PYINTERPRETER_H