-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocument.h
44 lines (36 loc) · 1.09 KB
/
Document.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* Arbel Nathan 308366749 */
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Documents {
private:
vector<string> full;
int currentLine;
public:
Documents(): currentLine{-1}{};
// p prints the current line (ed maintains a current line)
void p();
// n prints line number of current line followed by TAB followed by current line
void n();
// %p prints all lines
void pAll();
// 7 makes line #7 the current line
void changeLine(int line);
// a appends new text after the current line
void a();
// i inserts new text before the current line
void i();
// c changes the current line for text that follows
void c();
// d deletes the current line
void d();
// /text searches forward after current line for the specified text. The search wraps to the
// beginning of the buffer and continues down to the current line, if necessary
void search(string find);
// s/old/new/ replaces old string with new in current line (google: C++ split or token)
void s(string sold, string snew);
// Q
// Quits the editor without saving
void Q();
};