-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPaper.h
52 lines (39 loc) · 831 Bytes
/
Paper.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
45
46
47
48
49
50
51
52
// Paper.h
#ifndef _PAPER_H
#define _PAPER_H
#include "Label.h"
#include "LinkedList.h"
class Paper
{
public:
Paper();
Paper(const Paper& source);
~Paper();
Paper& operator=(const Paper& source);
Label& operator[](int index);
Label& GetAt(int index);
int GetLength() const;
Label* GetCurrent() const;
Label* Attach(Label label);
Label Detach();
Label Detach(Label* index);
Label Erase();
Label* MoveUp();
Label* MoveDown();
Label* MoveHome();
Label* MoveEnd();
private:
LinkedList<Label> linkedList;
int length;
Label* current;
};
inline int Paper::GetLength() const
{
return this->length;
}
inline Label* Paper::GetCurrent() const
{
return const_cast<Label*>(this->current);
}
int CompareLabel(void* one, void* other);
#endif //_PAPER_H