stew3254 4 years ago
parent
commit
e1fd993ad0
  1. 22
      docs/design.txt
  2. 7
      docs/new_design.txt

22
docs/design.txt

@ -1,18 +1,18 @@
File Viewer
File Browser
DESIGN DOCUMENT
COMPONENT: class FileViewer
COMPONENT: class FileBrowser
A simple file viewer. See program specification for details.
A simple file browser. See program specification for details.
Public method:
o void run()
* void run()
Runs the viewer.
Runs the browser.
Implementation note: Holds the lines of text in a Buffer object. The displaying of the buffer contents and the execution of the commands is delegated to the Buffer object.
@ -21,29 +21,29 @@ Collaborator: Buffer.
COMPONENT: class Buffer
A buffer for a simple file viewer. Holds the lines of text and executes commands on them. Displays the contents of the buffer. See program specification for details on commands.
A buffer for a simple file browser. Holds the lines of text and executes commands on them. Displays the contents of the buffer. See program specification for details on commands.
Public methods:
o Buffer()
* Buffer()
(Compiler-generated.) Creates an empty buffer.
o void display() const
* void display() const
Displays the lines of text that the user is currently viewing.
o const string & file_name() const
* const string & file_name() const
Returns the name of the file.
o void move_to_next_page()
* void move_to_next_page()
void move_to_previous_page()
bool open(const string & file_name)
Executes the corresponding file viewer command on the buffer. See program specification for details. The method open returns true if successful.
o void set_window_height(int h)
* void set_window_height(int h)
Self-explanatory.

7
docs/new_design.txt

@ -0,0 +1,7 @@
* Use vectors to store links
* First element of link vector will be link 1. Then 2 and 3 and so on
* Use a stack to store the back function's history
* open_link method to open a link and push to the stack
* The go function will use this
* Buffer reads in the file, drops newlines, tabs and spaces after tags before words, processes tags and converts accordingly
* Max links function to get the number of links on a page
Loading…
Cancel
Save