diff --git a/src/python/eos/bindings.cpp b/src/python/eos/bindings.cpp new file mode 100644 index 0000000..775f567 --- /dev/null +++ b/src/python/eos/bindings.cpp @@ -0,0 +1,23 @@ +#include +#include // Needed for vectors, maps, sets, strings +#include // Needed for binding std::vector, std::map etc if needed directly + +#include +#include "helm.h" +#include "resourceManager.h" +#include "bindings.h" + +namespace py = pybind11; + + +void register_eos_bindings(pybind11::module &eos_submodule) { + py::class_(const_submodule, "EOSio") + .def(py::init(), py::arg("filename")) + .def("load", &EOSio::load) + .def_readonly("getFormat", &EOSio::getFormat) + .def_readonly("getTable", &EOSio::getTable) + + .def("__repr__", [](const EOSio &eos) {) + return ""; + }); +} diff --git a/src/python/eos/bindings.h b/src/python/eos/bindings.h new file mode 100644 index 0000000..3945840 --- /dev/null +++ b/src/python/eos/bindings.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +void register_eos_bindings(pybind11::module &eos_submodule); diff --git a/src/python/eos/meson.build b/src/python/eos/meson.build new file mode 100644 index 0000000..a816819 --- /dev/null +++ b/src/python/eos/meson.build @@ -0,0 +1,17 @@ +# Define the library +bindings_sources = files('bindings.cpp') +bindings_headers = files('bindings.h') + +dependencies = [ + const_dep, + python3_dep, + pybind11_dep, +] + +shared_module('py_const', + bindings_sources, + include_directories: include_directories('.'), + cpp_args: ['-fvisibility=default'], + install : true, + dependencies: dependencies, +)