2020-12-01 02:21:40 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <string_view>
|
|
|
|
|
2022-03-04 11:36:37 +01:00
|
|
|
#include <hex/helpers/fs.hpp>
|
2022-01-16 01:51:31 +01:00
|
|
|
|
2020-12-01 02:21:40 +01:00
|
|
|
struct _object;
|
|
|
|
typedef struct _object PyObject;
|
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
namespace prv {
|
|
|
|
class Provider;
|
|
|
|
}
|
2020-12-01 02:21:40 +01:00
|
|
|
|
|
|
|
class LoaderScript {
|
|
|
|
public:
|
|
|
|
LoaderScript() = delete;
|
|
|
|
|
2022-03-04 11:36:37 +01:00
|
|
|
static bool processFile(const std::fs::path &scriptPath);
|
2020-12-01 02:21:40 +01:00
|
|
|
|
2022-03-04 11:36:37 +01:00
|
|
|
static void setFilePath(const std::fs::path &filePath) { LoaderScript::s_filePath = filePath; }
|
2022-01-24 20:53:17 +01:00
|
|
|
static void setDataProvider(prv::Provider *provider) { LoaderScript::s_dataProvider = provider; }
|
|
|
|
|
2020-12-01 02:21:40 +01:00
|
|
|
private:
|
2022-03-04 11:36:37 +01:00
|
|
|
static inline std::fs::path s_filePath;
|
2022-01-24 20:53:17 +01:00
|
|
|
static inline prv::Provider *s_dataProvider;
|
2020-12-01 02:21:40 +01:00
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
static PyObject *Py_getFilePath(PyObject *self, PyObject *args);
|
|
|
|
static PyObject *Py_addPatch(PyObject *self, PyObject *args);
|
|
|
|
static PyObject *Py_addBookmark(PyObject *self, PyObject *args);
|
2020-12-01 16:41:38 +01:00
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
static PyObject *Py_addStruct(PyObject *self, PyObject *args);
|
|
|
|
static PyObject *Py_addUnion(PyObject *self, PyObject *args);
|
2020-12-01 02:21:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|