Website Summary Files Commits Branches @commit @diff @stats
path: root / Week09 / Exercise05 / String.h
diff options
context:
space:
mode:
1 files changed, 28 insertions, 0 deletions
-rw-r--r--Week09/Exercise05/String.h28
diff --git a/Week09/Exercise05/String.h b/Week09/Exercise05/String.h
new file mode 100644
index 0000000..08c7a79
--- /dev/null
+++ b/Week09/Exercise05/String.h
@@ -0,0 +1,28 @@
+#ifndef _STRING
+#define _STRING
+
+#include <ostream>
+
+class String {
+ char* str;
+ unsigned length;
+
+ void free();
+ void copyFrom(const String& other);
+
+public:
+ String();
+ ~String();
+ String(const String& other);
+ String& operator=(const String& other);
+
+ String(String&& other);
+ String& operator=(String&& other);
+
+ String(unsigned length);
+ void Copy(const char* other);
+
+ const char* GetStr() const;
+};
+
+#endif /* _STRING */