Website Summary Files Commits Branches @commit @diff @stats
path: root / Week04 / Exercise03 / String.h
blob: e7d198395e3fe83eef25085652e25698e09d5c8f (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
#ifndef _STRING
#define _STRING

class String {
	char* str;
	unsigned length;

	void free();
	void copyFrom(const String& other);
public:
	String();
	~String();
	String(const String& other);
	String& operator=(const String& other);

	String(const char* str);

	unsigned GetLength();
	const char* GetStr();

	String Substring(unsigned startIndex, unsigned endIndex);
	String Concat(const String& rightHalf);
};

#endif /* _STRING */