From 40c4dfd312b24a7e012448e39a363c07fa1e8c5d Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 9 Oct 2016 13:44:06 +0300 Subject: Add writing to file --- editor.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'editor.h') diff --git a/editor.h b/editor.h index 1ae2a51..9d2a773 100644 --- a/editor.h +++ b/editor.h @@ -6,20 +6,23 @@ class Editor { public: - Editor(std::vector* contents); + Editor(std::vector* contents, const std::string& filename); int run_editor(); private: const static int OUTPUT_LINE_MAX = 10; std::vector* 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 -- cgit v1.3