-
Notifications
You must be signed in to change notification settings - Fork 1
/
Label.h
57 lines (44 loc) · 937 Bytes
/
Label.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
53
54
55
56
57
// Label.h
#ifndef _LABEL_H
#define _LABEL_H
#include "String.h"
class Label {
public:
Label();
Label(int capacity);
Label(const Label& source);
~Label();
Label& operator=(const Label& source);
char& operator[](int index);
char& GetAt(int index);
operator char*();
int GetLength() const;
int GetCapacity() const;
int GetCurrent() const;
int Write(char ch);
int Write(char* pstr);
int Store(char* pstr);
int Erase(int index, int count);
int MoveLeft();
int MoveRight();
int MoveHome();
int MoveEnd();
int Move(int index);
char* Copy();
char* Copy(int first, int count);
private:
String str;
int length;
int capacity;
int current;
};
inline int Label::GetLength() const {
return this->length;
}
inline int Label::GetCapacity() const {
return this->capacity;
}
inline int Label::GetCurrent() const {
return this->current;
}
#endif //_LABEL_H