Website Summary Files Commits Branches @commit @diff @stats
path: root / Classes / String / String.h
diff options
context:
space:
mode:
Commit0218c678e13e1cb94a352c91733cea68467dc566 (patch)
Author
 Angeld55 <angel_dimitriev@abv.bg>
2021-02-14 23:06:35 +0200
Committer
 Angeld55 <angel_dimitriev@abv.bg>
2021-02-14 23:06:35 +0200
Files16fb3114cb560242458d10411765e50f5d6183db /Classes/String/String.h
Object-oriented_programming_FMI-0218c678e13e1cb94a352c91733cea68467dc566.tar
Object-oriented_programming_FMI-0218c678e13e1cb94a352c91733cea68467dc566.tar.gz
Object-oriented_programming_FMI-0218c678e13e1cb94a352c91733cea68467dc566.zip
Parentd4ae0ef9ec1b54420176c4a88e09f2fd44ae31b0 (diff)
start from scratch
1 files changed, 0 insertions, 45 deletions
-rw-r--r--Classes/String/String.h45
diff --git a/Classes/String/String.h b/Classes/String/String.h
deleted file mode 100644
index 37bbc6d..0000000
--- a/Classes/String/String.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef STRING_HDR
-#define STRING_HDR
-
-#include<iostream>
-#include<fstream>
-
-const int MAX_SIZE = 1024;
-
-class String {
-
-private:
- char* str;
- int len;
-
- void CopyFrom(const String& other);
- void Free();
-
-public:
- String();
- String(char ch);
- String(const char* str);
- String(const String& other);
- String& operator=(const String& other);
- ~String();
-
- int getLenght() const;
- String SubString(int start);
- String SubString(int start, int end);
- int IndexOf(const String& other, int index); //return the index of the first encounter of other in the object
- int IndexOf(const char* str, int index); //reusing IndexOf(const String& other, int index)
- int CountOcurences(String str); // How many times a string is found as substring
- int GetOcurence(String str, int i); //Get if the i-th substring (count start from 1)
-
- const char& operator[](int index) const;
- char& operator[](int index);
- String& operator+=(const String& other); //return the concatenation of the object with other
- friend bool operator==(const String& lhs, const String& rhs); //return true if two strings are equivalent
- friend bool operator!=(const String& lhs, const String& rhs); //return true if two strings are not equivalent
- friend std::ostream& operator<<(std::ostream& os, const String& obj);
- friend std::istream& operator>>(std::istream& is, String& obj);
-
- String* Split(String str);
-};
-const String operator+(const String& lhs, const String& rhs);
-#endif // !STRING_HDR \ No newline at end of file