ultimatepp/bazaar/PyCon/PyCon.h
kohait 6dbb8ad60d bazaar: BoostPyTest: first attemt to structurize the export, more to be done, cleanup of unnessecary using namespace's
git-svn-id: svn://ultimatepp.org/upp/trunk@3360 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-04-19 15:05:45 +00:00

32 lines
897 B
C++

#ifndef _PyCon_PyCon_h_
#define _PyCon_PyCon_h_
#include <Py/Py.h>
#include <LogCtrl/LogCtrl.h>
class PyCon
{
public:
static PyObject* ToStdOut(PyObject* self, PyObject* pArgs);
static PyObject* ToStdErr(PyObject* self, PyObject* pArgs);
static void Init();
static void Enable(bool b = true);
static void Disable() { Enable(false); }
static bool IsEnabled() { return enabled; }
static void SetStream(Stream& _ps) { ps = &_ps; }
static Stream& GetStream() { return (ps)?(*ps):(StdLog()); }
static int MyPyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags, int start);
static inline int Exec(const String& c, bool single = true) { return MyPyRun_SimpleStringFlags(c, NULL, (single)?(Py_single_input):(Py_file_input)); }
static PyMethodDef m[];
static Callback AtExit;
protected:
static bool enabled;
static Stream* ps;
};
#endif