aboutsummaryrefslogtreecommitdiff
path: root/python/GenerateHeaderPy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'python/GenerateHeaderPy.cpp')
-rw-r--r--python/GenerateHeaderPy.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/python/GenerateHeaderPy.cpp b/python/GenerateHeaderPy.cpp
new file mode 100644
index 0000000..1a039a3
--- /dev/null
+++ b/python/GenerateHeaderPy.cpp
@@ -0,0 +1,40 @@
+#include "trygvis/kicad/GenerateHeaderPy.h"
+
+namespace trygvis {
+namespace kicad {
+namespace python {
+
+using namespace std;
+
+GenerateHeaderPy::GenerateHeaderPy(const string &ref, nl *netlist) : ref_(ref), netlist_(netlist) {
+}
+
+GenerateHeaderPy::~GenerateHeaderPy() {}
+
+string GenerateHeaderPy::ref() {
+ return ref_;
+}
+
+nl *GenerateHeaderPy::netlist() {
+ if (!netlist_) {
+ throw domain_error("No current netlist");
+ }
+
+ return netlist_;
+}
+
+string GenerateHeaderPy::str() {
+ return buf_.str();
+}
+
+void GenerateHeaderPy::print(const string &str) {
+ buf_ << str;
+}
+
+void GenerateHeaderPy::println(const string &str) {
+ buf_ << str << endl;
+}
+
+} // namespace python
+} // namespace kicad
+} // namespace trygvis