Tools.h++ Manual

5-6 104011 Tandem Computers Incorporated
5
Program output:
WM_CREATE
The function call operator for
RWCString
has been overloaded to take an
argument of type
RWCRegexp
. It returns an
RWCSubString
matching the
expression, or the null substring if there is no such expression.
5.5 String I/O
Class
RWCString
offers a rich I/O facility to and from both iostreams and
Tools.h++ virtual streams.
iostreams
The standard l- and r-shift operators have been overloaded to work with
iostreams and
RWCStrings
:
ostream& operator<<(ostream& stream, const
RWCString& cstr);
istream& operator>>(istream& stream, const
RWCString& cstr);
The semantics parallel the operators
ostream& operator<<(ostream& stream, const
char*);
istream& operator>>(istream& stream, char* p);
which are defined by the C++ standard library that comes with your compiler.
That is, the l-shift (<<) operator writes a null-terminated string to the given
output stream. The r-shift (>>) operator reads a single token, delimited by
white space, from the input stream into the
RWCString
, replacing the previous
contents.
return 0;
}
#include <rw/cstring.h>