Website Summary Files Commits Branches @commit @diff @stats
path: root / src / String
diff options
context:
space:
mode:
2 files changed, 8 insertions, 5 deletions
-rw-r--r--src/String/String.cpp12
-rw-r--r--src/String/String.h1
diff --git a/src/String/String.cpp b/src/String/String.cpp
index 5169146..5cd8ca3 100644
--- a/src/String/String.cpp
+++ b/src/String/String.cpp
@@ -13,10 +13,6 @@ void String::copyFrom(const String& other) {
length = other.length;
}
-void String::moveFrom(String&& other) {
-
-}
-
/* Public */
String::String(const char* str) {
@@ -58,3 +54,11 @@ String& String::operator=(String&& other) {
}
return *this;
}
+
+int String::compare(const String& other) {
+ return strcmp(str, other.str);
+}
+
+char String::operator[](unsigned index) {
+ return str[index];
+}
diff --git a/src/String/String.h b/src/String/String.h
index 408e193..ebcd4c4 100644
--- a/src/String/String.h
+++ b/src/String/String.h
@@ -7,7 +7,6 @@ class String {
void free();
void copyFrom(const String& other);
- void moveFrom(String&& other);
public:
String(const char* str);