51#ifdef VIDEO_STANDARD_PAL
91 HxStr(
unsigned nCount,
char ch);
94#ifdef VIDEO_STANDARD_PAL
99 if (
mStr !=
nullptr) {
135 return *
this +=
HxStr(pszText);
269 int Find(
char ch,
unsigned nStart)
const;
279 int Find(
const char *pszText)
const;
314 int Compare(
unsigned pos,
unsigned len,
const char *str)
const;
441 std::ostream &
Print(std::ostream &stream)
const;
469 HxStr(
char *pOwnedText,
unsigned nLen) :
mLen(nLen),
mStr(pOwnedText) {
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
HxStr & operator+=(const HxStr &other)
Append another string.
unsigned mLen
Length excluding the terminator.
Definition hxstr.h:453
HxStr(const HxStr &other)
Construct a copy of another string.
bool operator==(const char *pszRight) const
Compare against a C string for equality.
HxStr Mid(unsigned pos, unsigned len) const
Extract a run of text.
HxStr & Truncate(unsigned pos)
Shorten the string in place.
int Compare(unsigned pos, unsigned len, const char *str) const
Compare a run of this string against a C string.
HxStr & Erase(unsigned pos, unsigned len)
Remove a run of text.
bool operator!=(const char *pszRight) const
Compare against a C string for inequality.
HxStr & operator+=(char ch)
Append one character.
~HxStr()
Definition hxstr.h:93
std::ostream & Print(std::ostream &stream) const
Write this string to a stream.
bool operator==(const HxStr &right) const
Compare against another string for equality.
HxStr Mid(unsigned pos) const
Extract the text from a position to the end.
bool operator!=(const HxStr &right) const
Compare against another string for inequality.
HxStr & operator+=(const char *pszText)
Append a C string.
Definition hxstr.h:134
HxStr & operator=(const char *pszText)
Replace this string with a copy of a C string.
int Find(const char *pszText) const
Find the first occurrence of a substring.
int ReverseFind(char ch) const
Find the last occurrence of a character.
HxStr & operator=(const HxStr &other)
Replace this string with a copy of another.
int Find(char ch, unsigned nStart) const
Find the first occurrence of a character at or after a position.
int Find(char ch) const
Find the first occurrence of a character.
char operator[](unsigned i) const
Read one character.
void Alloc(unsigned nLen)
Discard the text and reserve a zero-filled buffer.
HxStr & Insert(unsigned pos, const HxStr &other)
Insert another string.
HxStr & Insert(unsigned pos, unsigned nCount, char ch)
Insert a run of one repeated character.
HxStr(const char *pszText)
Construct a copy of a C string.
char * mStr
Text buffer.
Definition hxstr.h:464
int ReverseFindOneOf(const char *pszChars) const
Find the last occurrence of any of a set of characters.
bool operator<(const HxStr &right) const
Order against another string.
HxStr & Clear()
Empty the string in place.
HxStr & Replace(unsigned pos, unsigned len, const HxStr &other)
Overwrite a run of text with another string.
HxStr()
Construct an empty string.
Definition hxstr.h:55
HxStr & Replace(unsigned pos, unsigned len, char ch)
Overwrite one character.
HxStr(unsigned nCount, char ch)
Construct a run of one repeated character.
const unsigned g_nHxStrNoPosition
Sentinel a search returns when it finds nothing.
const char * g_szEmptyString
Text an empty HxStr points at, and the substitute for a null buffer.
HxStr operator+(const HxStr &left, const HxStr &right)
Concatenate two strings.
Definition hxstr.h:492
std::ostream & operator<<(std::ostream &stream, const HxStr &text)
Write a string to a stream.