Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress C++ API Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::CString

Group:  Core String Manipulation


Does not inherit

Local Index

Members

Header File

#include rwsf/core/CString.h

Description

Class rwsf::CString offers powerful and convenient facilities for manipulating strings.

Although the class is primarily intended to be used to handle single-byte character sets (SBCS; such as 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 constchar* must not be passed a value of zero. This is detected in the debug version of the library.

A separate class rwsf::CSubString supports substring extraction and modification operations.

Deprecated. Use std::string instead.

Public Enums

caseCompare { exact, ignoreCase, ignoreCaseStrict }
stripType { leading, trailing, both }

Public Constructors

CString();
CString(size_t ic);
CString(const CString & str);
CString(const char * cstr);
CString(const char * cstr,
    size_t len);
CString(char c,
    size_t rep);
CString(const CSubString & str);
CString(const std::string & str);

Public Destructors

~CString();

Public Static Member Functions

size_t
byteCount(const char * cstr,
    size_t nChars = RWSF_NPOS);
unsigned
hash(const CString & str);
size_t
mbLength(const char * cstr,
    size_t nBytes = RWSF_NPOS);

Public Member Functions

CString &
append(const char * cstr);
CString &
append(const char * cstr,
    size_t len);
CString &
append(const CString & str);
CString &
append(const CString & str,
    size_t len);
CString &
append(char c,
    size_t rep = 1);
size_t
capacity() const;
size_t
capacity(size_t capac);
int
collate(const char * cstr) const;
int
collate(const CString & str) const;
int
compareTo(const CString & str,
    caseCompare cmp = exact) const;
int
compareTo(const char * cstr,
    caseCompare cmp = exact) const;
int
compareTo(const CString * str,
    caseCompare cmp = exact) const;
bool
contains(const char * pat,
    caseCompare cmp = exact) const;
bool
contains(const CString & pat,
    caseCompare cmp = exact) const;
CString
copy() const;
const char *
data() const;
size_t
first(char c) const;
size_t
first(char c,
    size_t i) const;
size_t
first(const char * cstr) const;
size_t
first(const char * cstr,
    size_t i) const;
unsigned
hash(caseCompare cmp = exact) const;
size_t
index(const char pat,
    size_t i = 0,
    caseCompare cmp = exact) const;
size_t
index(const char * pat,
    size_t i = 0,
    caseCompare cmp = exact) const;
size_t
index(const CString & s,
    size_t i = 0,
    caseCompare cmp = exact) const;
size_t
index(const char * pat,
    size_t patlen,
    size_t i,
    caseCompare cmp) const;
size_t
index(const CString & s,
    size_t patlen,
    size_t i,
    caseCompare cmp) const;
CString &
insert(size_t pos,
    const char * cstr);
CString &
insert(size_t pos,
    const char * cstr,
    size_t len);
CString &
insert(size_t pos,
    const CString & str);
CString &
insert(size_t pos,
    const CString & str,
    size_t len);
bool
isAscii() const;
bool
isNull() const;
size_t
last(char c) const;
size_t
last(char c,
    size_t i) const;
size_t
length() const;
size_t
mbLength() const;
CString &
prepend(const char * cstr);
CString &
prepend(const char * cstr,
    size_t len);
CString &
prepend(const CString & str);
CString &
prepend(const CString & str,
    size_t len);
CString &
prepend(char c,
    size_t rep = 1);
CString &
remove(size_t pos);
CString &
remove(size_t pos,
    size_t N);
CString &
replace(size_t pos,
    size_t N,
    const char * cstr);
CString &
replace(size_t pos,
    size_t N,
    const char * cstr,
    size_t len);
CString &
replace(size_t pos,
    size_t N,
    const CString & str);
CString &
replace(size_t pos,
    size_t N,
    const CString &,
    size_t len);
void
resize(size_t n);
CSubString
strip(stripType s = trailing,
    char c = ' ');
CSubString
strip(stripType s = trailing,
    char c = ' ') const;
CSubString
stripWhitespace(stripType s = trailing);
CSubString
stripWhitespace(stripType s = trailing) const;
CSubString
subString(const char * pat,
    size_t start = 0,
    caseCompare = exact) const;
CSubString
subString(const char * pat,
    size_t start = 0,
    caseCompare = exact);
void
toLower();
void
toUpper();

Public Operators

char
operator()(size_t i) const;
char &
operator()(size_t i);
CSubString
operator()(size_t start,
    size_t len) const;
CSubString
operator()(size_t start,
    size_t len);
char &
operator[](short);
char &
operator[](int);
char &
operator[](long);
char &
operator[](unsigned short);
char &
operator[](unsigned int);
char &
operator[](unsigned long);
char &
operator[](rwsflonglong);
char &
operator[](rwsfulonglong);
char
operator[](short) const;
char
operator[](int) const;
char
operator[](long) const;
char
operator[](unsigned short) const;
char
operator[](unsigned int) const;
char
operator[](unsigned long) const;
char
operator[](rwsflonglong) const;
char
operator[](rwsfulonglong) const;
CString &
operator+=(const char * cstr);
CString &
operator+=(const CString & str);
CString &
operator+=(char c);
CString &
operator=(const char * cstr);
CString &
operator=(const CString & str);
operator std::string() const;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.