Allows some subsection of an RWWString to be addressed by defining a starting position and an extent. More...
#include <rw/wstring.h>
Public Member Functions | |
bool | isNull () const |
size_t | length () const |
int | operator! () const |
wchar_t & | operator() (size_t i) |
wchar_t | operator() (size_t i) const |
RWWSubString & | operator= (const wchar_t *str) |
RWWSubString & | operator= (const std::wstring &str) |
RWWSubString & | operator= (const RWWString &str) |
RWWSubString & | operator= (const RWWSubString &str) |
RWWSubString & | operator= (const RWWConstSubString &str) |
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 |
size_t | start () const |
void | toLower () |
void | toUpper () |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator!= (const RWWSubString &lhs, const wchar_t *rhs) |
bool | operator!= (const wchar_t *lhs, const RWWSubString &rhs) |
bool | operator!= (const RWWSubString &lhs, const RWWSubString &rhs) |
bool | operator!= (const RWWSubString &lhs, const RWWConstSubString &rhs) |
bool | operator!= (const RWWConstSubString &lhs, const RWWSubString &rhs) |
bool | operator== (const RWWSubString &lhs, const wchar_t *rhs) |
bool | operator== (const wchar_t *lhs, const RWWSubString &rhs) |
bool | operator== (const RWWSubString &lhs, const RWWSubString &rhs) |
bool | operator== (const RWWSubString &lhs, const RWWConstSubString &rhs) |
bool | operator== (const RWWConstSubString &lhs, const RWWSubString &rhs) |
The class RWWSubString allows some subsection of an RWWString to be addressed by defining a starting position and an extent. For example the 7th through the 11th elements, inclusive, would have a starting position of 7 and an extent of 5. The specification of a starting position and extent can also be done in your behalf by such functions as RWWString::strip() or the overloaded function call operator taking a regular expression as an argument. There are no public constructors; RWWSubString objects are constructed by various functions of the RWWString class and then destroyed immediately.
A zero length substring is one with a defined starting position and an extent of zero. It can be thought of as starting just before the indicated character, but not including it. It can be used as an lvalue. A null substring is also legal and is frequently used to indicate that a requested substring, perhaps through a search, does not exist. A null substring can be detected with member function isNull(). However, it cannot be used as an lvalue.
Program output (assuming your platform displays wide characters as US-ASCII if they are in the US-ASCII character set):
|
inline |
Returns true
if this
is a null substring.
|
inline |
Returns the extent (i.e., length) of the substring.
|
inline |
Returns true
if this
is a null substring.
|
inline |
Returns the i th character of the substring. The index i must be between zero and the length of the substring less one. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK
before including <rw/wstring.h>
.
RWBoundsErr | if RWBOUNDS_CHECK is defined and the index is out of range. |
|
inline |
Returns the i th character of the substring. The index i must be between zero and the length of the substring less one. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK
before including <rw/wstring.h>
.
RWBoundsErr | if RWBOUNDS_CHECK is defined and the index is out of range. |
|
inline |
Assignment from a wide character string. Example:
The number of characters selected need not match; if they differ, str
is resized appropriately. If self is the null substring, then the statement has no effect.
Returns a reference to self.
|
inline |
Assignment from an RWWString. Example:
Copies a
's data into the substring b(2,3)
. The number of elements need not match; if they differ, b
is resized appropriately. If self is the null substring, then the statement has no effect. Returns a reference to self.
|
inline |
Assignment from an RWWString. Example:
Copies a
's data into the substring b(2,3)
. The number of elements need not match; if they differ, b
is resized appropriately. If self is the null substring, then the statement has no effect. Returns a reference to self.
|
inline |
Assignment from an RWWSubString. Example:
Copies 5 characters of a
's data into the substring b(2,3)
. The number of elements need not match; if they differ, b
is resized appropriately. If self is the null substring, then the statement has no effect. Returns a reference to self.
|
inline |
Assignment from an RWWConstSubString. Example:
Copies 5 characters of a
's data into the substring b(2,3)
. The number of elements need not match; if they differ, b
is resized appropriately. If self is the null substring, then the statement has no effect. Returns a reference to self.
|
inline |
Returns the i th character of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 of the substring. The index i must be between zero and the length of the substring 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 index of the starting element of the substring.
|
inline |
Changes all upper-case letters in self to lower-case. Uses the C++ Standard Library function std::towlower().
|
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 |
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.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |