Tools.h++ Class Reference

Table Of Contents
not match: if they differ, b will be resized appropriately. Sets self's extent to be the extent
of the assigned RWCSubString. If self is the null substring, then the statement has no
effect. Returns a reference to self.
RWCSubString&
operator=(const char*);
Assignment from a character string. Example:
RWCString str("Mary had a lamb");
char dat[] = "Perrier";
str(11,4) = dat; // "Mary had a Perrier"
Note that the number of characters selected need not match: if they differ, str will be
resized appropriately. Sets self's extent to be the strlen() of the assigned character string.
If self is the null substring, then the statement has no effect. Returns a reference to self.
Indexing Operators
char&
operator[](size_t i);
char
operator[](size_t i) const;
Returns the ith character of the substring. The first variant can be used as an lvalue, the
second cannot. The index i must be between zero and the length of the substring, less
one. Bounds checking is performed: if the index is out of range, then an exception of type
RWBoundsErr will occur.
char&
operator()(size_t i);
char
operator()(size_t i) const;
Returns the ith character of the substring. The first variant can be used as an lvalue, the
second cannot. The index i must be between zero and the length of the substring, less
one. Bounds checking is enabled by defining the pre-processor macro
RWBOUNDS_CHECK before including <rw/cstring.h>. In this case, if the index is out
of range, then an exception of type RWBoundsErr will occur.
Public Member Functions
RWBoolean
isNull() const;
Returns TRUE if this is a null substring.
size_t
length() const;