summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/Kernel/Library/BasicString.class.h5
-rw-r--r--Source/Kernel/Library/String.class.cpp19
-rw-r--r--Source/Kernel/Library/String.class.h20
-rwxr-xr-xSource/Kernel/Melon.kebin160815 -> 160747 bytes
4 files changed, 10 insertions, 34 deletions
diff --git a/Source/Kernel/Library/BasicString.class.h b/Source/Kernel/Library/BasicString.class.h
index a4d56c7..f2c03a7 100644
--- a/Source/Kernel/Library/BasicString.class.h
+++ b/Source/Kernel/Library/BasicString.class.h
@@ -21,13 +21,18 @@ class BasicString {
void affect(const BasicString<T> &other);
void affect(const T* string, u32int length);
void affect(const T value, u32int count = 1);
+ void operator= (const BasicString<T> &other) { affect(other); }
bool compare(const BasicString<T> &other) const;
bool compare(const T* string, u32int length) const;
+ bool operator== (const BasicString<T> &other) const { return compare(other); }
+ bool operator!= (const BasicString<T> &other) const { return !compare(other); }
BasicString<T>& append(const BasicString<T> &other);
BasicString<T>& append(const T* string, u32int length);
BasicString<T>& append(const T other);
+ String& operator+= (const BasicString<T> &other) { return append(other); }
+ String& operator+= (const T other) { return append(other); }
BasicString<T> concat(const BasicString<T> &other) const;
BasicString<T> concat(const T* string, u32int length) const;
diff --git a/Source/Kernel/Library/String.class.cpp b/Source/Kernel/Library/String.class.cpp
index e43953f..4e72540 100644
--- a/Source/Kernel/Library/String.class.cpp
+++ b/Source/Kernel/Library/String.class.cpp
@@ -117,7 +117,6 @@ String& String::append (const char* other, u8int encoding) {
m_string[m_length] = 0;
return *this;
}
-
String String::concat (const String &other) const { //Can be optimized
String ret(*this);
return (ret += other);
@@ -175,24 +174,6 @@ u64int String::toInt16() const {
return number;
}
-WChar& String::operator[] (int index) const {
- return m_string[index];
-}
-
-u32int String::size() const {
- return m_length;
-}
-
-void String::clear() {
- delete [] m_string;
- m_length = 0;
- m_string = 0;
-}
-
-bool String::empty() const {
- return (m_length == 0);
-}
-
Vector<String> String::split(WChar c) const {
Vector<String> ret;
ret.push(String(""));
diff --git a/Source/Kernel/Library/String.class.h b/Source/Kernel/Library/String.class.h
index ad1524d..a10ba7a 100644
--- a/Source/Kernel/Library/String.class.h
+++ b/Source/Kernel/Library/String.class.h
@@ -15,24 +15,20 @@ class String : public BasicString<WChar> {
String(const String &other);
virtual ~String();
- void affect(const String &other) { BasicString<WChar>::affect(other); }
void affect(const char* string, u8int encoding = UE_UTF8);
- void operator= (const String &other) { affect(other); }
void operator= (const char* other) { affect(other); }
+ void operator= (const String& other) { BasicString<WChar>::affect(other); }
- bool compare(const String &other) const { return BasicString<WChar>::compare(other); }
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); }
+ 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 String &other) { BasicString<WChar>::append(other); return *this; }
String& append(const char* other, u8int encoding = UE_UTF8);
- String& append(WChar other) { BasicString<WChar>::append(other); return *this; }
- String &operator+= (const String &other) { return append(other); }
+ String &operator+= (const String &other) { BasicString<WChar>::append(other); return *this; }
String &operator+= (const char* other) { return append(other); }
- String &operator+= (WChar 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;
@@ -44,12 +40,6 @@ class String : public BasicString<WChar> {
s64int toInt() const; //Convert from DEC
u64int toInt16() const; //Convert 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, u32int size);
diff --git a/Source/Kernel/Melon.ke b/Source/Kernel/Melon.ke
index 9f88bf0..aaecba6 100755
--- a/Source/Kernel/Melon.ke
+++ b/Source/Kernel/Melon.ke
Binary files differ