Tools.h++ Manual

21-74 104011 Tandem Computers Incorporated
21
RWCString(const RWCSubString& ss);
Conversion from sub-string. The created string will copy the substring
represented by
ss
.
RWCString(char c);
Constructs a string containing the single character
c
.
RWCString(char c, size_t N);
Constructs a string containing the character
c
repeated
N
times.
Type conversion
operator const char*() const;
Access to the
RWCString
’s data as a null terminated string. This datum is
owned by the
RWCString
and may not be deleted or changed. If the
RWCString
object itself changes or goes out of scope, the pointer value
previously returned may (will!) become invalid. While the string is null-
terminated, note that its length is still given by the member function
length()
.
That is, it may contain embedded nulls.
Assignment operators
RWCString& operator=(const char* cs);
Assignment operator. Copies the null-terminated character string pointed to
by
cs
into self. Returns a reference to self.
RWCString& operator=(const RWCString& str);
Assignment operator. The string will copy
str's
data. Returns a reference to
self.
RWCString& operator+=(const char* cs);
Append the null-terminated character string pointed to by
cs
to self. Returns
a reference to self.
RWCString& operator+=(const RWCString& str);
Append the string
str
to self. Returns a reference to self.
Indexing operators
char& operator[](size_t i);
char operator[](size_t i) const;
Return the
i
’th character. The first variant can be used as an lvalue. The index