Browse Source

bind ctags class

python
Jørgen Lien Sellæg 7 years ago committed by Jørgen Sverre Lien Sellæg
parent
commit
3879f9b0d8
  1. 29
      src/python_module.h

29
src/python_module.h

@ -2,9 +2,11 @@
#include "cmake.h" #include "cmake.h"
#include "compile_commands.h" #include "compile_commands.h"
#include "config.h" #include "config.h"
#include "ctags.h"
#include "python_bind.h" #include "python_bind.h"
#include "terminal.h" #include "terminal.h"
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <pybind11/operators.h>
#include <pybind11/stl.h> #include <pybind11/stl.h>
namespace pybind11 { namespace pybind11 {
@ -197,6 +199,33 @@ class Module {
; ;
} }
static void init_compile_ctags_module(pybind11::module &api) {
py::class_<Ctags> ctags(api, "Ctags");
py::class_<Ctags::Location>(api, "Ctags")
.def_readwrite("file_path", &Ctags::Location::file_path)
.def_readwrite("line", &Ctags::Location::line)
.def_readwrite("index", &Ctags::Location::index)
.def_readwrite("symbol", &Ctags::Location::symbol)
.def_readwrite("scope", &Ctags::Location::scope)
.def_readwrite("source", &Ctags::Location::source)
.def("__bool__", &Ctags::Location::operator bool)
;
ctags
.def_static("get_result", &Ctags::get_result,
py::arg("path"))
.def_static("get_location", &Ctags::get_location,
py::arg("line"),
py::arg("markup"))
.def_static("get_locations", &Ctags::get_locations,
py::arg("path"),
py::arg("name"),
py::arg("type"))
;
}
public: public:
static auto init_jucipp_module() { static auto init_jucipp_module() {
auto api = py::module("Jucipp", "API"); auto api = py::module("Jucipp", "API");

Loading…
Cancel
Save