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 Error set(std::string_view newStr) {
return set(newStr.data(), newStr.size()); }
53 void set(String
const* otherString);
54 void beenCloned()
const;
56 Error shorten(int32_t newLength);
57 Error concatenateAtPos(
char const* newChars, int32_t pos, int32_t newCharsLength = -1);
58 Error concatenateInt(int32_t number, int32_t minNumDigits = 1);
59 Error setInt(int32_t number, int32_t minNumDigits = 1);
60 Error setChar(
char newChar, int32_t pos);
61 Error concatenate(String* otherString);
62 Error concatenate(std::string_view newChars);
63 Error get_new_memory(int32_t newCharsLength);
64 bool equals(
char const* otherChars);
65 bool equalsCaseIrrespective(
char const* otherChars);
67 inline bool contains(
const char* otherChars) {
return strstr(stringMemory, otherChars) != NULL; }
68 inline bool equals(String* otherString) {
69 if (stringMemory == otherString->stringMemory) {
72 if (!stringMemory || !otherString->stringMemory) {
75 return equals(otherString->get());
78 inline bool equalsCaseIrrespective(String* otherString) {
79 if (stringMemory == otherString->stringMemory) {
82 if (!stringMemory || !otherString->stringMemory) {
85 return equalsCaseIrrespective(otherString->get());
89 [[nodiscard]]
inline char const* get()
const {
96 inline bool isEmpty() {
return !stringMemory; }
97 int32_t getNumReasons()
const;
100 void setNumReasons(int32_t newNum)
const;
102 char* stringMemory =
nullptr;