aboutsummaryrefslogtreecommitdiffstats
path: root/editor.cpp
diff options
context:
space:
mode:
authorJan Tuomi <jan-sebastian.tuomi@aalto.fi>2016-10-09 12:56:59 +0300
committerJan Tuomi <jan-sebastian.tuomi@aalto.fi>2016-10-09 14:50:24 +0300
commit7c9146efca9b565777e1093e65272f710ae5d0d9 (patch)
tree7077241a78ee1f8d9a7044b08eb4714ad47f4020 /editor.cpp
parent88996781bd89825501ae18a1ce6e7744e767db86 (diff)
Add editor content outputting
Diffstat (limited to 'editor.cpp')
-rw-r--r--editor.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/editor.cpp b/editor.cpp
index b7ed487..9c35249 100644
--- a/editor.cpp
+++ b/editor.cpp
@@ -1,9 +1,26 @@
#include "editor.h"
+#include "utils.h"
+
+Editor::Editor(std::vector<std::string>* contents):
+ m_current_line(0) {
-Editor::Editor(std::string* contents) {
m_contents = contents;
}
int Editor::run_editor() {
+ std::vector<std::string>* c = m_contents;
+
+ bool stopped = false;
+ while (!stopped) {
+ print_contents_on_line(m_current_line);
+
+ char input = Utils::getch();
+ }
return 0;
}
+
+int Editor::print_contents_on_line(int line) const {
+ for (int i = line; i < m_contents->size(); i++) {
+ std::cout << i << " " << m_contents->at(i) << '\n';
+ }
+}