aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/AsciiRenderer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/AsciiRenderer.hpp')
-rw-r--r--src/ui/AsciiRenderer.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ui/AsciiRenderer.hpp b/src/ui/AsciiRenderer.hpp
new file mode 100644
index 0000000..76d6ff5
--- /dev/null
+++ b/src/ui/AsciiRenderer.hpp
@@ -0,0 +1,37 @@
+/*
+ * Renderer.h
+ *
+ * Created on: Nov 23, 2017
+ * Author: naopross
+ */
+
+#ifndef SRC_UI_ASCIIRENDERER_HPP_
+#define SRC_UI_ASCIIRENDERER_HPP_
+
+#include "../diagram/Structogram.hpp"
+
+namespace samb {
+
+/* Sample renderer for debug,
+ *
+ * TODO: implement PdfRenderer, UiRenderer with a common interface
+ */
+class AsciiRenderer {
+private:
+ Structogram m_structogram;
+ const unsigned int m_width;
+
+ void drawPadding(unsigned int amt);
+ void drawLine() const;
+ void drawText(std::string text, unsigned int width = 0, std::string before = "|", std::string after = "|") const;
+ void drawDecision(std::string condition, std::string trueText, std::string falseText, unsigned int width = 0) const;
+public:
+ AsciiRenderer(Structogram& structogram, unsigned int width);
+ ~AsciiRenderer();
+
+ void render();
+};
+
+} /* namespace samb */
+
+#endif /* SRC_UI_ASCIIRENDERER_HPP_ */