Tools.h++ Manual
104011 Tandem Computers Incorporated 21-77
21
const char* data() 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.
size_t first(char c) const;
Returns the index of the first occurence of the character
c
in self. Returns
RW_NPOS
if there is no such character.
unsigned hash(caseCompare = exact) const;
Returns a suitable hash value.
size_t index(const char* pat, size_t
i=0, caseCompare = exact) const;
size_t index(const RWCString& pat, size_t
i=0, caseCompare = exact) const;
Pattern matching. Starting with index
i
, searches for the first occurrence of
pat
in self and returns the index of the start of the match. Returns
RW_NPOS
if
there is no such pattern. Case sensitivity is according to the
caseCompare
argument; it defaults to
RWCString::exact
.
size_t index(const char* pat, size_t
patlen,size_t i,
caseCompare) const;
size_t index(const RWCString& pat, size_t
patlen size_t i,
caseCompare) const;
Pattern matching. Starting with index
i
, searches for the first occurrence of the
first
patlen
characters from
pat
in self and returns the index of the start of
the match. Returns
RW_NPOS
if there is no such pattern. Case sensitivity is
according to the
caseCompare
argument.
size_t index(const RWCRegexp& re, size_t
i=0) const;
Regular expression matching. Returns the index greater than or equal to
i
of
the start of the first pattern that matches the regular expression
re
. Returns
RW_NPOS
if there is no such pattern.