SourcePro® API Reference Guide

 
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Related Functions

Offers powerful and convenient facilities for manipulating strings. More...

#include <rw/cstring.h>

Inheritance diagram for RWCString:
RWCollectableString RWDBMBString RWStringID

Public Types

enum  caseCompare { exact, ignoreCase, ignoreCaseStrict }
 
typedef RWCConstSubString ConstSubString
 
enum  scopeType { one, all }
 
enum  stripType { leading, trailing, both }
 
typedef RWCSubString SubString
 

Public Member Functions

 RWCString ()
 
 RWCString (const RWCString &str)
 
 RWCString (RWCString &&str)
 
 RWCString (const SubString &str)
 
 RWCString (const ConstSubString &str)
 
 RWCString (const std::string &str)
 
 RWCString (const char *str)
 
 RWCString (const char *str, size_t len)
 
 RWCString (char c)
 
 RWCString (signed char c)
 
 RWCString (unsigned char c)
 
 RWCString (char c, size_t count)
 
 RWCString (RWSize_T cap)
 
RWCStringappend (const RWCString &str)
 
RWCStringappend (const SubString &str)
 
RWCStringappend (const ConstSubString &str)
 
RWCStringappend (const RWCString &str, size_t len)
 
RWCStringappend (const std::string &str)
 
RWCStringappend (const std::string &str, size_t len)
 
RWCStringappend (const char *str)
 
RWCStringappend (const char *str, size_t len)
 
RWCStringappend (char c, size_t count=1)
 
RWCStringassign (const RWCString &str)
 
RWCStringassign (const std::string &str)
 
RWCStringassign (const SubString &str)
 
RWCStringassign (const ConstSubString &str)
 
RWCStringassign (const char *str)
 
RWCStringassign (const char *str, size_t len)
 
RWCStringassign (char c, size_t count=1)
 
RWspace binaryStoreSize () const
 
size_t capacity () const
 
size_t capacity (size_t cap)
 
int collate (const RWCString &str) const
 
int collate (const std::string &str) const
 
int collate (const char *str) const
 
int compareTo (const RWCString &str, caseCompare cmp=exact) const
 
int compareTo (const SubString &str, caseCompare cmp=exact) const
 
int compareTo (const ConstSubString &str, caseCompare cmp=exact) const
 
int compareTo (const RWCString *str, caseCompare cmp=exact) const
 
int compareTo (const std::string &str, caseCompare cmp=exact) const
 
int compareTo (const std::string *str, caseCompare cmp=exact) const
 
int compareTo (const char *str, caseCompare cmp=exact) const
 
int compareTo (const char *str, size_t len, caseCompare cmp=exact) const
 
bool contains (const RWCString &str, caseCompare cmp=exact) const
 
bool contains (const SubString &str, caseCompare cmp=exact) const
 
bool contains (const ConstSubString &str, caseCompare cmp=exact) const
 
bool contains (const std::string &str, caseCompare cmp=exact) const
 
bool contains (const char *str, caseCompare cmp=exact) const
 
bool contains (const char *str, size_t len, caseCompare cmp=exact) const
 
const char * data () const
 
size_t first (char c) const
 
size_t first (char c, size_t) const
 
size_t first (const char *str) const
 
size_t first (const char *str, size_t len) const
 
size_t firstNotOf (char c, size_t pos=0) const
 
size_t firstNotOf (const char *str, size_t pos=0) const
 
size_t firstNotOf (const char *str, size_t pos, size_t len) const
 
size_t firstNotOf (const RWCString &str, size_t pos=0) const
 
size_t firstNotOf (const SubString &str, size_t pos=0) const
 
size_t firstNotOf (const ConstSubString &str, size_t pos=0) const
 
size_t firstNotOf (const std::string &str, size_t pos=0) const
 
size_t firstOf (char c, size_t pos=0) const
 
size_t firstOf (const char *str, size_t pos=0) const
 
size_t firstOf (const char *str, size_t pos, size_t len) const
 
size_t firstOf (const RWCString &str, size_t pos=0) const
 
size_t firstOf (const SubString &str, size_t pos=0) const
 
size_t firstOf (const ConstSubString &str, size_t pos=0) const
 
size_t firstOf (const std::string &str, size_t pos=0) const
 
unsigned hash (caseCompare cmp=exact) const
 
size_t index (const RWCString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const SubString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const ConstSubString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const RWCString &pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const std::string &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const std::string &pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const char *pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const char *pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const char pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const RWCRegexp &re, size_t start=0) const
 
size_t index (const RWCRegexp &re, size_t *ext, size_t start=0) const
 
size_t index (const RWCRExpr &re, size_t start=0) const
 
size_t index (const RWCRExpr &re, size_t *ext, size_t start=0) const
 
size_t index (const char *re, size_t *ext, size_t start=0) const
 
RWCStringinsert (size_t pos, const RWCString &str)
 
RWCStringinsert (size_t pos, const SubString &str)
 
RWCStringinsert (size_t pos, const ConstSubString &str)
 
RWCStringinsert (size_t pos, const RWCString &str, size_t len)
 
RWCStringinsert (size_t pos, const std::string &str)
 
RWCStringinsert (size_t pos, const std::string &str, size_t len)
 
RWCStringinsert (size_t pos, const char *str)
 
RWCStringinsert (size_t pos, const char *str, size_t len)
 
RWCStringinsert (size_t pos, char c, size_t count)
 
bool isAscii () const
 
bool isNull () const
 
size_t last (char c) const
 
size_t last (char c, size_t) const
 
size_t last (const char *str) const
 
size_t last (const char *str, size_t len) const
 
size_t lastNotOf (char c, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const char *str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const char *str, size_t pos, size_t len) const
 
size_t lastNotOf (const RWCString &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const SubString &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const ConstSubString &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const std::string &str, size_t pos=RW_NPOS) const
 
size_t lastOf (char c, size_t pos=RW_NPOS) const
 
size_t lastOf (const char *str, size_t pos=RW_NPOS) const
 
size_t lastOf (const char *str, size_t pos, size_t len) const
 
size_t lastOf (const RWCString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const SubString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const ConstSubString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const std::string &str, size_t pos=RW_NPOS) const
 
size_t length () const
 
SubString match (const RWCRExpr &re)
 
ConstSubString match (const RWCRExpr &) const
 
SubString match (const RWCRExpr &re, size_t start)
 
ConstSubString match (const RWCRExpr &re, size_t start) const
 
size_t mbLength () const
 
 operator const char * () const
 
char & operator() (size_t i)
 
char operator() (size_t i) const
 
SubString operator() (size_t start, size_t len)
 
ConstSubString operator() (size_t start, size_t len) const
 
SubString operator() (const RWCRegexp &re)
 
ConstSubString operator() (const RWCRegexp &re) const
 
SubString operator() (const RWCRegexp &re, size_t start)
 
ConstSubString operator() (const RWCRegexp &re, size_t start) const
 
RWCStringoperator+= (const RWCString &str)
 
RWCStringoperator+= (const SubString &str)
 
RWCStringoperator+= (const ConstSubString &str)
 
RWCStringoperator+= (const std::string &str)
 
RWCStringoperator+= (const char *str)
 
RWCStringoperator+= (char c)
 
RWCStringoperator= (const RWCString &str)
 
RWCStringoperator= (RWCString &&str)
 
RWCStringoperator= (const SubString &str)
 
RWCStringoperator= (const ConstSubString &str)
 
RWCStringoperator= (const std::string &str)
 
RWCStringoperator= (const char *str)
 
RWCStringoperator= (char c)
 
char & operator[] (char i)
 
char operator[] (char i) const
 
char & operator[] (signed char i)
 
char operator[] (signed char i) const
 
char & operator[] (short i)
 
char operator[] (short i) const
 
char & operator[] (int i)
 
char operator[] (int i) const
 
char & operator[] (long i)
 
char operator[] (long i) const
 
char & operator[] (long long i)
 
char operator[] (long long i) const
 
char & operator[] (unsigned char i)
 
char operator[] (unsigned char i) const
 
char & operator[] (unsigned short i)
 
char operator[] (unsigned short i) const
 
char & operator[] (unsigned int i)
 
char operator[] (unsigned int i) const
 
char & operator[] (unsigned long i)
 
char operator[] (unsigned long i) const
 
char & operator[] (unsigned long long i)
 
char operator[] (unsigned long long i) const
 
RWCStringprepend (const RWCString &str)
 
RWCStringprepend (const SubString &str)
 
RWCStringprepend (const ConstSubString &str)
 
RWCStringprepend (const RWCString &str, size_t len)
 
RWCStringprepend (const std::string &str)
 
RWCStringprepend (const std::string &str, size_t len)
 
RWCStringprepend (const char *str)
 
RWCStringprepend (const char *str, size_t len)
 
RWCStringprepend (char c, size_t count=1)
 
std::istream & readFile (std::istream &strm)
 
std::istream & readLine (std::istream &strm, bool skipWhite=true)
 
std::istream & readString (std::istream &strm)
 
std::istream & readToDelim (std::istream &strm, char delim= '\n')
 
std::istream & readToken (std::istream &strm)
 
RWCStringremove (size_t pos)
 
RWCStringremove (size_t pos, size_t len)
 
RWCStringreplace (size_t pos, size_t len, const RWCString &str)
 
RWCStringreplace (size_t pos, size_t len, const SubString &str)
 
RWCStringreplace (size_t pos, size_t len, const ConstSubString &str)
 
RWCStringreplace (size_t pos, size_t len, const RWCString &str, size_t strLen)
 
RWCStringreplace (size_t pos, size_t len, const std::string &str)
 
RWCStringreplace (size_t pos, size_t len, const std::string &str, size_t strLen)
 
RWCStringreplace (size_t pos, size_t len, const char *str)
 
RWCStringreplace (size_t pos, size_t len, const char *str, size_t strLen)
 
RWCStringreplace (const RWCRExpr &re, const RWCString &str, scopeType scope=one)
 
RWCStringreplace (const RWCRExpr &re, const char *str, scopeType scope=one)
 
void resize (size_t len)
 
size_t rindex (const RWCString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const SubString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const ConstSubString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const RWCString &pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const std::string &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const std::string &pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const char *pat, caseCompare cmp) const
 
size_t rindex (const char *pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const char *pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const char pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
void shrink ()
 
std::string & std ()
 
const std::string & std () const
 
SubString strip (stripType st=trailing, char c= ' ')
 
ConstSubString strip (stripType st=trailing, char c= ' ') const
 
SubString subString (const char *pat, size_t start=0, caseCompare cmp=exact)
 
ConstSubString subString (const char *pat, size_t start=0, caseCompare cmp=exact) const
 
void swap (RWCString &str)
 
void toLower ()
 
void toUpper ()
 

Static Public Member Functions

static size_t byteCount (const char *str, size_t nChars=RW_NPOS)
 
static unsigned hash (const RWCString &str)
 
static size_t mbLength (const char *str, size_t nBytes=RW_NPOS)
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const RWCString &lhs, const RWCString &rhs)
 
bool operator!= (const RWCString &lhs, const RWCSubString &rhs)
 
bool operator!= (const RWCSubString &lhs, const RWCString &rhs)
 
bool operator!= (const RWCString &lhs, const RWCConstSubString &rhs)
 
bool operator!= (const RWCConstSubString &lhs, const RWCString &rhs)
 
bool operator!= (const RWCString &lhs, const std::string &rhs)
 
bool operator!= (const std::string &lhs, const RWCString &rhs)
 
bool operator!= (const RWCString &lhs, const char *rhs)
 
bool operator!= (const char *lhs, const RWCString &rhs)
 
bool operator!= (const RWCString &lhs, char rhs)
 
bool operator!= (char lhs, const RWCString &rhs)
 
RWCString operator+ (const RWCString &lhs, const RWCString &rhs)
 
RWCString operator+ (const RWCString &lhs, const RWCSubString &rhs)
 
RWCString operator+ (const RWCSubString &lhs, const RWCString &rhs)
 
RWCString operator+ (const RWCString &lhs, const RWCConstSubString &rhs)
 
RWCString operator+ (const RWCConstSubString &lhs, const RWCString &rhs)
 
RWCString operator+ (const RWCString &lhs, const std::string &rhs)
 
RWCString operator+ (const std::string &lhs, const RWCString &rhs)
 
RWCString operator+ (const RWCString &lhs, const char *rhs)
 
RWCString operator+ (const char *lhs, const RWCString &rhs)
 
RWCString operator+ (const RWCSubString &lhs, const RWCSubString &rhs)
 
RWCString operator+ (const RWCSubString &lhs, const RWCConstSubString &rhs)
 
RWCString operator+ (const RWCConstSubString &lhs, const RWCSubString &rhs)
 
RWCString operator+ (const RWCSubString &lhs, const std::string &rhs)
 
RWCString operator+ (const std::string &lhs, const RWCSubString &rhs)
 
RWCString operator+ (const RWCSubString &lhs, const char *rhs)
 
RWCString operator+ (const char *lhs, const RWCSubString &rhs)
 
RWCString operator+ (const RWCConstSubString &lhs, const RWCConstSubString &rhs)
 
RWCString operator+ (const RWCConstSubString &lhs, const std::string &rhs)
 
RWCString operator+ (const std::string &lhs, const RWCConstSubString &rhs)
 
RWCString operator+ (const RWCConstSubString &lhs, const char *rhs)
 
RWCString operator+ (const char *lhs, const RWCConstSubString &rhs)
 
bool operator< (const RWCString &lhs, const RWCString &rhs)
 
bool operator< (const RWCString &lhs, const RWCSubString &rhs)
 
bool operator< (const RWCSubString &lhs, const RWCString &rhs)
 
bool operator< (const RWCString &lhs, const RWCConstSubString &rhs)
 
bool operator< (const RWCConstSubString &lhs, const RWCString &rhs)
 
bool operator< (const RWCString &lhs, const std::string &rhs)
 
bool operator< (const std::string &lhs, const RWCString &rhs)
 
bool operator< (const RWCString &lhs, const char *rhs)
 
bool operator< (const char *lhs, const RWCString &rhs)
 
bool operator< (const RWCString &lhs, char rhs)
 
bool operator< (char lhs, const RWCString &rhs)
 
RWFileoperator<< (RWFile &file, const RWCString &str)
 
RWvostreamoperator<< (RWvostream &vos, const RWCString &str)
 
std::ostream & operator<< (std::ostream &os, const RWCString &str)
 
bool operator<= (const RWCString &lhs, const RWCString &rhs)
 
bool operator<= (const RWCString &lhs, const RWCSubString &rhs)
 
bool operator<= (const RWCSubString &lhs, const RWCString &rhs)
 
bool operator<= (const RWCString &lhs, const RWCConstSubString &rhs)
 
bool operator<= (const RWCConstSubString &lhs, const RWCString &rhs)
 
bool operator<= (const RWCString &lhs, const std::string &rhs)
 
bool operator<= (const std::string &lhs, const RWCString &rhs)
 
bool operator<= (const RWCString &lhs, const char *rhs)
 
bool operator<= (const char *lhs, const RWCString &rhs)
 
bool operator<= (const RWCString &lhs, char rhs)
 
bool operator<= (char lhs, const RWCString &rhs)
 
bool operator== (const RWCString &lhs, const RWCString &rhs)
 
bool operator== (const RWCString &lhs, const RWCSubString &rhs)
 
bool operator== (const RWCSubString &lhs, const RWCString &rhs)
 
bool operator== (const RWCString &lhs, const RWCConstSubString &rhs)
 
bool operator== (const RWCConstSubString &lhs, const RWCString &rhs)
 
bool operator== (const RWCString &lhs, const std::string &rhs)
 
bool operator== (const std::string &lhs, const RWCString &rhs)
 
bool operator== (const RWCString &lhs, const char *rhs)
 
bool operator== (const char *lhs, const RWCString &rhs)
 
bool operator== (const RWCString &lhs, char rhs)
 
bool operator== (char lhs, const RWCString &rhs)
 
bool operator> (const RWCString &lhs, const RWCString &rhs)
 
bool operator> (const RWCString &lhs, const RWCSubString &rhs)
 
bool operator> (const RWCSubString &lhs, const RWCString &rhs)
 
bool operator> (const RWCString &lhs, const RWCConstSubString &rhs)
 
bool operator> (const RWCConstSubString &lhs, const RWCString &rhs)
 
bool operator> (const RWCString &lhs, const std::string &rhs)
 
bool operator> (const std::string &lhs, const RWCString &rhs)
 
bool operator> (const RWCString &lhs, const char *rhs)
 
bool operator> (const char *lhs, const RWCString &rhs)
 
bool operator> (const RWCString &lhs, char rhs)
 
bool operator> (char lhs, const RWCString &rhs)
 
bool operator>= (const RWCString &lhs, const RWCString &rhs)
 
bool operator>= (const RWCString &lhs, const RWCSubString &rhs)
 
bool operator>= (const RWCSubString &lhs, const RWCString &rhs)
 
bool operator>= (const RWCString &lhs, const RWCConstSubString &rhs)
 
bool operator>= (const RWCConstSubString &lhs, const RWCString &rhs)
 
bool operator>= (const RWCString &lhs, const std::string &rhs)
 
bool operator>= (const std::string &lhs, const RWCString &rhs)
 
bool operator>= (const RWCString &lhs, const char *rhs)
 
bool operator>= (const char *lhs, const RWCString &rhs)
 
bool operator>= (const RWCString &lhs, char rhs)
 
bool operator>= (char lhs, const RWCString &rhs)
 
RWFileoperator>> (RWFile &file, RWCString &str)
 
RWvistreamoperator>> (RWvistream &vis, RWCString &str)
 
std::istream & operator>> (std::istream &is, RWCString &str)
 
RWCString strXForm (const RWCString &str)
 
RWCString strXForm (const std::string &str)
 
RWCString toLower (const RWCString &str)
 
RWCString toUpper (const RWCString &str)
 

Detailed Description

Class RWCString offers powerful and convenient facilities for manipulating strings.

Note
RWCString is designed for use with single or multibyte character sequences. To manipulate wide character strings, use RWWString.

Although the class is primarily intended to be used to handle single-byte character sets (SBCS; such as US-ASCII or ISO Latin-1), with care it can be used to handle multibyte character sets (MBCS). There are two things that must be kept in mind when working with MBCS:

Parameters of type const char* must not be passed a value of zero. This is detected in the debug version of the library.

A separate class RWCSubString supports substring extraction and modification operations. RWCConstSubString supports substring extractions on const RWCString instances.

Synopsis
#include <rw/cstring.h>
Persistence
Simple
Example
#include <iostream>
#include <rw/cstring.h>
int main()
{
RWCString a("There is no joy in Beantown.");
std::cout << "\"" << a << "\"" << " becomes ";
a.subString("Beantown") = "Redmond";
std::cout << "\"" << a << "\"" << std::endl;
return 0;
}

Program output:

"There is no joy in Beantown" becomes "There is no joy in Redmond."

Member Typedef Documentation

The immutable substring class associated with RWCString.

The mutable substring class associated with RWCString.

Member Enumeration Documentation

Specifies semantics used by comparisons, searches, and hashing functions

Enumerator
exact 

Use exact case sensitive semantics

ignoreCase 

Ignore case sensitive semantics

ignoreCaseStrict 

Case-insensitive for alpha characters only. ignoreCaseStrict only differs from ignoreCase in comparison operations, where changing case can affect the order of the strings.

Deprecated:
As of SourcePro 12, provided for compatibility with code that relies on the enumeration RWCString::scopeType.

Specifies whether regular expression functions replace the first one substring matched by the regular expression or replace all substrings matched by the regular expression.

Enumerator
one 

replaces first substring matched.

all 

replaces all substrings matched.

Specifies whether characters are stripped from the beginning of the string, the end, or both.

Enumerator
leading 

Remove characters at beginning

trailing 

Remove characters at end

both 

Remove characters at both ends

Constructor & Destructor Documentation

RWCString::RWCString ( )
inline

Creates a string of length zero (the null string).

RWCString::RWCString ( const RWCString str)
inline

Copy constructor. The created string copies the data from str.

RWCString::RWCString ( RWCString &&  str)
inline

Move constructor. The created string takes ownership of the data owned by str.

Condition:
This method is available only on platforms with rvalue reference support.
RWCString::RWCString ( const SubString str)
inline

Converts from a substring. The created string copies the substring represented by str.

Note
Behavior is undefined if str is a null substring.
RWCString::RWCString ( const ConstSubString str)
inline

Converts from a const substring. The created string copies the substring represented by str.

Note
Behavior is undefined if str is a null substring.
RWCString::RWCString ( const std::string &  str)
inline

Constructs a string with data copied from str.

RWCString::RWCString ( const char *  str)
inline

Converts from the null-terminated character string str. The created string copies the data pointed to by str, up to the first terminating null.

Note
This function is incompatible with str strings with embedded nulls.
RWCString::RWCString ( const char *  str,
size_t  len 
)
inline

Constructs a string from the character string str. The created string copies the data pointed to by str. Exactly len bytes are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len bytes long.

RWCString::RWCString ( char  c)
inline

Constructs a string containing the single character c.

RWCString::RWCString ( signed char  c)
inline

Constructs a string containing the single signed character c.

RWCString::RWCString ( unsigned char  c)
inline

Constructs a string containing the single unsigned character c.

RWCString::RWCString ( char  c,
size_t  count 
)
inline

Constructs a string containing the character c repeated count times.

RWCString::RWCString ( RWSize_T  cap)
inline

Creates a string of length zero (the null string). The string's capacity (that is, the size it can grow to without resizing) is given by the parameter cap. We recommend creating an RWSize_T value from a numerical constant to pass into this constructor. While RWSize_T knows how to convert size_t values to itself, conforming compilers choose the conversion to char instead.

Member Function Documentation

RWCString & RWCString::append ( const RWCString str)
inline

Appends a copy of the string str to self. Returns a reference to self.

RWCString & RWCString::append ( const SubString str)
inline

Appends a copy of the string str to self. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::append ( const ConstSubString str)
inline

Appends a copy of the string str to self. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::append ( const RWCString str,
size_t  len 
)
inline

Appends the first len bytes of str to self. If len is greater than the length of str, the entire string is appended. Returns a reference to self.

RWCString & RWCString::append ( const std::string &  str)
inline

Appends a copy of the string str to self. Returns a reference to self.

RWCString & RWCString::append ( const std::string &  str,
size_t  len 
)
inline

Appends the first len bytes of str to self. If len is greater than the length of str, the entire string is appended. Returns a reference to self.

RWCString & RWCString::append ( const char *  str)
inline

Appends a copy of the null-terminated character string pointed to by str to self. Returns a reference to self.

Note
This function is incompatible with str strings with embedded nulls.
RWCString & RWCString::append ( const char *  str,
size_t  len 
)
inline

Appends a copy of the character string str to self. Exactly len bytes are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len bytes long. Returns a reference to self.

RWCString & RWCString::append ( char  c,
size_t  count = 1 
)
inline

Appends count copies of the character c to self. Returns a reference to self.

RWCString & RWCString::assign ( const RWCString str)
inline

Assigns a copy of the string str to self, replacing existing content. Returns a reference to self.

RWCString & RWCString::assign ( const std::string &  str)
inline

Assigns a copy of the string str to self, replacing existing content. Returns a reference to self.

RWCString & RWCString::assign ( const SubString str)
inline

Assigns a copy of the string str to self, replacing existing content. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::assign ( const ConstSubString str)
inline

Assigns a copy of the string str to self, replacing existing content. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::assign ( const char *  str)
inline

Assigns the null-terminated string pointed to by str to self, replacing existing content. Returns a reference to self.

Note
This function is incompatible with str strings with embedded nulls.
RWCString & RWCString::assign ( const char *  str,
size_t  len 
)
inline

Assigns a copy of the character string str to self, replacing existing content. Exactly len bytes are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len bytes long. Returns a reference to self.

RWCString & RWCString::assign ( char  c,
size_t  count = 1 
)
inline

Assigns count copies of the character c to self, replacing existing content. Returns a reference to self.

RWspace RWCString::binaryStoreSize ( ) const
inline

Returns the number of bytes necessary to store the object using the global functions:

static size_t RWCString::byteCount ( const char *  str,
size_t  nChars = RW_NPOS 
)
static

Given a multibyte sequence, str, and a number of multibyte characters to consider, nChars, this method calculates the number of bytes required to store the sequence. If nChars is RW_NPOS, then the method counts characters up to, but not including, the first NULL character in the sequence. The method returns the number of bytes required to represent the string. If an error occurs during the operation, RW_NPOS is returned.

size_t RWCString::capacity ( ) const
inline

Returns the current capacity of self. This is the number of bytes the string can hold without resizing.

size_t RWCString::capacity ( size_t  cap)
inline

A non-binding request to alter the capacity of self to cap. The capacity is never reduced below the current number of bytes. Returns the actual capacity.

int RWCString::collate ( const RWCString str) const
inline

Returns an int less than, greater than, or equal to zero, according to the result of calling the C++ Standard Library function std::strcoll() on self and the argument str. This supports locale-dependent collation.

Note
This function is incompatible with strings with embedded nulls.
int RWCString::collate ( const std::string &  str) const
inline

Returns an int less than, greater than, or equal to zero, according to the result of calling the C++ Standard Library function std::strcoll() on self and the argument str. This supports locale-dependent collation.

Note
This function is incompatible with strings with embedded nulls.
int RWCString::collate ( const char *  str) const
inline

Returns an int less than, greater than, or equal to zero, according to the result of calling the C++ Standard Library function std::strcoll() on self and the argument str. This supports locale-dependent collation.

Note
This function is incompatible with strings with embedded nulls.
int RWCString::compareTo ( const RWCString str,
caseCompare  cmp = exact 
) const
inline

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0 self precedes str.
0 self is equal to str.
>0 self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note
If cmp is not RWCString::exact, this function is incompatible with MBCS strings.
int RWCString::compareTo ( const SubString str,
caseCompare  cmp = exact 
) const
inline

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0 self precedes str.
0 self is equal to str.
>0 self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note
If cmp is not RWCString::exact, this function is incompatible with MBCS strings.
Behavior is undefined if str is a null substring.
int RWCString::compareTo ( const ConstSubString str,
caseCompare  cmp = exact 
) const
inline

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0 self precedes str.
0 self is equal to str.
>0 self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note
If cmp is not RWCString::exact, this function is incompatible with MBCS strings.
Behavior is undefined if str is a null substring.
int RWCString::compareTo ( const RWCString str,
caseCompare  cmp = exact 
) const
inline

This function is the equivalent of calling:

int RWCString::compareTo ( const std::string &  str,
caseCompare  cmp = exact 
) const
inline

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0 self precedes str.
0 self is equal to str.
>0 self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note
If cmp is not RWCString::exact, this function is incompatible with MBCS strings.
int RWCString::compareTo ( const std::string *  str,
caseCompare  cmp = exact 
) const
inline

This function is the equivalent of calling:

int RWCString::compareTo ( const char *  str,
caseCompare  cmp = exact 
) const
inline

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0 self precedes str.
0 self is equal to str.
>0 self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note
If cmp is not RWCString::exact, this function is incompatible with MBCS strings.
This function is incompatible with str strings with embedded nulls.
int RWCString::compareTo ( const char *  str,
size_t  len,
caseCompare  cmp = exact 
) const
inline

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0 self precedes str.
0 self is equal to str.
>0 self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note
If cmp is not RWCString::exact, this function is incompatible with MBCS strings.
bool RWCString::contains ( const RWCString str,
caseCompare  cmp = exact 
) const
inline

Returns false if RWCString::index(str, cmp) returns RW_NPOS, otherwise returns true.

bool RWCString::contains ( const SubString str,
caseCompare  cmp = exact 
) const
inline

Returns false if RWCString::index(str, cmp) returns RW_NPOS, otherwise returns true.

Note
Behavior is undefined if str is a null substring.
bool RWCString::contains ( const ConstSubString str,
caseCompare  cmp = exact 
) const
inline

Returns false if RWCString::index(str, cmp) returns RW_NPOS, otherwise returns true.

Note
Behavior is undefined if str is a null substring.
bool RWCString::contains ( const std::string &  str,
caseCompare  cmp = exact 
) const
inline

Returns false if RWCString::index(str, cmp) returns RW_NPOS, otherwise returns true.

bool RWCString::contains ( const char *  str,
caseCompare  cmp = exact 
) const
inline

Returns false if RWCString::index(str, cmp) returns RW_NPOS, otherwise returns true.

bool RWCString::contains ( const char *  str,
size_t  len,
caseCompare  cmp = exact 
) const
inline

Returns false if RWCString::index(str, len, cmp) returns RW_NPOS, otherwise returns true.

const char * RWCString::data ( void  ) const
inline

Provides access to the RWCString instances'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 becomes invalid. While the string is null-terminated, its length is still given by the member function length(). That is, it may contain embedded nulls.

size_t RWCString::first ( char  c) const
inline
Deprecated:
As of SourcePro 12, use RWCString::firstOf(char, size_t) const instead.
size_t RWCString::first ( char  c,
size_t   
) const
inline
Deprecated:
As of SourcePro 12, use RWCString::firstOf(char, size_t) const instead.
size_t RWCString::first ( const char *  str) const
inline
size_t RWCString::first ( const char *  str,
size_t  len 
) const
inline
size_t RWCString::firstNotOf ( char  c,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence of a character in self that is not c, starting at position pos. Returns RW_NPOS if there is no match.

size_t RWCString::firstNotOf ( const char *  str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character not in the null-terminated string str. Returns RW_NPOS if there is no match.

Note
This function is incompatible with str strings with embedded nulls.
size_t RWCString::firstNotOf ( const char *  str,
size_t  pos,
size_t  len 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character not in the first len bytes of str. Returns RW_NPOS if there is no match.

size_t RWCString::firstNotOf ( const RWCString str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character not in str. Returns RW_NPOS if there is no match.

size_t RWCString::firstNotOf ( const SubString str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character not in str. Returns RW_NPOS if there is no match.

Note
Behavior is undefined if str is a null substring.
size_t RWCString::firstNotOf ( const ConstSubString str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character not in str. Returns RW_NPOS if there is no match.

Note
Behavior is undefined if str is a null substring.
size_t RWCString::firstNotOf ( const std::string &  str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character not in str. Returns RW_NPOS if there is no match.

size_t RWCString::firstOf ( char  c,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence of the character c in self, starting at position pos. Returns RW_NPOS if there is no match.

size_t RWCString::firstOf ( const char *  str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character in the null-terminated string str. Returns RW_NPOS if there is no match.

Note
This function is incompatible with str strings with embedded nulls.
size_t RWCString::firstOf ( const char *  str,
size_t  pos,
size_t  len 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character in the first len bytes of str. Returns RW_NPOS if there is no match.

size_t RWCString::firstOf ( const RWCString str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character in str. Returns RW_NPOS if there is no match.

size_t RWCString::firstOf ( const SubString str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character in str. Returns RW_NPOS if there is no match.

Note
Behavior is undefined if str is a null substring.
size_t RWCString::firstOf ( const ConstSubString str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character in str. Returns RW_NPOS if there is no match.

Note
Behavior is undefined if str is a null substring.
size_t RWCString::firstOf ( const std::string &  str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character in str. Returns RW_NPOS if there is no match.

unsigned RWCString::hash ( const RWCString str)
inlinestatic

Returns the hash value of str as returned by hash(caseCompare) const, where caseCompare is RWCString::exact.

unsigned RWCString::hash ( caseCompare  cmp = exact) const

Returns a suitable hash value.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::index ( const RWCString pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Starting with index start, 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 cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::index ( const SubString pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Starting with index start, 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 cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
Behavior is undefined if str is a null substring.
size_t RWCString::index ( const ConstSubString pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Starting with index start, 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 cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
Behavior is undefined if str is a null substring.
size_t RWCString::index ( const RWCString pat,
size_t  patlen,
size_t  start,
caseCompare  cmp 
) const
inline

Pattern matching. Starting with index start, searches for the first occurrence of the first patlen bytes 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 cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::index ( const std::string &  pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Starting with index start, 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 cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::index ( const std::string &  pat,
size_t  patlen,
size_t  start,
caseCompare  cmp 
) const
inline

Pattern matching. Starting with index start, searches for the first occurrence of the first patlen bytes 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 cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::index ( const char *  pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Starting with index start, searches for the first occurrence of the null-terminated string 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 cmp.

Note
This function is incompatible with pat strings with embedded nulls.
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::index ( const char *  pat,
size_t  patlen,
size_t  start,
caseCompare  cmp 
) const
inline

Pattern matching. Starting with index start, searches for the first occurrence of the first patlen bytes 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 cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::index ( const char  pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Starting with index start, 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 cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::index ( const RWCRegexp re,
size_t  start = 0 
) const
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
size_t RWCString::index ( const RWCRegexp re,
size_t *  ext,
size_t  start = 0 
) const
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
size_t RWCString::index ( const RWCRExpr re,
size_t  start = 0 
) const
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
size_t RWCString::index ( const RWCRExpr re,
size_t *  ext,
size_t  start = 0 
) const
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
size_t RWCString::index ( const char *  re,
size_t *  ext,
size_t  start = 0 
) const
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
RWCString & RWCString::insert ( size_t  pos,
const RWCString str 
)
inline

Inserts a copy of the string str into self at index pos. Returns a reference to self.

RWCString & RWCString::insert ( size_t  pos,
const SubString str 
)
inline

Inserts a copy of the string str into self at index pos. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::insert ( size_t  pos,
const ConstSubString str 
)
inline

Inserts a copy of the string str into self at index pos. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::insert ( size_t  pos,
const RWCString str,
size_t  len 
)
inline

Inserts the first len bytes of str into self at index pos. If len is greater than the length of str, the entire string is inserted. Returns a reference to self.

RWCString & RWCString::insert ( size_t  pos,
const std::string &  str 
)
inline

Inserts a copy of the string str into self at index pos. Returns a reference to self.

RWCString & RWCString::insert ( size_t  pos,
const std::string &  str,
size_t  len 
)
inline

Inserts the first len bytes of str into self at index pos. If len is greater than the length of str, the entire string is inserted. Returns a reference to self.

RWCString & RWCString::insert ( size_t  pos,
const char *  str 
)
inline

Inserts a copy of the null-terminated string str into self at index pos. Returns a reference to self.

Note
This function is incompatible with str strings with embedded nulls.
RWCString & RWCString::insert ( size_t  pos,
const char *  str,
size_t  len 
)
inline

Inserts a copy of the first len bytes of str into self at byte position pos. Returns a reference to self.

RWCString & RWCString::insert ( size_t  pos,
char  c,
size_t  count 
)
inline

Inserts count instances of the character c into self at byte position pos. Returns a reference to self.

bool RWCString::isAscii ( ) const

Returns true if all bytes in self are between [0, 127].

bool RWCString::isNull ( void  ) const
inline

Returns true if this is a zero length string (i.e., the null string).

size_t RWCString::last ( char  c) const
inline
Deprecated:
As of SourcePro 12, use RWCString::lastOf(char, size_t) const instead.
size_t RWCString::last ( char  c,
size_t   
) const
inline
Deprecated:
As of SourcePro 12, use RWCString::lastOf(char, size_t) const instead.
size_t RWCString::last ( const char *  str) const
inline
size_t RWCString::last ( const char *  str,
size_t  len 
) const
inline
size_t RWCString::lastNotOf ( char  c,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence of a character in self that is not c, ending at position pos. Returns RW_NPOS if there is no match.

size_t RWCString::lastNotOf ( const char *  str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character not in the null-terminated string str. Returns RW_NPOS if there is no match.

Note
This function is incompatible with str strings with embedded nulls.
size_t RWCString::lastNotOf ( const char *  str,
size_t  pos,
size_t  len 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character not in the last len bytes of str. Returns RW_NPOS if there is no match.

size_t RWCString::lastNotOf ( const RWCString str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character not in str. Returns RW_NPOS if there is no match.

size_t RWCString::lastNotOf ( const SubString str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character not in str. Returns RW_NPOS if there is no match.

Note
Behavior is undefined if str is a null substring.
size_t RWCString::lastNotOf ( const ConstSubString str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character not in str. Returns RW_NPOS if there is no match.

Note
Behavior is undefined if str is a null substring.
size_t RWCString::lastNotOf ( const std::string &  str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character not in str. Returns RW_NPOS if there is no match.

size_t RWCString::lastOf ( char  c,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence of the character c in self, ending at position pos. Returns RW_NPOS if there is no match.

size_t RWCString::lastOf ( const char *  str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character in the null-terminated string str. Returns RW_NPOS if there is no match.

Note
This function is incompatible with str strings with embedded nulls.
size_t RWCString::lastOf ( const char *  str,
size_t  pos,
size_t  len 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character in the last len bytes of str. Returns RW_NPOS if there is no match.

size_t RWCString::lastOf ( const RWCString str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character in str. Returns RW_NPOS if there is no match.

size_t RWCString::lastOf ( const SubString str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character in str. Returns RW_NPOS if there is no match.

Note
Behavior is undefined if str is a null substring.
size_t RWCString::lastOf ( const ConstSubString str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character in str. Returns RW_NPOS if there is no match.

Note
Behavior is undefined if str is a null substring.
size_t RWCString::lastOf ( const std::string &  str,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence in self, ending at position pos, of any character in str. Returns RW_NPOS if there is no match.

size_t RWCString::length ( ) const
inline

Returns the number of bytes in self.

Note
If self contains any multibyte characters, RWCString::mbLength() should be used to determine the number of characters in self.
SubString RWCString::match ( const RWCRExpr re)
Deprecated:
As of SourcePro 12, use RWTRegex::search instead.
ConstSubString RWCString::match ( const RWCRExpr ) const
Deprecated:
As of SourcePro 12, use RWTRegex::search instead.
SubString RWCString::match ( const RWCRExpr re,
size_t  start 
)
Deprecated:
As of SourcePro 12, use RWTRegex::search instead.
ConstSubString RWCString::match ( const RWCRExpr re,
size_t  start 
) const
Deprecated:
As of SourcePro 12, use RWTRegex::search instead.
size_t RWCString::mbLength ( ) const
inline

Returns the number of multibyte characters in self, according to the C++ Standard Library function std::mblen(). Returns RW_NPOS if a bad character is encountered. If self does not contain any multibyte characters, then mbLength() == length().

static size_t RWCString::mbLength ( const char *  str,
size_t  nBytes = RW_NPOS 
)
static

Given a multibyte character sequence, str, and a number of bytes to consider, nBytes, this method calculates the number of multibyte characters in the sequence. If nBytes is RW_NPOS, then the method counts the characters up to, but not including, the first occurrence of a NULL character. The method returns the length, in characters, of the input multibyte sequence if successful. If an error occurs in the conversion, then RW_NPOS is returned.

RWCString::operator const char * ( ) const
inline

The equivalent of calling RWCString::data() on self.

char & RWCString::operator() ( size_t  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. Bounds checking is performed if the preprocessor macro RWBOUNDS_CHECK has been defined before including <rw/cstring.h>.

Exceptions
RWBoundsErrif RWBOUNDS_CHECK is defined and the index is out of range.
char RWCString::operator() ( size_t  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. Bounds checking is performed if the preprocessor macro RWBOUNDS_CHECK has been defined before including <rw/cstring.h>.

Exceptions
RWBoundsErrif RWBOUNDS_CHECK is defined and the index is out of range.
RWCSubString RWCString::operator() ( size_t  start,
size_t  len 
)
inline

Substring operator. Returns a substring of self with length len, starting at index start. The sum of start plus len must be less than or equal to the string length.

Exceptions
RWBoundsErrif the library was built using the RW_DEBUG flag, and start or len are out of range.
RWCConstSubString RWCString::operator() ( size_t  start,
size_t  len 
) const
inline

Substring operator. Returns a substring of self with length len, starting at index start. The sum of start plus len must be less than or equal to the string length.

Exceptions
RWBoundsErrif the library was built using the RW_DEBUG flag, and start or len are out of range.
SubString RWCString::operator() ( const RWCRegexp re)
Deprecated:
As of SourcePro 12, use RWTRegex::search instead.
ConstSubString RWCString::operator() ( const RWCRegexp re) const
Deprecated:
As of SourcePro 12, use RWTRegex::search instead.
SubString RWCString::operator() ( const RWCRegexp re,
size_t  start 
)
Deprecated:
As of SourcePro 12, use RWTRegex::search instead.
ConstSubString RWCString::operator() ( const RWCRegexp re,
size_t  start 
) const
Deprecated:
As of SourcePro 12, use RWTRegex::search instead.
RWCString & RWCString::operator+= ( const RWCString str)
inline

Appends the string str to self. Returns a reference to self.

RWCString & RWCString::operator+= ( const SubString str)
inline

Appends the string str to self. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::operator+= ( const ConstSubString str)
inline

Appends the string str to self. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::operator+= ( const std::string &  str)
inline

Appends the string str to self. Returns a reference to self.

RWCString & RWCString::operator+= ( const char *  str)
inline

Appends the null-terminated character string pointed to by str to self. Returns a reference to self.

Note
This function is incompatible with str strings with embedded nulls.
RWCString & RWCString::operator+= ( char  c)
inline

Appends the character c to self. Returns a reference to self.

RWCString & RWCString::operator= ( const RWCString str)
inline

Assignment operator. The string copies the data from str. Returns a reference to self.

RWCString & RWCString::operator= ( RWCString &&  str)
inline

Move assignment. Self takes ownership of the data owned by str.

Condition:
This method is available only on platforms with rvalue reference support.
RWCString & RWCString::operator= ( const SubString str)
inline

Assignment operator. The string copies the data from str. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::operator= ( const ConstSubString str)
inline

Assignment operator. The string copies the data from str. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::operator= ( const std::string &  str)
inline

Assignment operator. The string copies the data from str. Returns a reference to self.

RWCString & RWCString::operator= ( const char *  str)
inline

Assignment operator. Copies the null-terminated character string pointed to by str into self. Returns a reference to self.

Note
This function is incompatible with str strings with embedded nulls.
RWCString & RWCString::operator= ( char  c)
inline

Assignment operator. Copies the character c into self.

char & RWCString::operator[] ( char  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( char  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( signed char  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( signed char  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( short  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( short  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( int  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( int  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( long  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( long  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( long long  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( long long  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( unsigned char  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( unsigned char  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( unsigned short  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( unsigned short  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( unsigned int  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( unsigned int  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( unsigned long  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( unsigned long  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char & RWCString::operator[] ( unsigned long long  i)
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
char RWCString::operator[] ( unsigned long long  i) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. i is converted to a size_t and bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
RWCString & RWCString::prepend ( const RWCString str)
inline

Prepends a copy of the string str to self. Returns a reference to self.

RWCString & RWCString::prepend ( const SubString str)
inline

Prepends a copy of the string str to self. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::prepend ( const ConstSubString str)
inline

Prepends a copy of the string str to self. Returns a reference to self.

Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::prepend ( const RWCString str,
size_t  len 
)
inline

Prepends the first len bytes of str to self. If len is greater than the length of str, the entire string is prepended. Returns a reference to self.

RWCString & RWCString::prepend ( const std::string &  str)
inline

Prepends a copy of the string str to self. Returns a reference to self.

RWCString & RWCString::prepend ( const std::string &  str,
size_t  len 
)
inline

Prepends the first len bytes of str to self. If len is greater than the length of str, the entire string is prepended. Returns a reference to self.

RWCString & RWCString::prepend ( const char *  str)
inline

Prepends a copy of the null-terminated character string pointed to by str to self. Returns a reference to self.

Note
This function is incompatible with str strings with embedded nulls.
RWCString & RWCString::prepend ( const char *  str,
size_t  len 
)
inline

Prepends a copy of the character string str to self. Exactly len bytes are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len bytes long. Returns a reference to self.

RWCString & RWCString::prepend ( char  c,
size_t  count = 1 
)
inline

Prepends count copies of character c to self. Returns a reference to self.

std::istream& RWCString::readFile ( std::istream &  strm)

Reads bytes from the input stream strm, replacing the previous contents of self, until EOF is reached. Null characters are treated the same as other characters.

std::istream& RWCString::readLine ( std::istream &  strm,
bool  skipWhite = true 
)

Reads bytes from the input stream strm, replacing the previous contents of self, until a newline (or EOF) is encountered. The newline is removed from the input stream but is not stored. Null characters are treated the same as other characters. If the skipWhite argument is true, then leading white space is skipped (using the iostream library manipulator ws).

std::istream& RWCString::readString ( std::istream &  strm)

Reads bytes from the input stream strm, replacing the previous contents of self, until a null terminator (or EOF) is encountered.

std::istream& RWCString::readToDelim ( std::istream &  strm,
char  delim = '\n' 
)

Reads bytes from the input stream strm, replacing the previous contents of self, until the delimiting character delim (or EOF) is encountered. The delimiter is removed from the input stream but is not stored.

std::istream& RWCString::readToken ( std::istream &  strm)

White space is skipped before reading from strm. Bytes are then read from the input stream strm, replacing previous contents of self, until trailing white space or EOF is encountered. The white space is left on the input stream. Null characters are treated the same as other characters. White space is identified by the C++ Standard Library function std::isspace().

Note
This function is incompatible with streams containing MBCS.
RWCString & RWCString::remove ( size_t  pos)
inline

Removes the bytes from index pos, which must be no greater than length(), to the end of string. Returns a reference to self.

RWCString & RWCString::remove ( size_t  pos,
size_t  len 
)
inline

Removes len bytes or to the end of string (whichever comes first) starting at index pos, which must be no greater than length(). Returns a reference to self.

RWCString & RWCString::replace ( size_t  pos,
size_t  len,
const RWCString str 
)
inline

Replaces the substring beginning at pos and of length len with the string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Exceptions
RWBoundsErrIf pos is greater than the length of self.
RWCString & RWCString::replace ( size_t  pos,
size_t  len,
const SubString str 
)
inline

Replaces the substring beginning at pos and of length len with the string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Exceptions
RWBoundsErrIf pos is greater than the length of self.
Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::replace ( size_t  pos,
size_t  len,
const ConstSubString str 
)
inline

Replaces the substring beginning at pos and of length len with the string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Exceptions
RWBoundsErrIf pos is greater than the length of self.
Note
Behavior is undefined if str is a null substring.
RWCString & RWCString::replace ( size_t  pos,
size_t  len,
const RWCString str,
size_t  strLen 
)
inline

Replaces the substring beginning at pos and of length len with the first strLen bytes of string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string. If strLen is greater than the length of str, all of str is used.

Returns a reference to self.

Exceptions
RWBoundsErrIf pos is greater than the length of self.
RWCString & RWCString::replace ( size_t  pos,
size_t  len,
const std::string &  str 
)
inline

Replaces the substring beginning at pos and of length len with the string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Exceptions
RWBoundsErrIf pos is greater than the length of self.
RWCString & RWCString::replace ( size_t  pos,
size_t  len,
const std::string &  str,
size_t  strLen 
)
inline

Replaces the substring beginning at pos and of length len with the first strLen bytes of string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string. If strLen is greater than the length of str, all of str is used.

Returns a reference to self.

Exceptions
RWBoundsErrIf pos is greater than the length of self.
RWCString & RWCString::replace ( size_t  pos,
size_t  len,
const char *  str 
)
inline

Replaces the substring beginning at pos and of length len with the null-terminated string str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Note
This function is incompatible with str strings with embedded nulls.
Exceptions
RWBoundsErrIf pos is greater than the length of self.
RWCString & RWCString::replace ( size_t  pos,
size_t  len,
const char *  str,
size_t  strLen 
)
inline

Replaces the substring beginning at pos and of length len with strLen bytes from str. If the sum of pos and len is greater than the length of self, the substring replaced is from pos to end of string.

Returns a reference to self.

Exceptions
RWBoundsErrIf pos is greater than the length of self.
RWCString& RWCString::replace ( const RWCRExpr re,
const RWCString str,
scopeType  scope = one 
)
Deprecated:
As of SourcePro 12, use RWTRegex::replace instead.
RWCString& RWCString::replace ( const RWCRExpr re,
const char *  str,
scopeType  scope = one 
)
Deprecated:
As of SourcePro 12, use RWTRegex::replace instead.
void RWCString::resize ( size_t  len)
inline

Changes the length of self to len bytes, adding blanks (i.e., ' ') or truncating as necessary.

size_t RWCString::rindex ( const RWCString pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Searches for the last occurrence of pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::rindex ( const SubString pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Searches for the last occurrence of pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
Behavior is undefined if str is a null substring.
size_t RWCString::rindex ( const ConstSubString pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Searches for the last occurrence of pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
Behavior is undefined if str is a null substring.
size_t RWCString::rindex ( const RWCString pat,
size_t  patlen,
size_t  end,
caseCompare  cmp 
) const
inline

Pattern matching. Searches for the last occurrence of the first patlen bytes from pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::rindex ( const std::string &  pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Searches for the last occurrence of pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::rindex ( const std::string &  pat,
size_t  patlen,
size_t  end,
caseCompare  cmp 
) const
inline

Pattern matching. Searches for the last occurrence of the first patlen bytes from pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::rindex ( const char *  pat,
caseCompare  cmp 
) const
inline

Pattern matching. Searches for the last occurrence of the null-terminated string 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 cmp.

Note
This function is incompatible with pat strings with embedded nulls.
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::rindex ( const char *  pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Searches for the last occurrence of the null-terminated string pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
This function is incompatible with pat strings with embedded nulls.
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::rindex ( const char *  pat,
size_t  patlen,
size_t  end,
caseCompare  cmp 
) const
inline

Pattern matching. Searches for the last occurrence of the first patlen bytes from pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWCString::rindex ( const char  pat,
size_t  end = RW_NPOS,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Searches for the last occurrence of pat in self that occurs before index end and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
void RWCString::shrink ( )
inline

Attempts to minimize the memory used by self by reducing the capacity to the minimum required to support the current string length. This operation is non-binding, and may be ignored by the implementation.

std::string & RWCString::std ( )
inline

Returns the underlying std::string representation of self.

Note
  • This member function is unavailable on RWCString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteCString
const std::string & RWCString::std ( ) const
inline

Returns the underlying std::string representation of self.

Note
  • This member function is unavailable on RWCString if RW_COPY_ON_WRITE_STRING is defined.
  • This member function is unavailable on RWCopyOnWriteCString
SubString RWCString::strip ( stripType  st = trailing,
char  c = ' ' 
)

Returns a substring of self where the character c has been stripped off the beginning, end, or both ends of the string, depending on st.

ConstSubString RWCString::strip ( stripType  st = trailing,
char  c = ' ' 
) const

Returns a substring of self where the character c has been stripped off the beginning, end, or both ends of the string, depending on st.

RWCString::SubString RWCString::subString ( const char *  pat,
size_t  start = 0,
caseCompare  cmp = exact 
)
inline

Starting at start, returns a substring representing the first occurrence of the null-terminated string pat in self. If pat is not found, a null substring instance is returned.

Note
This function is incompatible with pat strings with embedded nulls.
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
RWCConstSubString RWCString::subString ( const char *  pat,
size_t  start = 0,
caseCompare  cmp = exact 
) const
inline

Starting at start, returns a substring representing the first occurrence of the null-terminated string pat in self. If pat is not found, a null substring instance is returned.

Note
This function is incompatible with pat strings with embedded nulls.
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
void RWCString::swap ( RWCString str)
inline

Swaps the contents of str with self.

void RWCString::toLower ( )
inline

Changes all upper-case letters in self to lower-case, using the C Standard Library facilities declared in <ctype.h>.

Note
This function is incompatible with MBCS strings.
void RWCString::toUpper ( )
inline

Changes all lower-case letters in self to upper-case, using the C Standard Library facilities declared in <ctype.h>.

Note
This function is incompatible with MBCS strings.

Friends And Related Function Documentation

bool operator!= ( const RWCString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const RWCString lhs,
const RWCSubString rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const RWCSubString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const RWCString lhs,
const RWCConstSubString rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const RWCConstSubString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const RWCString lhs,
const std::string &  rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const std::string &  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const RWCString lhs,
const char *  rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const char *  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( const RWCString lhs,
char  rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
bool operator!= ( char  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs == rhs)
RWCString operator+ ( const RWCString lhs,
const RWCString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCString lhs,
const RWCSubString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCSubString lhs,
const RWCString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCString lhs,
const RWCConstSubString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCConstSubString lhs,
const RWCString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCString lhs,
const std::string &  rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const std::string &  lhs,
const RWCString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCString lhs,
const char *  rhs 
)
related

Concatenates lhs and the null-terminated string rhs and returns the resulting string.

Note
This function is incompatible with rhs strings with embedded nulls.
RWCString operator+ ( const char *  lhs,
const RWCString rhs 
)
related

Concatenates the null-terminated string lhs and rhs and returns the resulting string.

Note
This function is incompatible with lhs strings with embedded nulls.
RWCString operator+ ( const RWCSubString lhs,
const RWCSubString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCSubString lhs,
const RWCConstSubString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCConstSubString lhs,
const RWCSubString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCSubString lhs,
const std::string &  rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const std::string &  lhs,
const RWCSubString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCSubString lhs,
const char *  rhs 
)
related

Concatenates lhs and the null-terminated string rhs and returns the resulting string.

Note
This function is incompatible with rhs strings with embedded nulls.
RWCString operator+ ( const char *  lhs,
const RWCSubString rhs 
)
related

Concatenates the null-terminated string lhs and rhs and returns the resulting string.

Note
This function is incompatible with lhs strings with embedded nulls.
RWCString operator+ ( const RWCConstSubString lhs,
const RWCConstSubString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCConstSubString lhs,
const std::string &  rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const std::string &  lhs,
const RWCConstSubString rhs 
)
related

Concatenates lhs and rhs and returns the resulting string.

RWCString operator+ ( const RWCConstSubString lhs,
const char *  rhs 
)
related

Concatenates lhs and the null-terminated string rhs and returns the resulting string.

Note
This function is incompatible with rhs strings with embedded nulls.
RWCString operator+ ( const char *  lhs,
const RWCConstSubString rhs 
)
related

Concatenates the null-terminated string lhs and rhs and returns the resulting string.

Note
This function is incompatible with lhs strings with embedded nulls.
bool operator< ( const RWCString lhs,
const RWCString rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator< ( const RWCString lhs,
const RWCSubString rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator< ( const RWCSubString lhs,
const RWCString rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator< ( const RWCString lhs,
const RWCConstSubString rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator< ( const RWCConstSubString lhs,
const RWCString rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator< ( const RWCString lhs,
const std::string &  rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator< ( const std::string &  lhs,
const RWCString rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator< ( const RWCString lhs,
const char *  rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

Note
This function is incompatible with rhs strings with embedded nulls.
bool operator< ( const char *  lhs,
const RWCString rhs 
)
related

Returns true if lhs lexicographically precedes rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

Note
This function is incompatible with lhs strings with embedded nulls.
bool operator< ( const RWCString lhs,
char  rhs 
)
related

Returns true if lhs is empty or the first character in lhs is less than rhs. Otherwise returns false.

bool operator< ( char  lhs,
const RWCString rhs 
)
related

Returns true if the length of rhs is at least one and the first character of rhs is greater than lhs.

RWFile & operator<< ( RWFile file,
const RWCString str 
)
related

Saves string str to an RWFile.

RWvostream & operator<< ( RWvostream vos,
const RWCString str 
)
related

Saves string str to a virtual stream.

std::ostream & operator<< ( std::ostream &  os,
const RWCString str 
)
related

Outputs an RWCString on std::ostream os.

bool operator<= ( const RWCString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const RWCString lhs,
const RWCSubString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const RWCSubString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const RWCString lhs,
const RWCConstSubString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const RWCConstSubString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const RWCString lhs,
const std::string &  rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const std::string &  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const RWCString lhs,
const char *  rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const char *  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( const RWCString lhs,
char  rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator<= ( char  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator== ( const RWCString lhs,
const RWCString rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWCString lhs,
const RWCSubString rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWCSubString lhs,
const RWCString rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWCString lhs,
const RWCConstSubString rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWCConstSubString lhs,
const RWCString rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWCString lhs,
const std::string &  rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator== ( const std::string &  lhs,
const RWCString rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

bool operator== ( const RWCString lhs,
const char *  rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

Note
This function is incompatible with rhs strings with embedded nulls.
bool operator== ( const char *  lhs,
const RWCString rhs 
)
related

Returns true if lhs is lexicographically equal to rhs. Otherwise returns false. Use member RWCString::collate() or RWCString::strXForm() for locale-sensitive comparisons.

Note
This function is incompatible with lhs strings with embedded nulls.
bool operator== ( const RWCString lhs,
char  rhs 
)
related

Returns true if lhs has a length of one and the first character lhs is identical to the char rhs.

bool operator== ( char  lhs,
const RWCString rhs 
)
related

Returns true if rhs has a length of one and the first character rhs is identical to the char lhs.

bool operator> ( const RWCString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const RWCString lhs,
const RWCSubString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const RWCSubString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const RWCString lhs,
const RWCConstSubString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const RWCConstSubString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const RWCString lhs,
const std::string &  rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const std::string &  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const RWCString lhs,
const char *  rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const char *  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( const RWCString lhs,
char  rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator> ( char  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(rhs < lhs)
bool operator>= ( const RWCString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const RWCString lhs,
const RWCSubString rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const RWCSubString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const RWCString lhs,
const RWCConstSubString rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const RWCConstSubString lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const RWCString lhs,
const std::string &  rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const std::string &  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const RWCString lhs,
const char *  rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const char *  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( const RWCString lhs,
char  rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
bool operator>= ( char  lhs,
const RWCString rhs 
)
related

The equivalent of calling:

!(lhs < rhs)
RWFile & operator>> ( RWFile file,
RWCString str 
)
related

Restores a string into str from an RWFile, replacing the previous contents of str. If the file produces an error on extraction, the operator returns the original string contents unmodified. Be sure to check the file to determine if an extraction error occurred.

RWvistream & operator>> ( RWvistream vis,
RWCString str 
)
related

Restores a string into str from a virtual stream, replacing the previous contents of str. If the virtual stream produces an error on extraction, the operator returns the original string contents unmodified. Be sure to check the virtual stream to determine if an extraction error occurred.

std::istream & operator>> ( std::istream &  is,
RWCString str 
)
related

Calls RWCString::readToken(std::istream&). That is, a token is read from the input stream is.

RWCString strXForm ( const RWCString str)
related

Returns the result of applying std::strxfrm() to str to allow quicker collation than RWCString::collate().

Note
This function is incompatible with str strings with embedded nulls.
RWCString strXForm ( const std::string &  str)
related
Deprecated:
As of SourcePro 12, use strXForm(const RWCString&) instead.
RWCString toLower ( const RWCString str)
related

Returns a copy of str with all upper-case characters replaced with lower-case characters. This function is the equivalent of calling:

RWCString tmp(str);
tmp.toLower();
RWCString toUpper ( const RWCString str)
related

Returns a copy of str with all lower-case characters replaced with upper-case characters. This function is the equivalent of calling:

RWCString tmp(str);
tmp.toUpper();

Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.