2021-11-09 17:47:51 +01:00
|
|
|
#ifndef PLATFORM_H
|
|
|
|
#define PLATFORM_H
|
|
|
|
|
|
|
|
#include "arg_parser.h"
|
|
|
|
|
2021-11-09 19:46:08 +01:00
|
|
|
#include "core/threading/mutex.h"
|
|
|
|
|
2021-11-09 17:47:51 +01:00
|
|
|
class Platform {
|
|
|
|
public:
|
|
|
|
virtual void arg_setup(int argc, char **argv, char **envp);
|
|
|
|
|
2021-11-09 19:27:43 +01:00
|
|
|
virtual String get_executable_path();
|
|
|
|
|
2021-11-09 19:46:08 +01:00
|
|
|
virtual int execute(const String &p_path, const Vector<String> &p_arguments, bool p_blocking, int64_t *r_child_id = nullptr, String *r_pipe = nullptr, int *r_exitcode = nullptr, Mutex *p_pipe_mutex = nullptr, bool read_stderr = false);
|
|
|
|
|
2021-11-09 17:47:51 +01:00
|
|
|
static Platform *get_singleton();
|
|
|
|
|
|
|
|
Platform();
|
|
|
|
virtual ~Platform();
|
|
|
|
|
|
|
|
ArgParser arg_parser;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static Platform *_self;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|