Question: CS 5160 Programming Assignment 3 Linked Lists In this programming assignment you will implement a rudimentary line-oriented text editor. A text editor is a software

CS 5160 Programming Assignment 3 Linked Lists In this programming assignment you will implement a rudimentary line-oriented text editor. A text editor is a software application that contains a collection of commands for manipulating a sequence of buffers of text. Typically when a file is opened the lines of text are loaded into the buffers and then various combinations of keystrokes are used to trigger operations on the buffers such as delete a line, insert a new line and so forth.>The content of each node in this list is a string containing a single line of text from the data file. lineEditor Commands The line text editor class should provide public member functions that allow us to process the commands listed below. When a command requires a line number, assume the list nodes are numbered from 1 to N where the first node is 1 and the last node is N. r filename Read the contents of the file called "filename" line-by-line and store the information in the text editor object (i.e. create the linked list of lines). If lines are already stored in the editor object, delete them before creating the new list of lines. w filename Write the contents of the list to the named file. This is a nondestructive operation i.e. the list should remain the same after writing the contents to the file. i n s Insert the string s into the list after line n. For example, it the command is: i 3 Hello World you should insert a new node in the list after the 3rd node that contains the string Hello World b s Insert a new line at the beginning of list containing the string s. a s Append a new line at the end of the list containing the string s. d n1 n2 Delete all lines of text from n1 to n2 inclusive (i.e. delete the sequence of list nodes from n1 to n2). j n Join the content of line n with line n+1 (i.e. join the contents of node n and n+1 deleting the empty node). Add one whitespace character between the contents of the joined lines. l n1 n2 List the content of lines n1 to n2 inclusive on the screen. Only print the content of the line with no additional information (e.g. no line number or other initial character) y n1 n2 Yank (copy) lines n1 to n2 inclusive into a temporary buffer. Each yank operation overwrites lines already in the buffer. p n Paste the contents of the temporary buffer after line n (insert nodes into the list after the nth node). If n is zero, paste at the beginning of the list F s Find and display all lines containing the string s. N Display the number of lines in the file. Q Terminate the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!