summaryrefslogtreecommitdiff
path: root/Source/Kernel/Library/String.class.h
blob: 01cc6a822f37e0f081e1cd65487acf16b8c37d7f (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef DEF_STRING_CLASS
#define DEF_STRING_CLASS

#include <Core/common.wtf.h>
#include <Library/WChar.class.h>

template <typename T> class Vector;

class String {
	private:
	WChar *m_string;
	u32int m_length;

	public:
	static String hex(u32int number);
	static String number(s32int number);

	String(const char* string);
	String();
	String(const String &other);
	~String();

	void operator= (const String &other);
	void operator= (const char* string);

	bool operator== (const String &other) const;
	bool operator== (const char* string) const;
	bool operator!= (const String &other) { return !(operator== (other)); }
	bool operator!= (const char* other) { return !(operator== (other)); }
	String &operator+= (const String &other);
	String &operator+= (const char* other);
	String &operator+= (WChar other);
	String &operator+ (const String &other) const;
	String &operator+ (const char* other) const;
	String &operator+ (WChar other) const;
	s32int toInt() const;
	u32int toInt16() const;	//From HEX
	WChar& operator[] (int index) const;

	u32int size() const;
	void clear();
	bool empty() const;

	Vector<String> split(WChar c) const;

	String substr(s32int start, s32int size);
};

#endif