C++ NCURSES HELP implement a basic text editor, in C++ using system calls for lo
ID: 3802322 • Letter: C
Question
C++ NCURSES HELP
implement a basic text editor, in C++ using system calls for low-level file I/O and the ncurses library for the Text User Interface (TUI) using NCURSES.
• F1 Menu: If the user presses the F1 key (or fn-F1 on a Mac), then your editor needs to create a window somewhere in the terminal screen that allows the user to select from the following options:
Open: This option should prompt the user to enter in a filename. After the user presses return/enter, your editor should attempt to open the file for editing. If an unsaved file is open in the editor when the user chooses this option, then your editor needs to ask the user whether or not they want to save their changes before opening the other file.
Save: This option should attempt to save the file currently open in the editor. The mode of the file should not be changed by your editor.
Save As: This option should prompt the user to enter in a new filename and attempt to save the file currently open in the editor to that new filename. If the file already exists, then your editor should ask the user if they want to overwrite the existing file.
Exit: This option should exit your editor. If an unsaved file is open in the editor when the user chooses this option, then your editor needs to ask the user whether or not they want to save their changes before exiting.
Explanation / Answer
The Editor Class
I don’t like to put too many things in my Main.cpp file, so I put everything in other files. Create your Editor.h. It will be used to handle the keyboard inputs that we send it. It is also there to refresh the display. It will also contain a buffer.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.