Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 09 / StringPool / StringPool.h
diff options
context:
space:
mode:
Commit086675f2e8b421f811ffc0ea140dc1b4f2b85e0d (patch)
Author
 Angel Dimitriev <achi_d@abv.bg>
2022-04-19 20:25:32 +0300
Committer
 GitHub <noreply@github.com>
2022-04-19 20:25:32 +0300
Files31c9fd0a0a1bfe036e5ba9ae764c8efc04d1b2c9 /Sem. 09/StringPool/StringPool.h
Object-oriented_programming_FMI-086675f2e8b421f811ffc0ea140dc1b4f2b85e0d.tar
Object-oriented_programming_FMI-086675f2e8b421f811ffc0ea140dc1b4f2b85e0d.tar.gz
Object-oriented_programming_FMI-086675f2e8b421f811ffc0ea140dc1b4f2b85e0d.zip
Parent49f63ce5011036baa4fc451907924a472714d923 (diff)
Add files via upload
1 files changed, 37 insertions, 0 deletions
-rw-r--r--Sem. 09/StringPool/StringPool.h37
diff --git a/Sem. 09/StringPool/StringPool.h b/Sem. 09/StringPool/StringPool.h
new file mode 100644
index 0000000..6be1715
--- /dev/null
+++ b/Sem. 09/StringPool/StringPool.h
@@ -0,0 +1,37 @@
+#pragma once
+#include "MyString/MyString.h"
+
+
+class StringPool
+{
+ MyString** data;
+ size_t count;
+
+ void copyFrom(const StringPool& other);
+ void free();
+ void resize(size_t newCount);
+
+ int findWord(const MyString& str) const;
+
+public:
+ StringPool();
+
+ StringPool(const StringPool& other);
+ StringPool& operator=(const StringPool& other);
+
+ StringPool& operator*=(const MyString& word);
+ StringPool& operator/=(const MyString& other);
+
+ bool operator[](const MyString& str) const;
+
+ friend std::ostream& operator<<(std::ostream&, const StringPool&);
+ friend void operator>>(const MyString&, StringPool&);
+
+ StringPool& operator+=(const StringPool& other);
+ StringPool& operator-=(const StringPool& other);
+
+ ~StringPool();
+};
+
+StringPool operator+(const StringPool& lhs, const StringPool& rhs);
+StringPool operator-(const StringPool& lhs, const StringPool& rhs);