summaryrefslogtreecommitdiff
path: root/Source/Kernel/Library/String.class.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-09-16 15:41:10 +0200
committerAlexis211 <alexis211@gmail.com>2009-09-16 15:41:10 +0200
commit5f88058644587aa255d453eee74c212e53cf9ade (patch)
tree664cadc06d75dde2618f2b3cde933f95ba898485 /Source/Kernel/Library/String.class.h
parente2e0f21d932224434cb6121165dc00f0c1bb3bdd (diff)
downloadMelon-5f88058644587aa255d453eee74c212e53cf9ade.tar.gz
Melon-5f88058644587aa255d453eee74c212e53cf9ade.zip
Added stuff to WChar and String classes.
WChar can now decode utf16 and utf32, and encode utf8 and utf32. String now has functions append(), concat(), compare() and affect() with different prototypes for char[] arrays, so that we can use it as well with utf8, utf16 and utf32.
Diffstat (limited to 'Source/Kernel/Library/String.class.h')
-rw-r--r--Source/Kernel/Library/String.class.h46
1 files changed, 30 insertions, 16 deletions
diff --git a/Source/Kernel/Library/String.class.h b/Source/Kernel/Library/String.class.h
index 01cc6a8..6a9de64 100644
--- a/Source/Kernel/Library/String.class.h
+++ b/Source/Kernel/Library/String.class.h
@@ -15,26 +15,40 @@ class String {
static String hex(u32int number);
static String number(s32int number);
- String(const char* string);
+ String(const char* string, u8int encoding = UE_UTF8);
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
+ void affect(const String &other);
+ void affect(const char* string, u8int encoding = UE_UTF8);
+ void operator= (const String &other) { affect(other); }
+ void operator= (const char* other) { affect(other); }
+
+ bool compare(const String &other) const;
+ bool compare(const char* string, u8int encoding = UE_UTF8) const;
+ bool operator== (const String &other) const { return compare(other); }
+ bool operator== (const char* other) const { return compare(other); }
+ bool operator!= (const String &other) { return !compare(other); }
+ bool operator!= (const char* other) { return !compare(other); }
+
+ String& append(const String &other);
+ String& append(const char* other, u8int encoding = UE_UTF8);
+ String& append(WChar other);
+ String &operator+= (const String &other) { return append(other); }
+ String &operator+= (const char* other) { return append(other); }
+ String &operator+= (WChar other) { return append(other); }
+
+ String concat(const String &other) const;
+ String concat(const char* other, u8int encoding = UE_UTF8) const;
+ String concat(WChar other) const;
+ String operator+ (const String &other) const { return concat(other); }
+ String operator+ (const char* other) const { return concat(other); }
+ String operator+ (WChar other) const { return concat(other); }
+
+ s32int toInt() const; //Convert from DEC
+ u32int toInt16() const; //Convert from HEX
+
WChar& operator[] (int index) const;
u32int size() const;