Tools.h++ Class Reference

Table Of Contents
RWWString&
replace(size_t pos, size_t N1,
const RWWString& str, size_t N2);
Replaces N1 characters or to the end of string (whichever comes first) starting at position pos, which must be
no greater than length(), with a copy of the first N2 characters, or the length of str (whichever is less), from
str. Returns a reference to self.
void
resize(size_t n);
Changes the length of self, adding blanks (i.e., L' ') or truncating as necessary.
RWWSubString
strip(stripType s = RWWString::trailing, wchar_t c = L' '); const RWWSubString
strip(stripType s = RWWString::trailing, wchar_t c = L' ')
const;
Returns a substring of self where the character c has been stripped off the beginning, end, or both ends of the
string. The first variant can be used as an lvalue. The enum stripType can take values:
stripType Meaning
leading Remove characters at beginning
trailing Remove characters at end
both Remove characters at both ends
RWWSubString
subString(const wchar_t* cs, size_t start=0,
caseCompare = RWWString::exact);
const RWWSubString
subString(const wchar_t* cs, size_t start=0,
caseCompare = RWWString::exact) const;
Returns a substring representing the first occurrence of the null-terminated string pointed to by "cs". Case
sensitivity is according to the caseCompare argument; it defaults to RWWString::exact. The first variant can
be used as an lvalue.
RWCString
toAscii() const;
Returns an RWCString object of the same length as self, containing only ASCII characters. Any non-ASCII
characters in self simply have the high bits stripped off. Use isAscii() to determine whether this function is
safe to use.
RWCString
toMultiByte() const;
Returns an RWCString containing the result of applying the standard C library function wcstombs() to self.
This function is always safe to use.
void
toLower();
Changes all upper-case letters in self to lower-case. Uses the C library function towlower().
void
toUpper();
Changes all lower-case letters in self to upper-case. Uses the C library function towupper().