44 String(
const String& other);
45 String& operator=(
const String& other);
50 void clear(
bool destructing =
false);
51 Error set(
char const* newChars, int32_t newLength = -1);
52 void set(String
const* otherString);
53 void beenCloned()
const;
55 Error shorten(int32_t newLength);
56 Error concatenateAtPos(
char const* newChars, int32_t pos, int32_t newCharsLength = -1);
57 Error concatenateInt(int32_t number, int32_t minNumDigits = 1);
58 Error setInt(int32_t number, int32_t minNumDigits = 1);
59 Error setChar(
char newChar, int32_t pos);
60 Error concatenate(String* otherString);
61 Error concatenate(
char const* newChars);
62 Error get_new_memory(int32_t newCharsLength);
63 bool equals(
char const* otherChars);
64 bool equalsCaseIrrespective(
char const* otherChars);
66 inline bool contains(
const char* otherChars) {
return strstr(stringMemory, otherChars) != NULL; }
67 inline bool equals(String* otherString) {
68 if (stringMemory == otherString->stringMemory) {
71 if (!stringMemory || !otherString->stringMemory) {
74 return equals(otherString->get());
77 inline bool equalsCaseIrrespective(String* otherString) {
78 if (stringMemory == otherString->stringMemory) {
81 if (!stringMemory || !otherString->stringMemory) {
84 return equalsCaseIrrespective(otherString->get());
87 [[nodiscard]]
inline char const* get()
const {
94 inline bool isEmpty() {
return !stringMemory; }
95 int32_t getNumReasons()
const;
98 void setNumReasons(int32_t newNum)
const;
100 char* stringMemory =
nullptr;