Tools.h++ Manual

21-208 104011 Tandem Computers Incorporated
21
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
RWWString& operator=(const char* cs);
Assignment operator. Copies the null-terminated character string pointed to
by
cs
into self. Returns a reference to self.
RWWString& operator=(const RWWString& str)
;
Assignment operator. The string will copy
str
’s data. Returns a reference to
self.
RWWString& operator+=(const wchar_t* cs)
;
Append the null-terminated character string pointed to by
cs
to self. Returns
a reference to self.
RWWString& operator+=(const RWWString& str)
;
Append the string
str
to self. Returns a reference to self.
Indexing operators
wchar_t& operator[](size_t i);
wchar_t operator[](size_t i) const
;
Return the
i
’th character. The first variant can be used as an lvalue. The index
i
must be between 0 and the length of the string less one. Bounds checking is
performed—if the index is out of range then an exception of type
RWBoundsErr
will be thrown.
wchar_t& operator()(size_t i);
wchar_t operator()(size_t i) const
;
Return the i’th character. The first variant can be used as an lvalue. The index
i
must be between 0 and the length of the string less one. Bounds checking is
performed if the pre-processor macro
RWBOUNDS_CHECK
has been defined
before including
<rw/wstring.h>
. In this case, if the index is out of range,
then an exception of type
RWBoundsErr
will be thrown.
RWWSubString operator()(size_t start, size_t len);
const RWWSubString operator()(size_t start, size_t len)
const
;
Substring operator. Returns an
RWWSubString
of self with length
len
,
starting at index
start
. The first variant can be used as an lvalue. The sum of