diff options
| author | Jan Tuomi <jan-sebastian.tuomi@aalto.fi> | 2016-10-09 13:44:06 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan-sebastian.tuomi@aalto.fi> | 2016-10-09 14:50:24 +0300 |
| commit | 40c4dfd312b24a7e012448e39a363c07fa1e8c5d (patch) | |
| tree | 6f287e601a9f94e12d2efb0b5720db5adef650a9 /editor.h | |
| parent | 43fe02ecb4c1c99e4d942488e8982890d8c6a8d7 (diff) | |
Add writing to file
Diffstat (limited to 'editor.h')
| -rw-r--r-- | editor.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -6,20 +6,23 @@ class Editor { public: - Editor(std::vector<std::string>* contents); + Editor(std::vector<std::string>* contents, const std::string& filename); int run_editor(); private: const static int OUTPUT_LINE_MAX = 10; std::vector<std::string>* m_contents; + std::string m_filename; int m_current_line; int print_contents_on_line(int line) const; int edit_command(); int move_to_command(); + int write_command(); int edit_line(int line); int move_to_line(int line); + int write(); }; #endif |
