aboutsummaryrefslogtreecommitdiff
path: root/python/include
diff options
context:
space:
mode:
Diffstat (limited to 'python/include')
-rw-r--r--python/include/trygvis/kicad/GenerateHeaderPy.h45
-rw-r--r--python/include/trygvis/kicad/python.h3
2 files changed, 48 insertions, 0 deletions
diff --git a/python/include/trygvis/kicad/GenerateHeaderPy.h b/python/include/trygvis/kicad/GenerateHeaderPy.h
new file mode 100644
index 0000000..893b7ed
--- /dev/null
+++ b/python/include/trygvis/kicad/GenerateHeaderPy.h
@@ -0,0 +1,45 @@
+#ifndef KICAD_UTILS_GENERATEHEADEPY_H
+#define KICAD_UTILS_GENERATEHEADEPY_H
+
+#include "trygvis/kicad.h"
+#include "pybind11/pybind11.h"
+#include <memory>
+#include <sstream>
+
+namespace trygvis {
+namespace kicad {
+namespace python {
+
+namespace py = pybind11;
+
+using nl = trygvis::kicad::netlist::netlist;
+
+class GenerateHeaderPy {
+public:
+ GenerateHeaderPy(const std::string &ref, nl *netlist);
+
+ virtual ~GenerateHeaderPy();
+
+ std::string ref();
+
+ nl *netlist();
+
+ std::string str();
+
+ void print(const std::string &str);
+
+ void println(const std::string &str);
+
+private:
+ std::string ref_;
+
+ nl *netlist_;
+
+ std::stringstream buf_;
+};
+
+} // namespace python
+} // namespace kicad
+} // namespace trygvis
+
+#endif
diff --git a/python/include/trygvis/kicad/python.h b/python/include/trygvis/kicad/python.h
new file mode 100644
index 0000000..f2ae816
--- /dev/null
+++ b/python/include/trygvis/kicad/python.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#include "trygvis/kicad/GenerateHeaderPy.h"