summaryrefslogtreecommitdiff
path: root/Source/Library/Common/String.class.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-18 15:27:34 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-18 15:27:34 +0200
commit323e12f1f9ab33df15dcfed210e807561d98fa8c (patch)
tree7d76e6932d4a979a1f2bfafc94478b66b1479bbc /Source/Library/Common/String.class.h
parentbc2eccdd11c27029096fb3e891073503eb269e27 (diff)
downloadMelon-323e12f1f9ab33df15dcfed210e807561d98fa8c.tar.gz
Melon-323e12f1f9ab33df15dcfed210e807561d98fa8c.zip
Re-organized everything
Diffstat (limited to 'Source/Library/Common/String.class.h')
-rw-r--r--Source/Library/Common/String.class.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/Source/Library/Common/String.class.h b/Source/Library/Common/String.class.h
new file mode 100644
index 0000000..3e50d35
--- /dev/null
+++ b/Source/Library/Common/String.class.h
@@ -0,0 +1,46 @@
+#ifndef DEF_STRING_CLASS
+#define DEF_STRING_CLASS
+
+#include <BasicString.class.h>
+#include <WChar.class.h>
+
+class String : public BasicString<WChar> {
+ public:
+ static String hex(u32int number);
+ static String number(s32int number);
+
+ String(const char* string, u8int encoding = UE_UTF8);
+ String() : BasicString<WChar>() {}
+ String(const String &other) : BasicString<WChar> (other) {}
+
+ void affect(const char* string, u8int encoding = UE_UTF8);
+ void operator= (const char* other) { affect(other); }
+ void operator= (const String& other) { BasicString<WChar>::affect(other); }
+
+ bool compare(const char* string, u8int encoding = UE_UTF8) const;
+ bool operator== (const char* other) const { return compare(other); }
+ bool operator!= (const char* other) { return !compare(other); }
+ bool operator== (const String& other) const { return BasicString<WChar>::compare(other); }
+ bool operator!= (const String& other) const { return !BasicString<WChar>::compare(other); }
+
+ String& append(const char* other, u8int encoding = UE_UTF8);
+ String &operator+= (const String &other) { BasicString<WChar>::append(other); return *this; }
+ String &operator+= (const char* other) { return append(other); }
+ String &operator+= (WChar other) { BasicString<WChar>::append(other); return *this; }
+
+ 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); }
+
+ s64int toInt() const; //Convert from DEC
+ u64int toInt16() const; //Convert from HEX
+
+ Vector<String> split(WChar c) const;
+
+ String substr(s32int start, u32int size);
+};
+
+#endif