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