From 945f7e67d6ca8047c961457786fac5e2d9a13d82 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 3 Apr 2026 18:17:51 +0300 Subject: feat(Week07): Add solutions --- Week07/Exercise01/String.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Week07/Exercise01/String.h (limited to 'Week07/Exercise01/String.h') diff --git a/Week07/Exercise01/String.h b/Week07/Exercise01/String.h new file mode 100644 index 0000000..c9cc263 --- /dev/null +++ b/Week07/Exercise01/String.h @@ -0,0 +1,33 @@ +#ifndef _STRING +#define _STRING + +class String { + char* str; + unsigned length; + unsigned allocated; + + void free(); + void copyFrom(const String& other); + + void resize(); + +public: + String(); + ~String(); + String(const String& other); + String& operator=(const String& other); + String(String&& other); + String& operator=(String&& other); + + String(const char* str); + void Clear(); + + void AppendChar(char c); + + bool EqualTo(const String& other) const; + + const char* GetStr() const; + unsigned GetLength() const; +}; + +#endif /* _STRING */ -- cgit v1.3.1-23-gd82d