From 40f7cc8f54d0c221a391457fd38a44d0633aa088 Mon Sep 17 00:00:00 2001 From: angeld55 Date: Mon, 16 May 2022 14:05:08 +0300 Subject: fixed typo in folder name --- Utils/Kindle/string.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Utils/Kindle/string.h (limited to 'Utils/Kindle/string.h') diff --git a/Utils/Kindle/string.h b/Utils/Kindle/string.h new file mode 100644 index 0000000..48742b1 --- /dev/null +++ b/Utils/Kindle/string.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include +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 -- cgit v1.3.1-23-gd82d