Tools.h++ Manual
104011 Tandem Computers Incorporated 21-73
21
Examples
Program output:
There is no joy in Redmond.
Enumerations
enum RWCString::caseCompare { exact, ignoreCase }
Used to specify whether comparisons, searches, and hashing functions should
use case sensitive
(exact)
or case-insensitive
(ignoreCase)
semantics.
Public constructors
RWCString();
Creates a string of length zero (the null string).
RWCString(const char* cs);
Conversion from the null-terminated character string
cs
. The created string
will copy the data pointed to by
cs
, up to the first terminating null.
RWCString(const char* cs, size_t N);
Constructs a string from the character string
cs
. The created string will copy
the data pointed to by
cs
. Exactly
N
characters are copied, including any
embedded nulls. Hence, the buffer pointed to by
cs
must be at least
N
bytes
long.
RWCString(RWSize_T ic);
Creates a string of length zero (the null string). The strings capacity (that is, the
size it can grow to without resizing) is given by the parameter
ic
.
RWCString(const RWCString& str);
Copy constructor. The created string will copy
str's
data.
#include <rw/cstring.h>
#include <rw/regexp.h>
#include <rw/rstream.h>
main()
{
RWCString a("There is no joy in Beantown.");
RWCRegexp re("[A-Z][a-z]*town");// Any capitalized "town"
a(re) = "Redmond";
cout << a << endl;
}