MeshLib
 
Loading...
Searching...
No Matches
MREmbeddedPython.h
Go to the documentation of this file.
1#pragma once
2
3#include "exports.h"
4
5#include <string>
6#include <filesystem>
7
8namespace MR
9{
10
11class MRPYTHON_CLASS EmbeddedPython
12{
13public:
14 struct Config
15 {
16 bool siteImport{ true };
17 std::string home;
18 };
19 static MRPYTHON_API bool init( const Config& config );
20
21 static MRPYTHON_API bool isAvailable();
22
23 static MRPYTHON_API bool isInitialized();
24
25 static MRPYTHON_API void finalize();
26
27 static MRPYTHON_API bool setupArgv( int argc, char** argv );
28
29 static MRPYTHON_API bool runString( const std::string& pythonString );
30
31 static MRPYTHON_API bool runScript( const std::filesystem::path& path );
32
33 static MRPYTHON_API bool isPythonScript( const std::filesystem::path& path );
34private:
36 ~EmbeddedPython() = default;
37
38 static EmbeddedPython& instance_();
39 bool available_{ false };
40};
41
42} //namespace MR
Definition MREmbeddedPython.h:12
static MRPYTHON_API bool isInitialized()
static MRPYTHON_API bool isAvailable()
static MRPYTHON_API bool setupArgv(int argc, char **argv)
static MRPYTHON_API bool runScript(const std::filesystem::path &path)
static MRPYTHON_API bool init(const Config &config)
static MRPYTHON_API void finalize()
static MRPYTHON_API bool runString(const std::string &pythonString)
static MRPYTHON_API bool isPythonScript(const std::filesystem::path &path)
Definition MRCameraOrientationPlugin.h:8
Definition MREmbeddedPython.h:15
std::string home
Definition MREmbeddedPython.h:17