feat(python-eos-interface): began work on python eos interface
This commit is contained in:
23
src/python/eos/bindings.cpp
Normal file
23
src/python/eos/bindings.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h> // Needed for vectors, maps, sets, strings
|
||||
#include <pybind11/stl_bind.h> // Needed for binding std::vector, std::map etc if needed directly
|
||||
|
||||
#include <string>
|
||||
#include "helm.h"
|
||||
#include "resourceManager.h"
|
||||
#include "bindings.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
|
||||
void register_eos_bindings(pybind11::module &eos_submodule) {
|
||||
py::class_<EOSio>(const_submodule, "EOSio")
|
||||
.def(py::init<std::string>(), py::arg("filename"))
|
||||
.def("load", &EOSio::load)
|
||||
.def_readonly("getFormat", &EOSio::getFormat)
|
||||
.def_readonly("getTable", &EOSio::getTable)
|
||||
|
||||
.def("__repr__", [](const EOSio &eos) {)
|
||||
return "<EOSio(filename='" + eos.getFilename() + "', format='" + eos.getFormat() + "')>";
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user