SourcePro® 2022.1 |
SourcePro® API Reference Guide |
Offers powerful and convenient facilities for manipulating wide character strings. More...
#include <rw/wstring.h>
Public Types | |
enum | ascii_ { ascii } |
enum | caseCompare { exact, ignoreCase, ignoreCaseStrict } |
typedef RWWConstSubString | ConstSubString |
enum | multiByte_ { multiByte } |
enum | stripType { leading, trailing, both } |
typedef RWWSubString | SubString |
Public Member Functions | |
RWWString () | |
RWWString (const std::wstring &str) | |
RWWString (const RWWString &str) | |
RWWString (RWWString &&str) | |
RWWString (RWSize_T cap) | |
RWWString (wchar_t c) | |
RWWString (wchar_t c, size_t count) | |
RWWString (const wchar_t *str) | |
RWWString (const wchar_t *str, size_t len) | |
RWWString (char c) | |
RWWString (char c, size_t count) | |
RWWString (signed char c) | |
RWWString (unsigned char c) | |
RWWString (const char *str, ascii_) | |
RWWString (const RWCString &str, ascii_) | |
RWWString (const char *str, multiByte_) | |
RWWString (const RWCString &str, multiByte_) | |
RWWString (const char *str, size_t len, ascii_) | |
RWWString (const char *str, size_t len, multiByte_) | |
RWWString (const SubString &str) | |
RWWString (const ConstSubString &str) | |
RWWString & | append (wchar_t c, size_t count=1) |
RWWString & | append (const wchar_t *str) |
RWWString & | append (const wchar_t *str, size_t len) |
RWWString & | append (const std::wstring &str) |
RWWString & | append (const RWWString &str) |
RWWString & | append (const std::wstring &str, size_t len) |
RWWString & | append (const RWWString &str, size_t len) |
RWWString & | assign (const RWWString &str) |
RWWString & | assign (const std::wstring &str) |
RWWString & | assign (const SubString &str) |
RWWString & | assign (const ConstSubString &str) |
RWWString & | assign (const wchar_t *str) |
RWWString & | assign (const wchar_t *str, size_t len) |
RWWString & | assign (const wchar_t c, size_t count=1) |
RWspace | binaryStoreSize () const |
size_t | capacity () const |
size_t | capacity (size_t cap) |
int | collate (const wchar_t *str) const |
int | collate (const std::wstring &str) const |
int | collate (const RWWString &str) const |
int | compareTo (const RWWString &str, caseCompare cmp=exact) const |
int | compareTo (const wchar_t *str, caseCompare cmp=exact) const |
int | compareTo (const std::wstring &str, caseCompare cmp=exact) const |
int | compareTo (const std::wstring *str, caseCompare cmp=exact) const |
int | compareTo (const RWWString *str, caseCompare cmp=exact) const |
bool | contains (const wchar_t *str, caseCompare cmp=exact) const |
bool | contains (const std::wstring &str, caseCompare cmp=exact) const |
bool | contains (const RWWString &str, caseCompare cmp=exact) const |
const wchar_t * | data () const |
size_t | first (wchar_t c) const |
size_t | first (wchar_t c, size_t) const |
size_t | first (const wchar_t *str) const |
size_t | first (const wchar_t *str, size_t len) const |
unsigned long | hash (caseCompare cmp=exact) const |
size_t | index (const wchar_t *pat, size_t start=0, caseCompare cmp=exact) const |
size_t | index (const std::wstring &pat, size_t start=0, caseCompare cmp=exact) const |
size_t | index (const RWWString &pat, size_t start=0, caseCompare cmp=exact) const |
size_t | index (const wchar_t *pat, size_t patlen, size_t start, caseCompare cmp) const |
size_t | index (const std::wstring &pat, size_t patlen, size_t start, caseCompare cmp) const |
size_t | index (const RWWString &pat, size_t patlen, size_t start, caseCompare cmp) const |
RWWString & | insert (size_t pos, wchar_t c, size_t count) |
RWWString & | insert (size_t pos, const wchar_t *str) |
RWWString & | insert (size_t pos, const wchar_t *str, size_t len) |
RWWString & | insert (size_t pos, const std::wstring &str) |
RWWString & | insert (size_t pos, const RWWString &str) |
RWWString & | insert (size_t pos, const std::wstring &str, size_t len) |
RWWString & | insert (size_t pos, const RWWString &str, size_t len) |
bool | isAscii () const |
bool | isNull () const |
size_t | last (wchar_t c) const |
size_t | last (wchar_t c, size_t) const |
size_t | last (const wchar_t *str) const |
size_t | last (const wchar_t *str, size_t len) const |
size_t | length () const |
operator const wchar_t * () const | |
bool | operator!= (const RWWString &rhs) const |
wchar_t & | operator() (size_t i) |
wchar_t | operator() (size_t i) const |
SubString | operator() (size_t start, size_t len) |
ConstSubString | operator() (size_t start, size_t len) const |
RWWString & | operator+= (wchar_t c) |
RWWString & | operator+= (const wchar_t *str) |
RWWString & | operator+= (const std::wstring &str) |
RWWString & | operator+= (const RWWString &str) |
bool | operator< (const RWWString &rhs) const |
RWWString & | operator= (wchar_t c) |
RWWString & | operator= (const wchar_t *str) |
RWWString & | operator= (const std::wstring &str) |
RWWString & | operator= (const RWWString &str) |
RWWString & | operator= (const SubString &str) |
RWWString & | operator= (const ConstSubString &str) |
RWWString & | operator= (RWWString &&str) |
bool | operator== (const RWWString &rhs) const |
bool | operator> (const RWWString &rhs) const |
wchar_t & | operator[] (short i) |
wchar_t & | operator[] (int i) |
wchar_t & | operator[] (long i) |
wchar_t & | operator[] (unsigned short i) |
wchar_t & | operator[] (unsigned int i) |
wchar_t & | operator[] (unsigned long i) |
wchar_t | operator[] (short i) const |
wchar_t | operator[] (int i) const |
wchar_t | operator[] (long i) const |
wchar_t | operator[] (unsigned short i) const |
wchar_t | operator[] (unsigned int i) const |
wchar_t | operator[] (unsigned long i) const |
wchar_t & | operator[] (long long i) |
wchar_t & | operator[] (unsigned long long i) |
wchar_t | operator[] (long long i) const |
wchar_t | operator[] (unsigned long long i) const |
RWWString & | prepend (wchar_t c, size_t count=1) |
RWWString & | prepend (const wchar_t *str) |
RWWString & | prepend (const wchar_t *str, size_t len) |
RWWString & | prepend (const std::wstring &str) |
RWWString & | prepend (const RWWString &str) |
RWWString & | prepend (const std::wstring &str, size_t len) |
RWWString & | prepend (const RWWString &str, size_t len) |
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) |
std::istream & | readToDelim (std::istream &strm, wchar_t delim) |
std::istream & | readToken (std::istream &strm) |
std::wistream & | readToken (std::wistream &strm) |
RWWString & | remove (size_t pos) |
RWWString & | remove (size_t pos, size_t len) |
RWWString & | replace (size_t pos, size_t len, const wchar_t *str) |
RWWString & | replace (size_t pos, size_t len, const std::wstring &str) |
RWWString & | replace (size_t pos, size_t len, const RWWString &str) |
RWWString & | replace (size_t pos, size_t len, const wchar_t *str, size_t strLen) |
RWWString & | replace (size_t pos, size_t len, const std::wstring &str, size_t strLen) |
RWWString & | replace (size_t pos, size_t len, const RWWString &str, size_t strLen) |
void | resize (size_t len) |
size_t | rindex (const wchar_t *pat, caseCompare cmp) const |
size_t | rindex (const wchar_t *pat, size_t end=RW_NPOS, caseCompare cmp=exact) const |
size_t | rindex (const std::wstring &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const |
size_t | rindex (const RWWString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const |
size_t | rindex (const wchar_t *pat, size_t patlen, size_t end, caseCompare cmp) const |
size_t | rindex (const std::wstring &pat, size_t patlen, size_t end, caseCompare cmp) const |
size_t | rindex (const RWWString &pat, size_t patlen, size_t end, caseCompare cmp) const |
std::wstring & | std () |
const std::wstring & | std () const |
SubString | strip (stripType st=trailing, wchar_t c=L' ') |
ConstSubString | strip (stripType st=trailing, wchar_t c=L' ') const |
SubString | subString (const wchar_t *pat, size_t start=0, caseCompare cmp=exact) |
ConstSubString | subString (const wchar_t *pat, size_t start=0, caseCompare cmp=exact) const |
void | swap (RWWString &str) |
RWCString | toAscii () const |
void | toLower () |
RWCString | toMultiByte () const |
void | toUpper () |
Static Public Member Functions | |
static RWWString | fromAscii (const RWCString &str) |
static RWWString | fromMultiByte (const RWCString &str) |
static unsigned | hash (const RWWString &wstr) |
static size_t | initialCapacity (size_t capacity=15) |
static size_t | maxWaste (size_t maxwaste=16) |
static size_t | resizeIncrement (size_t increment=16) |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator!= (const RWWString &lhs, const wchar_t *rhs) |
bool | operator!= (const wchar_t *lhs, const RWWString &rhs) |
bool | operator!= (const RWWString &lhs, const std::wstring &rhs) |
bool | operator!= (const std::wstring &lhs, const RWWString &rhs) |
bool | operator!= (const RWWSubString &lhs, const RWWString &rhs) |
bool | operator!= (const RWWString &lhs, const RWWSubString &rhs) |
bool | operator!= (const RWWConstSubString &lhs, const RWWString &rhs) |
bool | operator!= (const RWWString &lhs, const RWWConstSubString &rhs) |
RWWString | operator+ (const RWWString &lhs, const RWWString &rhs) |
RWWString | operator+ (const RWWString &lhs, const RWWSubString &rhs) |
RWWString | operator+ (const RWWSubString &lhs, const RWWString &rhs) |
RWWString | operator+ (const RWWString &lhs, const RWWConstSubString &rhs) |
RWWString | operator+ (const RWWConstSubString &lhs, const RWWString &rhs) |
RWWString | operator+ (const RWWString &lhs, const std::wstring &rhs) |
RWWString | operator+ (const std::wstring &lhs, const RWWString &rhs) |
RWWString | operator+ (const RWWString &lhs, const wchar_t *rhs) |
RWWString | operator+ (const wchar_t *lhs, const RWWString &rhs) |
RWWString | operator+ (const RWWSubString &lhs, const RWWSubString &rhs) |
RWWString | operator+ (const RWWSubString &lhs, const RWWConstSubString &rhs) |
RWWString | operator+ (const RWWConstSubString &lhs, const RWWSubString &rhs) |
RWWString | operator+ (const RWWSubString &lhs, const std::wstring &rhs) |
RWWString | operator+ (const std::wstring &lhs, const RWWSubString &rhs) |
RWWString | operator+ (const RWWSubString &lhs, const wchar_t *rhs) |
RWWString | operator+ (const wchar_t *lhs, const RWWSubString &rhs) |
RWWString | operator+ (const RWWConstSubString &lhs, const RWWConstSubString &rhs) |
RWWString | operator+ (const RWWConstSubString &lhs, const std::wstring &rhs) |
RWWString | operator+ (const std::wstring &lhs, const RWWConstSubString &rhs) |
RWWString | operator+ (const RWWConstSubString &lhs, const wchar_t *rhs) |
RWWString | operator+ (const wchar_t *lhs, const RWWConstSubString &rhs) |
bool | operator< (const RWWString &lhs, const wchar_t *rhs) |
bool | operator< (const wchar_t *lhs, const RWWString &rhs) |
bool | operator< (const RWWString &lhs, const std::wstring &rhs) |
bool | operator< (const std::wstring &lhs, const RWWString &rhs) |
std::ostream & | operator<< (std::ostream &os, const RWWString &s) |
std::wostream & | operator<< (std::wostream &os, const RWWString &str) |
RWvostream & | operator<< (RWvostream &vos, const RWWString &str) |
RWFile & | operator<< (RWFile &file, const RWWString &str) |
bool | operator<= (const RWWString &rhs) const |
bool | operator<= (const RWWString &lhs, const wchar_t *rhs) |
bool | operator<= (const wchar_t *lhs, const RWWString &rhs) |
bool | operator<= (const RWWString &lhs, const std::wstring &rhs) |
bool | operator<= (const std::wstring &lhs, const RWWString &rhs) |
bool | operator== (const RWWString &lhs, const wchar_t *rhs) |
bool | operator== (const wchar_t *lhs, const RWWString &rhs) |
bool | operator== (const RWWString &lhs, const std::wstring &rhs) |
bool | operator== (const std::wstring &lhs, const RWWString &rhs) |
bool | operator== (const RWWSubString &lhs, const RWWString &rhs) |
bool | operator== (const RWWString &lhs, const RWWSubString &rhs) |
bool | operator== (const RWWConstSubString &lhs, const RWWString &rhs) |
bool | operator== (const RWWString &lhs, const RWWConstSubString &rhs) |
bool | operator> (const RWWString &lhs, const wchar_t *rhs) |
bool | operator> (const wchar_t *lhs, const RWWString &rhs) |
bool | operator> (const RWWString &lhs, const std::wstring &rhs) |
bool | operator> (const std::wstring &lhs, const RWWString &rhs) |
bool | operator>= (const RWWString &rhs) const |
bool | operator>= (const RWWString &lhs, const wchar_t *rhs) |
bool | operator>= (const wchar_t *lhs, const RWWString &rhs) |
bool | operator>= (const RWWString &lhs, const std::wstring &rhs) |
bool | operator>= (const std::wstring &lhs, const RWWString &rhs) |
std::istream & | operator>> (std::istream &s, RWWString &str) |
RWvistream & | operator>> (RWvistream &str, RWWString &cstr) |
RWFile & | operator>> (RWFile &file, RWWString &cstr) |
RWWString | strXForm (const std::wstring &str) |
RWWString | strXForm (const RWWString &str) |
RWWString | toLower (const RWWString &str) |
RWWString | toUpper (const RWWString &str) |
Class RWWString offers very powerful and convenient facilities for manipulating wide character strings.
This string class manipulates wide characters of the fundamental type wchar_t
. These characters are generally two or four bytes, and can be used to encode richer code sets than the classic char
type. Because wchar_t
characters are all the same size, indexing is fast.
Conversion to and from multibyte and US-ASCII forms are provided by the RWWString constructors, and by the RWWString member functions isAscii(), toAscii(), and toMultiByte().
Stream operations implicitly translate to and from the multibyte stream representation. That is, on output, wide character strings are converted into multibyte strings, while on input they are converted back into wide character strings. Hence, the external representation of wide character strings is usually as multibyte character strings, saving storage space, and making interfaces with devices (which usually expect multibyte strings) easier.
RWWString tolerates embedded nulls.
Parameters of type const wchar_t*
must not be passed a value of zero. This is detected in the debug version of the library.
A separate RWWSubString class supports substring extraction and modification operations. RWWConstSubString supports substring extractions on const
RWWString instances.
Program output (assuming your platform displays wide characters as US-ASCII if they are in the US-ASCII character set):
The immutable substring class associated with RWWString.
typedef RWWSubString RWWString::SubString |
The mutable substring class associated with RWWString.
enum RWWString::ascii_ |
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. |
enum RWWString::stripType |
Specifies how to strip characters from a string. Used by strip().
Enumerator | |
---|---|
leading |
Remove characters at beginning |
trailing |
Remove characters at end |
both |
Remove characters at both ends |
|
inline |
Creates a string of length zero (the null string).
|
inline |
Constructs a string with data copied from str.
|
inline |
Copy constructor. The created string copies the data from str.
|
inline |
Move constructor. The created string takes ownership of the data owned by str.
|
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.
|
inline |
Constructs a string containing the single character c.
|
inline |
Constructs a string containing the character c repeated count times.
|
inline |
Converts from the null-terminated wide character string str. The created string copies the data pointed to by str, up to the first terminating null.
|
inline |
Constructs a string from the character string str. The created string copies the data pointed to by str. Exactly len characters are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len * sizeof(wchar_t)
bytes or len wide characters long.
|
inline |
Constructs a string containing the single character c. The character c is widened to a wchar_t
.
|
inline |
Constructs a string containing the character c repeated count times. The character c is widened to a wchar_t
.
|
inline |
Constructs a string containing the single signed character c. The character c is widened to a wchar_t
.
|
inline |
Constructs a string containing the single unsigned character c. The character c is widened to a wchar_t
.
|
inline |
Constructs a wide character string from the US-ASCII character string contained in str.
For this conversion to be successful, the string must contain only US-ASCII characters. This can be confirmed (if necessary) using RWCString::isAscii(). If str contains non-US-ASCII characters, the RWWString(const char*,multiByte_) constructor should be used instead.
This constructor can be used as follows:
Constructs a wide character string from the US-ASCII character string contained in str.
For this conversion to be successful, the string must contain only US-ASCII characters. This can be confirmed (if necessary) using RWCString::isAscii(). If str contains non-US-ASCII characters, the RWWString(const char*,multiByte_) constructor should be used instead.
This constructor can be used as follows:
|
inline |
RWWString::RWWString | ( | const RWCString & | str, |
multiByte_ | |||
) |
|
inline |
Constructs a wide character string from the US-ASCII character string contained in str, copying exactly len characters including any embedded nulls. Hence, the buffer pointed to by str must be long enough to hold len characters.
|
inline |
Constructs a wide character string from the multibyte character string contained in str, copying exactly len characters including any embedded nulls. Hence, the buffer pointed to by str must be long enough to hold len characters.
|
inline |
Converts from substring. The created string copies the substring represented by str.
|
inline |
Converts from substring. The created wide string copies the substring represented by str.
|
inline |
Appends count copies of the character c to self. Returns a reference to self.
|
inline |
Appends a copy of the null-terminated wide character string pointed to by str to self. Returns a reference to self.
|
inline |
Appends a copy of the wide character string str to self. Exactly len characters are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len characters long. Returns a reference to self.
|
inline |
Appends a copy of the string str to self. Returns a reference to self.
Appends a copy of the string str to self. Returns a reference to self.
|
inline |
Appends the first len characters of str to self. If len is greater than the length of str, the entire string is appended. Returns a reference to self.
Appends the first len characters of str to self. If len is greater than the length of str, the entire string is appended. Returns a reference to self.
Assigns a copy of the wide character string str to self, replacing existing content. Returns a reference to self.
|
inline |
Assigns a copy of the wide character string str to self, replacing existing content. Returns a reference to self.
Assigns a copy of the wide character string str to self, replacing existing content. Returns a reference to self.
|
inline |
Assigns a copy of the wide character string str to self, replacing existing content. Returns a reference to self.
|
inline |
Assigns the null-terminated wide character string pointed to by str to self, replacing existing content. Returns a reference to self.
|
inline |
Assigns a copy of the wide 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 characters long. Returns a reference to self.
|
inline |
Assigns count copies of the wide character c to self, replacing existing content. Returns a reference to self.
|
inline |
Returns the number of bytes necessary to store the object using the global function:
|
inline |
Returns the current capacity of self. This is the number of characters the string can hold without resizing.
|
inline |
A non-binding request to alter the capacity of self to cap
. The capacity is never reduced below the current number of characters. Returns the actual capacity.
|
inline |
Returns an int
less than, greater than, or equal to zero, according to the result of calling the C++ Standard Library function std::wcscoll() on self and the argument str. This method supports locale-dependent collation.
|
inline |
Returns an int
less than, greater than, or equal to zero, according to the result of calling the C++ Standard Library function std::wcscoll() on self and the argument str. This method supports locale-dependent collation.
|
inline |
Returns an int
less than, greater than, or equal to zero, according to the result of calling the C++ Standard Library function std::wcscoll() on self and the argument str. This method supports locale-dependent collation.
|
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.
|
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.
|
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.
|
inline |
This function is the equivalent of calling:
|
inline |
This function is the equivalent of calling:
|
inline |
Returns false
if RWWString::index(str, cmp) returns RW_NPOS, otherwise returns true
.
|
inline |
Returns false
if RWWString::index(str, cmp) returns RW_NPOS, otherwise returns true
.
|
inline |
Returns false
if RWWString::index(str, cmp) returns RW_NPOS, otherwise returns true
.
|
inline |
Provides access to the RWWString instances's data as a null-terminated string. This datum is owned by the RWWString and may not be deleted or changed. If the RWWString object itself changes or goes out of scope, the pointer value previously returned becomes invalid. While the string is null-terminated, note that its length is still given by the member function length(). That is, it may contain embedded nulls.
|
inline |
Returns the index of the first occurrence of the character c in self. Returns RW_NPOS if there is no match.
|
inline |
|
inline |
Returns the index of the first occurrence in self of any character in str. Returns RW_NPOS if there is no match.
|
inline |
Returns the index of the first occurrence in self of any character in str. Exactly len characters in str are checked including any embedded nulls so str must point to a buffer containing at least len characters. Returns RW_NPOS if there is no match.
Equivalent to calling:
Equivalent to calling:
unsigned long RWWString::hash | ( | caseCompare | cmp = exact | ) | const |
Returns a suitable hash value.
|
inlinestatic |
Returns the hash value of str as returned by hash(caseCompare) const, where caseCompare is RWWString::exact.
|
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.
|
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.
|
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.
|
inline |
Pattern matching. Starting with index start, searches for the first occurrence of the first patlen characters from pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.
|
inline |
Pattern matching. Starting with index start, searches for the first occurrence of the first patlen characters from pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.
|
inline |
Pattern matching. Starting with index start, searches for the first occurrence of the first patlen characters from pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.
|
static |
It has no effect on an RWWString instance and may be removed from a future release.
|
inline |
Inserts count instances of the character c into self at index pos. Returns a reference to self.
|
inline |
Inserts a copy of the null-terminated string str into self at index pos. Returns a reference to self.
|
inline |
Inserts a copy of the first len characters of str into self at index pos. Returns a reference to self.
|
inline |
Inserts a copy of the string str into self at index pos. Returns a reference to self.
Inserts a copy of the string str into self at index pos. Returns a reference to self.
|
inline |
Inserts the first len characters 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.
Inserts the first len characters 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.
bool RWWString::isAscii | ( | ) | const |
Returns true
if it is safe to perform the conversion toAscii() (that is, if all characters of self are US-ASCII characters).
|
inline |
Returns true
if this string has zero length (i.e., the null string).
|
inline |
Returns the index of the last occurrence of the character c in self. Returns RW_NPOS if there is no match.
|
inline |
|
inline |
Returns the index of the last occurrence in self of any character in str. Returns RW_NPOS if there is no match.
|
inline |
Returns the index of the last occurrence in self of any character in str. Exactly len characters in str are checked including any embedded nulls so str must point to a buffer containing at least len characters. Returns RW_NPOS if there is no match.
|
inline |
Returns the number of characters in self.
|
static |
It has no effect on an RWWString instance and may be removed from a future release.
|
inline |
The equivalent of calling RWWString::data() on self.
|
inline |
The equivalent of calling:
|
inline |
Returns the i th character 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/wstring.h>
.
RWBoundsErr | if RWBOUNDS_CHECK is defined and the index is out of range. |
|
inline |
Returns the i th character 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/wstring.h>
.
RWBoundsErr | if RWBOUNDS_CHECK is defined and the index is out of range. |
|
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.
RWBoundsErr | if the library was built using the RW_DEBUG flag, and start and len are out of range. |
|
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.
RWBoundsErr | if the library was built using the RW_DEBUG flag, and start and len are out of range. |
|
inline |
Appends the character c to self. Returns a reference to self.
|
inline |
Appends the null-terminated character string pointed to by str to self. Returns a reference to self.
|
inline |
Appends the string str to self. Returns a reference to self.
Appends the string str to self. Returns a reference to self.
|
inline |
Returns true
if this
lexicographically precedes rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
inline |
Assignment operator. Copies the character c into self. Returns a reference to self.
|
inline |
Assignment operator. Copies the null-terminated character string pointed to by str into self. Returns a reference to self.
|
inline |
Assignment operator. The string copies the data from str. Returns a reference to self.
Assignment operator. The string copies the data from str. Returns a reference to self.
Assignment operator. The string copies the data from str. Returns a reference to self.
|
inline |
Assignment operator. The string copies the data from str. Returns a reference to self.
Move assignment. Self takes ownership of the data owned by str.
|
inline |
Returns true
if this
is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
inline |
The equivalent of calling:
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Returns the i th character 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.
RWBoundsErr | if the index is out of range. |
|
inline |
Prepends count copies of character c to self. Returns a reference to self.
|
inline |
Prepends a copy of the null-terminated character string pointed to by str to self. Returns a reference to self.
|
inline |
Prepends a copy of the character string str to self. Exactly len characters are copied, including any embedded nulls. Hence, the buffer pointed to by str must be at least len characters long. Returns a reference to self.
|
inline |
Prepends a copy of the string str to self. Returns a reference to self.
Prepends a copy of the string str to self. Returns a reference to self.
|
inline |
Prepends the first len characters of str to self. If len is greater than the length of str, the entire string is prepended. Returns a reference to self.
Prepends the first len characters of str to self. If len is greater than the length of str, the entire string is prepended. Returns a reference to self.
std::istream& RWWString::readFile | ( | std::istream & | strm | ) |
Reads characters from the input stream strm, replacing the previous contents of self, until EOF
is reached. The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object. Null characters are treated the same as other characters.
|
inline |
Reads characters from the input stream strm, replacing the previous contents of self, until a newline (or an EOF
) is encountered. The newline is removed from the input stream but is not stored. The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object. Null characters are treated the same as other characters. If the skipWhite argument is true
, then whitespace is skipped (using the iostream library manipulator ws
) before saving characters.
|
inline |
Reads characters from the input stream strm, replacing the previous contents of self, until an EOF
or null terminator is encountered. The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object.
|
inline |
The equivalent of calling:
|
inline |
Reads characters from the input stream strm, replacing the previous contents of self, until an EOF
or the delimiting character delim is encountered. The delimiter is removed from the input stream but is not stored. The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object. Null characters are treated the same as other characters.
std::istream& RWWString::readToken | ( | std::istream & | strm | ) |
Whitespace is skipped before storing characters into a wide string. Characters are then read from the input stream strm, replacing previous contents of self, until trailing whitespace or an EOF
is encountered. The trailing whitespace is left on the input stream. Only US-ASCII whitespace characters are recognized, as defined by the C++ Standard Library function std::iswspace(). The input stream is treated as a sequence of wide characters, each of which is read and stored in the RWWString object.
|
inline |
White space is skipped before reading from strm. Characters 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::iswspace().
|
inline |
Removes the characters to the end of string, starting at the position pos, which must be no greater than length(). Returns a reference to self.
|
inline |
Removes len wide characters or to the end of string (whichever comes first) starting at the position pos, which must be no greater than length(). Returns a reference to self.
|
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.
RWBoundsErr | If pos is greater than the length of self. |
|
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.
RWBoundsErr | If pos is greater than the length of self. |
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.
RWBoundsErr | If pos is greater than the length of self. |
|
inline |
Replaces the substring beginning at pos and of length len with strLen characters 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.
RWBoundsErr | If pos is greater than the length of self. |
|
inline |
Replaces the substring beginning at pos and of length len with the first strLen characters 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.
RWBoundsErr | If pos is greater than the length of self. |
|
inline |
Replaces the substring beginning at pos and of length len with the first strLen characters 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.
RWBoundsErr | If pos is greater than the length of self. |
|
inline |
Changes the length of self to len characters, adding blanks (i.e., L' '
) or truncating as necessary.
|
static |
It has no effect on an RWWString instance and may be removed from a future release.
|
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.
RW_COPY_ON_WRITE_STRING
is defined.
|
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.
RW_COPY_ON_WRITE_STRING
is defined.
|
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.
RW_COPY_ON_WRITE_STRING
is defined.
|
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.
RW_COPY_ON_WRITE_STRING
is defined.
|
inline |
Pattern matching. Searches for the last occurrence of the first patlen characters 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.
RW_COPY_ON_WRITE_STRING
is defined.
|
inline |
Pattern matching. Searches for the last occurrence of the first patlen characters 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.
RW_COPY_ON_WRITE_STRING
is defined.
|
inline |
Pattern matching. Searches for the last occurrence of the first patlen characters 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.
RW_COPY_ON_WRITE_STRING
is defined.std::wstring& RWWString::std | ( | ) |
Returns the underlying std::wstring representation of self.
RW_COPY_ON_WRITE_STRING
is defined.
|
inline |
Returns the underlying std::wstring representation of self.
RW_COPY_ON_WRITE_STRING
is defined.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 RWWString::strip | ( | stripType | st = trailing , |
wchar_t | c = L' ' |
||
) | 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.
SubString RWWString::subString | ( | const wchar_t * | pat, |
size_t | start = 0 , |
||
caseCompare | cmp = exact |
||
) |
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.
ConstSubString RWWString::subString | ( | const wchar_t * | pat, |
size_t | start = 0 , |
||
caseCompare | cmp = exact |
||
) | const |
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.
|
inline |
Swaps the contents of str with self.
RWCString RWWString::toAscii | ( | ) | const |
Returns an ASCII representation of self. Any non-US-ASCII characters in self simply have the high bits stripped off. Use isAscii() to determine whether this function is safe to use.
|
inline |
Changes all upper-case letters in self to lower-case. Uses the C++ Standard Library function std::towlower().
RWCString RWWString::toMultiByte | ( | ) | const |
Returns a multibyte representation of self.
|
inline |
Changes all lower-case letters in self to upper-case. Uses the C++ Standard Library function std::towupper().
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
Concatenates lhs and rhs and returns the resulting string.
Concatenates lhs and rhs and returns the resulting string.
Concatenates lhs and the null-terminated string rhs and returns the resulting string.
Concatenates the null-terminated string lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and the null-terminated string rhs and returns the resulting string.
|
related |
Concatenates the null-terminated string lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and rhs and returns the resulting string.
|
related |
Concatenates lhs and the null-terminated string rhs and returns the resulting string.
|
related |
Concatenates the null-terminated string lhs and rhs and returns the resulting string.
|
related |
Returns true
if lhs lexicographically precedes rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs lexicographically precedes rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs lexicographically precedes rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs lexicographically precedes rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Outputs an RWWString on ostream os as a sequence of bytes. This is done literally from the byte content of the characters.
|
related |
Outputs an RWWString on wostream os as a sequence of wide characters.
|
related |
Saves string str to a virtual stream.
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
Returns true
if lhs is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
Returns true
if lhs is lexicographically equal to rhs. Otherwise returns false
. Use member RWWString::collate() or RWWString::strXForm() for locale-sensitive comparisons.
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
The equivalent of calling:
|
related |
Calls str.readToken(s)
. That is, a token is read from the input stream s.
|
related |
Restores a wide character string into cstr from a virtual stream, replacing the previous contents of cstr.
If an error occurs while extracting the string, the operator returns the original string contents unmodified. Check the virtual stream to determine if an error occurred on extraction.
Restores a wide character string into cstr from an RWFile, replacing the previous contents of cstr.
If an error occurs while extracting the string, the operator returns the original string contents unmodified. Check the file to determine if an error occurred on extraction.
|
related |
Returns the result of applying std::wcsxfrm() to str to allow quicker collation than RWWString::collate().
Returns a copy of str with all upper-case characters replaced with lower-case characters. This function is the equivalent of calling:
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |