Tools.h++ Class Reference

Table Of Contents
Persistence
None
Example
#include <rw/rstream.h>
#include <rw/wstring.h>
main(){
RWWString s(L"What I tell you is true.");
// Create a substring and use it as an lvalue:
s(15,0) = RWWString(L" three times");
cout << s << endl;
return 0;
}
Program output:
What I tell you three times is true.
Assignment Operators
void
operator=(const RWWString&);
Assignment from an RWWString. The statements:
RWWString a;
RWWString b;
...
b(2, 3) = a;
will copy a's data into the substring b(2,3). The number of elements need not match: if
they differ, b will be resized appropriately. If self is the null substring, then the statement
has no effect.
void
operator=(const wchar_t*);
Assignment from a wide character string. Example:
RWWString wstr(L"Mary had a little lamb");
wchar_t dat[] = L"Perrier";
wstr(11,4) = dat; // "Mary had a Perrier"
Note that the number of characters selected need not match: if they differ, wstr will be
resized appropriately. If self is the null substring, then the statement has no effect.