Website Summary Files Commits Branches @commit @diff @stats
path: root / Utills / Kindle / string.h
diff options
context:
space:
mode:
Commit414aec98b546d11698af7fdcb441e8080da6e46a (patch)
Author
 Stoycho Kyosev <68247567+stoychoX@users.noreply.github.com>
2022-05-12 22:21:57 +0300
Committer
 GitHub <noreply@github.com>
2022-05-12 22:21:57 +0300
Filesb8747c23acce8a9c91ad3364f7bd020cc3aa204e /Utills/Kindle/string.h
Object-oriented_programming_FMI-414aec98b546d11698af7fdcb441e8080da6e46a.tar
Object-oriented_programming_FMI-414aec98b546d11698af7fdcb441e8080da6e46a.tar.gz
Object-oriented_programming_FMI-414aec98b546d11698af7fdcb441e8080da6e46a.zip
Parentfdf22bff479c48991ea769ffe3964d50678c5ffb (diff)
Add files via upload
1 files changed, 42 insertions, 0 deletions
-rw-r--r--Utills/Kindle/string.h42
diff --git a/Utills/Kindle/string.h b/Utills/Kindle/string.h
new file mode 100644
index 0000000..d5a06be
--- /dev/null
+++ b/Utills/Kindle/string.h
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <fstream>
+#include <iostream>
+class string
+{
+ char* str;
+ size_t size;
+
+ void copyFrom(const string& other);
+ void free();
+
+public:
+ string();
+ string(const char*);
+
+ string(const string&);
+
+ string(string&&); //move constructor that accepts rvalue;
+
+ string& operator=(const string& other);
+ string& operator=(string&& other); //move op= that accepts rvalue;
+
+ ~string();
+
+ size_t getSize() const;
+ void concat(const string& other);
+
+ const char* c_str() const;
+
+ string& operator+=(const string& other);
+
+ friend std::ostream& operator<<(std::ostream& stream, const string& str);
+ friend std::istream& operator>>(std::istream& stream, string& str);
+ void getLine(std::istream& out);
+};
+
+string operator+(const string& lhs, const string& rhs);
+
+bool operator==(const string& lhs, const string& rhs);
+bool operator<=(const string& lhs, const string& rhs);
+bool operator<(const string& lhs, const string& rhs); \ No newline at end of file