Website Summary Files Commits Branches @commit @diff @stats
path: root / Week05 / Exercise02 / Text.h
blob: a1366e0de8a8700b9fa6f7237d28176061005cf0 (plain) (blame)
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
#ifndef _TEXT
#define _TEXT

#include "String.h"

class Text {
	String* lines;
	unsigned lineCount;

	void free();
	void copyFrom(const Text& other);

public:
	Text();
	~Text();
	Text(const Text& other);
	Text& operator=(const Text& other);

	Text(Text&& other);
	Text& operator=(Text&& other);

	unsigned LineCount() const;
	unsigned WordCount() const;
	Text SubText(unsigned startLine, unsigned startCol, unsigned endLine, unsigned endCol) const;
};

#endif /* _TEXT */