Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Combined use of linked-list and stack data structures in C++

NotificationsYou must be signed in to change notification settings

bersoy12/StringLinkedList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task in this project is to write a command-based text editor.

  • This text editor will print the contents of a file to the screen, page by page.
  • Each page consist of 10 lines.

Program keeps the contents of the file in certain data structures,and supports certain commands described below.

Data Structures

Features

  • Lines -string objects- are kept in alinked list structure.
  • Each line is stored in a separate node.
  • Astack utilized in order to keep track of all actions carried out so that undo actions can be done.

Commands

While program is running, it repeatedly prints the contents of thecurrent file, and asks the user what user would like do. Valid commands are:

  1. open filename: Opens the file whose name is provided inthe fieldfilename and loads each line into linked list.
open filename.txt
  1. save filename: Writes the contents of the linked list to thefile whose name is provided in thefilename field.
save filename.txt
  1. insert n text: Inserts a new line in the text at thenth line,which contains the string provided in the fieldtext ( hello my friend ).
insert 5 hello my friend
  1. delete n: Deletes the line at positionn.
delete 4
  1. move n m: Moves the line at positionn to positionm.
move 5 8
  1. replace n text: Program replaces the text inside linen with thestring provided intext.
replace 3 text
  1. next: Contents of the file does not change, but displaysthe next page.
next
  1. prev: Contents of the file does not change, but displaysthe previous page.
prev
  1. undo: Reverts the last taken action. User is able to call as manyundo commands. Careful! Undo command does not include previous save or undo actions.
undo

About

Combined use of linked-list and stack data structures in C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp