36 explicit String(
const char *pszText);
62 void Print(
const char *pszText)
override;
184 int Compare(
int nPos,
int nCount,
const char *pszText)
const;
187 static constexpr int npos = -1;
197 int Find(
const char *pszText)
const;
218 int Find(
char ch,
int nPos)
const;
PrnStream()
Construct a stream with a dump level of 0.
Definition prnstream.h:23
String & Replace(int nPos, int nCount, const String &text)
Replace a run of characters with another string's text.
bool operator!=(const char *pszText) const
Report whether the text differs from a C string.
int GetLength() const
Definition string.h:374
int Find(const char *pszText) const
Find the first occurrence of a C string in the text.
String & operator+=(const char *pszText)
Append a C string.
char operator[](int nIndex) const
Report one character.
static constexpr int npos
The position Find() reports when the text does not occur.
Definition string.h:187
bool operator==(const String &other) const
Report whether the text equals another string's text.
String operator+(const char *pszText) const
Report a copy of the string with text appended.
String & operator=(const char *pszText)
Replace the text with a copy of a C string.
String & operator+=(char ch)
Append a character.
String & Insert(int nPos, const String &text)
Insert a copy of another string's text.
void Resize(int nLength)
Replace the text with nLength zero bytes.
String & Clear()
Release the text and leave the string empty.
String & operator=(const String &other)
Replace the text with a copy of another string's text.
void Print(const char *pszText) override
Append text.
int RFind(char ch) const
Find the last occurrence of a character.
int Find(char ch) const
Find the first occurrence of a character.
String()
Construct an empty string.
Definition string.h:26
const char * c_str() const
Report the text.
Definition string.h:369
int Find(char ch, int nPos) const
Find the first occurrence of a character at or after a position.
bool operator==(const char *pszText) const
Report whether the text equals a C string.
String Substring(int nPos, int nCount) const
Copy a run of characters, or the characters from a position to the end when the run reaches the end.
~String() override
Release the text.
char * GetBuffer() const
Definition string.h:379
bool operator<(const String &other) const
Report whether the text sorts before another string's text.
String & operator+=(const String &other)
Append another string's text.
String operator+(const String &other) const
Report a copy of the string with another string's text appended.
String & Erase(int nPos, int nCount)
Remove a run of characters.
String(const char *pszText)
Construct a copy of a C string.
bool operator!=(const String &other) const
Report whether the text differs from another string's text.
String & Truncate(int nLength)
Cut the text to a length.
String Substring(int nPos) const
Copy the characters from a position to the end.
int Compare(int nPos, int nCount, const char *pszText) const
Compare a run of characters with a C string.
String & Insert(int nPos, int nCount, char ch)
Insert copies of one character.
String operator+(char ch) const
Report a copy of the string with a character appended.
String(const String &other)
Copy another string.
void SetStringReadsText(int bText)
Make operator>>(BinStream &, String &) read text up to its terminator, or read a string as BinStream:...
char * g_szStringEmptyBuffer
Shared terminated buffer every empty String points at.
const char * FormatString(const char *pszFormat,...)
Format text into one shared buffer and return it.