SourcePro® 2023.1 |
SourcePro® API Reference Guide |
Represents and manages an array of UTF-16 values. More...
#include <rw/tools/bustring.h>
Classes | |
class | Deallocator |
Base class for subclasses that release client-allocated storage. More... | |
class | Pad |
Inserts the contents of a Unicode string into an output stream, padding it with a designated fill character. More... | |
class | StaticDeallocator |
Forwards deallocation requests to a static callback method. More... | |
Public Types | |
typedef const RWUChar16 * | const_iterator |
typedef const RWUChar16 & | const_reference |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef ptrdiff_t | difference_type |
enum | Duration { Transient, Persistent } |
typedef RWUChar16 * | iterator |
typedef RWUChar16 * | pointer |
typedef RWUChar16 & | reference |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef size_t | size_type |
Public Member Functions | |
RWBasicUString () | |
RWBasicUString (const RWBasicUString &source) | |
RWBasicUString (const RWUChar16 *source, Duration duration=Transient) | |
RWBasicUString (const RWUChar16 *source, size_t sourceLength, Duration duration=Transient) | |
RWBasicUString (const RWUChar16 *source, size_t sourceLength, size_t initialCapacity) | |
RWBasicUString (RWUChar16 *clientBuffer, Deallocator *deallocator) | |
RWBasicUString (RWUChar16 *clientBuffer, size_t contentLength, Deallocator *deallocator) | |
RWBasicUString (RWUChar16 *clientBuffer, size_t contentLength, size_t bufferCapacity, Deallocator *deallocator) | |
RWBasicUString (const RWUChar32 *source) | |
RWBasicUString (const RWUChar32 *source, size_t sourceLength) | |
RWBasicUString (const RWSize_T &initialCapacity) | |
RWBasicUString (RWUChar16 codeUnit, size_t repeat=1) | |
RWBasicUString (RWUChar32 codePoint, size_t repeat=1) | |
RWBasicUString (const char *utf8Source) | |
RWBasicUString (const char *utf8Source, size_t length) | |
RWBasicUString (const RWCString &utf8Source) | |
RWBasicUString (RWBasicUString &&rhs) | |
~RWBasicUString () | |
RWBasicUString & | append (const RWBasicUString &source) |
RWBasicUString & | append (const RWBasicUString &source, size_t sourceOffset, size_t sourceLength) |
RWBasicUString & | append (const RWUChar16 *source) |
RWBasicUString & | append (const RWUChar16 *source, size_t sourceLength) |
RWBasicUString & | append (const RWUChar32 *source) |
RWBasicUString & | append (const RWUChar32 *source, size_t sourceLength) |
RWBasicUString & | append (RWUChar16 codeUnit, size_t repeat=1) |
RWBasicUString & | append (RWUChar32 codePoint, size_t repeat=1) |
iterator | begin () |
const_iterator | begin () const |
RWspace | binaryStoreSize () const |
size_t | boundsCheckIndex (size_t offset) const |
size_t | boundsCheckLength (size_t offset, size_t length) const |
size_t | capacity () const |
size_t | capacity (size_t newCapacity) |
const_iterator | cbegin () const |
const_iterator | cend () const |
size_t | codePointLength () const |
size_t | codeUnitLength () const |
int | compareCodePoints (const RWBasicUString &rhs) const |
int | compareCodePoints (const RWBasicUString &rhs, size_t rhsOffset, size_t rhsLength) const |
int | compareCodePoints (const RWUChar16 *rhs) const |
int | compareCodePoints (const RWUChar16 *rhs, size_t rhsLength) const |
int | compareCodePoints (const RWUChar32 *rhs) const |
int | compareCodePoints (const RWUChar32 *rhs, size_t rhsLength) const |
int | compareCodeUnits (const RWBasicUString &rhs) const |
int | compareCodeUnits (const RWBasicUString &rhs, size_t rhsOffset, size_t rhsLength) const |
int | compareCodeUnits (const RWUChar16 *rhs) const |
int | compareCodeUnits (const RWUChar16 *rhs, size_t rhsLength) const |
int | compareTo (const RWBasicUString &rhs) const |
int | compareTo (const RWBasicUString &rhs, size_t rhsOffset, size_t rhsLength) const |
int | compareTo (const RWUChar16 *rhs) const |
int | compareTo (const RWUChar16 *rhs, size_t rhsLength) const |
int | compareTo (const RWUChar32 *rhs) const |
int | compareTo (const RWUChar32 *rhs, size_t rhsLength) const |
bool | contains (const RWBasicUString &pattern) const |
bool | contains (const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
bool | contains (const RWUChar16 *pattern) const |
bool | contains (const RWUChar16 *pattern, size_t patternLength) const |
bool | contains (const RWUChar32 *pattern) const |
bool | contains (const RWUChar32 *pattern, size_t patternLength) const |
bool | contains (RWUChar16 codeUnit) const |
bool | contains (RWUChar32 codePoint) const |
bool | contains (size_t offset, const RWBasicUString &pattern) const |
bool | contains (size_t offset, const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
bool | contains (size_t offset, const RWUChar16 *pattern) const |
bool | contains (size_t offset, const RWUChar16 *pattern, size_t patternLength) const |
bool | contains (size_t offset, const RWUChar32 *pattern) const |
bool | contains (size_t offset, const RWUChar32 *pattern, size_t patternLength) const |
bool | contains (size_t offset, RWUChar16 codeUnit) const |
bool | contains (size_t offset, RWUChar32 codePoint) const |
bool | contains (size_t offset, size_t length, const RWBasicUString &pattern) const |
bool | contains (size_t offset, size_t length, const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
bool | contains (size_t offset, size_t length, const RWUChar16 *pattern) const |
bool | contains (size_t offset, size_t length, const RWUChar16 *pattern, size_t patternLength) const |
bool | contains (size_t offset, size_t length, const RWUChar32 *pattern) const |
bool | contains (size_t offset, size_t length, const RWUChar32 *pattern, size_t patternLength) const |
bool | contains (size_t offset, size_t length, RWUChar16 codeUnit) const |
bool | contains (size_t offset, size_t length, RWUChar32 codePoint) const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
const RWUChar16 * | data () const |
bool | empty () const |
iterator | end () |
const_iterator | end () const |
bool | equals (const RWBasicUString &array) const |
size_t | first (const RWBasicUString &codeUnitSet) const |
size_t | first (const RWUChar16 *codeUnitSet) const |
size_t | first (const RWUChar16 *codeUnitSet, size_t numCodeUnits) const |
size_t | first (const RWUChar32 *codePointSet) const |
size_t | first (const RWUChar32 *codePointSet, size_t numCodePoints) const |
size_t | first (RWUChar16 codeUnit) const |
size_t | first (RWUChar32 codePoint) const |
size_t | first (size_t offset, const RWBasicUString &codeUnitSet) const |
size_t | first (size_t offset, const RWUChar16 *codeUnitSet) const |
size_t | first (size_t offset, const RWUChar16 *codeUnitSet, size_t numCodeUnits) const |
size_t | first (size_t offset, const RWUChar32 *codePointSet) const |
size_t | first (size_t offset, const RWUChar32 *codePointSet, size_t numCodePoints) const |
size_t | first (size_t offset, RWUChar16 codeUnit) const |
size_t | first (size_t offset, RWUChar32 codePoint) const |
size_t | first (size_t offset, size_t length, const RWBasicUString &codeUnitSet) const |
size_t | first (size_t offset, size_t length, const RWUChar16 *codeUnitSet) const |
size_t | first (size_t offset, size_t length, const RWUChar16 *codeUnitSet, size_t numCodeUnits) const |
size_t | first (size_t offset, size_t length, const RWUChar32 *codePointSet) const |
size_t | first (size_t offset, size_t length, const RWUChar32 *codePointSet, size_t numCodePoints) const |
size_t | first (size_t offset, size_t length, RWUChar16 codeUnit) const |
size_t | first (size_t offset, size_t length, RWUChar32 codePoint) const |
unsigned long | hash () const |
size_t | index (const RWBasicUString &pattern) const |
size_t | index (const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
size_t | index (const RWUChar16 *pattern) const |
size_t | index (const RWUChar16 *pattern, size_t patternLength) const |
size_t | index (const RWUChar32 *pattern) const |
size_t | index (const RWUChar32 *pattern, size_t patternLength) const |
size_t | index (RWUChar16 codeUnit) const |
size_t | index (RWUChar32 codePoint) const |
size_t | index (size_t offset, const RWBasicUString &pattern) const |
size_t | index (size_t offset, const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
size_t | index (size_t offset, const RWUChar16 *pattern) const |
size_t | index (size_t offset, const RWUChar16 *pattern, size_t patternLength) const |
size_t | index (size_t offset, const RWUChar32 *pattern) const |
size_t | index (size_t offset, const RWUChar32 *pattern, size_t patternLength) const |
size_t | index (size_t offset, RWUChar16 codeUnit) const |
size_t | index (size_t offset, RWUChar32 codePoint) const |
size_t | index (size_t offset, size_t length, const RWBasicUString &pattern) const |
size_t | index (size_t offset, size_t length, const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
size_t | index (size_t offset, size_t length, const RWUChar16 *pattern) const |
size_t | index (size_t offset, size_t length, const RWUChar16 *pattern, size_t patternLength) const |
size_t | index (size_t offset, size_t length, const RWUChar32 *pattern) const |
size_t | index (size_t offset, size_t length, const RWUChar32 *pattern, size_t patternLength) const |
size_t | index (size_t offset, size_t length, RWUChar16 codeUnit) const |
size_t | index (size_t offset, size_t length, RWUChar32 codePoint) const |
RWBasicUString & | insert (size_t offset, const RWBasicUString &source) |
RWBasicUString & | insert (size_t offset, const RWBasicUString &source, size_t sourceOffset, size_t sourceLength) |
RWBasicUString & | insert (size_t offset, const RWUChar16 *source) |
RWBasicUString & | insert (size_t offset, const RWUChar16 *source, size_t sourceLength) |
RWBasicUString & | insert (size_t offset, const RWUChar32 *source) |
RWBasicUString & | insert (size_t offset, const RWUChar32 *source, size_t sourceLength) |
RWBasicUString & | insert (size_t offset, RWUChar16 codeUnit, size_t repeat=1) |
RWBasicUString & | insert (size_t offset, RWUChar32 codePoint, size_t repeat=1) |
bool | isNull () const |
size_t | last (const RWBasicUString &codeUnitSet) const |
size_t | last (const RWUChar16 *codeUnitSet) const |
size_t | last (const RWUChar16 *codeUnitSet, size_t numCodeUnits) const |
size_t | last (const RWUChar32 *codePointSet) const |
size_t | last (const RWUChar32 *codePointSet, size_t numCodePoints) const |
size_t | last (RWUChar16 codeUnit) const |
size_t | last (RWUChar32 codePoint) const |
size_t | last (size_t offset, const RWBasicUString &codeUnitSet) const |
size_t | last (size_t offset, const RWUChar16 *codeUnitSet) const |
size_t | last (size_t offset, const RWUChar16 *codeUnitSet, size_t numCodeUnits) const |
size_t | last (size_t offset, const RWUChar32 *codePointSet) const |
size_t | last (size_t offset, const RWUChar32 *codePointSet, size_t numCodePoints) const |
size_t | last (size_t offset, RWUChar16 codeUnit) const |
size_t | last (size_t offset, RWUChar32 codePoint) const |
size_t | last (size_t offset, size_t length, const RWBasicUString &codeUnitSet) const |
size_t | last (size_t offset, size_t length, const RWUChar16 *codeUnitSet) const |
size_t | last (size_t offset, size_t length, const RWUChar16 *codeUnitSet, size_t numCodeUnits) const |
size_t | last (size_t offset, size_t length, const RWUChar32 *codePointSet) const |
size_t | last (size_t offset, size_t length, const RWUChar32 *codePointSet, size_t numCodePoints) const |
size_t | last (size_t offset, size_t length, RWUChar16 codeUnit) const |
size_t | last (size_t offset, size_t length, RWUChar32 codePoint) const |
size_t | length () const |
size_t | max_size () const |
operator const RWUChar16 * () const | |
RWUChar16 & | operator() (size_t offset) |
RWUChar16 | operator() (size_t offset) const |
RWBasicUString & | operator+= (const RWBasicUString &source) |
RWBasicUString & | operator+= (const RWUChar16 *source) |
RWBasicUString & | operator+= (const RWUChar32 *source) |
RWBasicUString & | operator+= (RWUChar16 codeUnit) |
RWBasicUString & | operator+= (RWUChar32 codePoint) |
RWBasicUString & | operator= (RWBasicUString &&rhs) |
RWBasicUString & | operator= (const RWBasicUString &source) |
RWBasicUString & | operator= (const RWUChar16 *source) |
RWBasicUString & | operator= (const RWUChar32 *source) |
RWBasicUString & | operator= (RWUChar16 codeUnit) |
RWBasicUString & | operator= (RWUChar32 codePoint) |
RWUChar16 & | operator[] (short offset) |
RWUChar16 & | operator[] (int offset) |
RWUChar16 & | operator[] (long offset) |
RWUChar16 & | operator[] (unsigned short offset) |
RWUChar16 & | operator[] (unsigned int offset) |
RWUChar16 & | operator[] (unsigned long offset) |
RWUChar16 & | operator[] (long long offset) |
RWUChar16 & | operator[] (unsigned long long offset) |
RWUChar16 | operator[] (short offset) const |
RWUChar16 | operator[] (int offset) const |
RWUChar16 | operator[] (long offset) const |
RWUChar16 | operator[] (unsigned short offset) const |
RWUChar16 | operator[] (unsigned int offset) const |
RWUChar16 | operator[] (unsigned long offset) const |
RWUChar16 | operator[] (long long offset) const |
RWUChar16 | operator[] (unsigned long long offset) const |
RWBasicUString & | prepend (const RWBasicUString &source) |
RWBasicUString & | prepend (const RWBasicUString &source, size_t sourceOffset, size_t sourceLength) |
RWBasicUString & | prepend (const RWUChar16 *source) |
RWBasicUString & | prepend (const RWUChar16 *source, size_t sourceLength) |
RWBasicUString & | prepend (const RWUChar32 *source) |
RWBasicUString & | prepend (const RWUChar32 *source, size_t sourceLength) |
RWBasicUString & | prepend (RWUChar16 codeUnit, size_t repeat=1) |
RWBasicUString & | prepend (RWUChar32 codePoint, size_t repeat=1) |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
RWBasicUString & | remove (size_t offset=0) |
RWBasicUString & | remove (size_t offset, size_t length) |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
RWBasicUString & | replace (size_t offset, size_t length, const RWBasicUString &source) |
RWBasicUString & | replace (size_t offset, size_t length, const RWBasicUString &source, size_t sourceOffset, size_t sourceLength) |
RWBasicUString & | replace (size_t offset, size_t length, const RWUChar16 *source) |
RWBasicUString & | replace (size_t offset, size_t length, const RWUChar16 *source, size_t sourceLength) |
RWBasicUString & | replace (size_t offset, size_t length, const RWUChar32 *source) |
RWBasicUString & | replace (size_t offset, size_t length, const RWUChar32 *source, size_t sourceLength) |
RWBasicUString & | replace (size_t offset, size_t length, RWUChar16 codeUnit, size_t repeat=1) |
RWBasicUString & | replace (size_t offset, size_t length, RWUChar32 codePoint, size_t repeat=1) |
void | resize (size_t newCodeUnitLength, RWUChar16 codeUnit) |
void | resize (size_t newCodePointLength, RWUChar32 codePoint) |
void | restoreFrom (RWvistream &vis) |
void | restoreFrom (RWFile &file) |
size_t | rindex (const RWBasicUString &pattern) const |
size_t | rindex (const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
size_t | rindex (const RWUChar16 *pattern) const |
size_t | rindex (const RWUChar16 *pattern, size_t patternLength) const |
size_t | rindex (const RWUChar32 *pattern) const |
size_t | rindex (const RWUChar32 *pattern, size_t patternLength) const |
size_t | rindex (RWUChar16 codeUnit) const |
size_t | rindex (RWUChar32 codePoint) const |
size_t | rindex (size_t offset, const RWBasicUString &pattern) const |
size_t | rindex (size_t offset, const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
size_t | rindex (size_t offset, const RWUChar16 *pattern) const |
size_t | rindex (size_t offset, const RWUChar16 *pattern, size_t patternLength) const |
size_t | rindex (size_t offset, const RWUChar32 *pattern) const |
size_t | rindex (size_t offset, const RWUChar32 *pattern, size_t patternLength) const |
size_t | rindex (size_t offset, RWUChar16 codeUnit) const |
size_t | rindex (size_t offset, RWUChar32 codePoint) const |
size_t | rindex (size_t offset, size_t length, const RWBasicUString &pattern) const |
size_t | rindex (size_t offset, size_t length, const RWBasicUString &pattern, size_t patternOffset, size_t patternLength) const |
size_t | rindex (size_t offset, size_t length, const RWUChar16 *pattern) const |
size_t | rindex (size_t offset, size_t length, const RWUChar16 *pattern, size_t patternLength) const |
size_t | rindex (size_t offset, size_t length, const RWUChar32 *pattern) const |
size_t | rindex (size_t offset, size_t length, const RWUChar32 *pattern, size_t patternLength) const |
size_t | rindex (size_t offset, size_t length, RWUChar16 codeUnit) const |
size_t | rindex (size_t offset, size_t length, RWUChar32 codeUnit) const |
void | saveOn (RWvostream &vos) const |
void | saveOn (RWFile &file) const |
size_t | size () const |
size_t | skipLeading (RWUChar32 codePoint=static_cast< RWUChar32 >(0x0020)) const |
size_t | skipTrailing (RWUChar32 codePoint=static_cast< RWUChar32 >(0x0020)) const |
void | swap (RWBasicUString &ustr) |
std::basic_string< RWUChar32 > | toUtf32 () const |
RWCString | toUtf8 (size_t numCodePoints=RW_NPOS) const |
RWWString | toWide () const |
Static Public Member Functions | |
static size_t | codePointLength (const RWUChar16 *array) |
static size_t | codePointLength (const RWUChar16 *array, size_t length) |
static size_t | codePointLength (const RWUChar32 *array) |
static size_t | codeUnitLength (const RWUChar16 *array) |
static size_t | codeUnitLength (const RWUChar32 *array) |
static size_t | codeUnitLength (const RWUChar32 *array, size_t length) |
static RWUChar32 | computeCodePointValue (RWUChar16 highSurrogate, RWUChar16 lowSurrogate) |
static Deallocator * | getNullDeallocator () |
static RWUChar16 | highSurrogate (RWUChar32 codePoint) |
static bool | isHighSurrogate (RWUChar16 codeUnit) |
static bool | isLowSurrogate (RWUChar16 codeUnit) |
static bool | isUnicodeCharacter (RWUChar32 codePoint) |
static RWUChar16 | lowSurrogate (RWUChar32 codePoint) |
static bool | requiresSurrogatePair (RWUChar32 codeUnit) |
static void | USE_DELETE (RWUChar16 *p) |
static void | USE_FREE (RWUChar16 *p) |
static void | USE_NONE (RWUChar16 *p) |
static RWUChar32 | validateCodePoint (RWUChar32 codePoint) |
Static Public Attributes | |
static const RWUChar32 | DefaultFillCharacter |
RWBasicUString is used to manage an array of UTF-16 values in the form of an array of RWUChar16 values. An instance of RWBasicUString may be constructed to use one of three memory management models:
When deallocation responsibility is passed from the client to an RWBasicUString, the client must supply a function object, or functor, that can be used to deallocate the storage. This mechanism allows the client to choose to use operator delete[]
, std::free(), or custom memory-management mechanisms. The use of an externally supplied deallocation method can also be used to satisfy the heap management requirements of Microsoft Windows dynamically linked libraries, which in some situations may create their own heap in addition to that of the calling process.
Given sufficient capacity, RWBasicUString adds a null terminator to any non-static array passed to it. An added null is not considered part of the contents, and is not included in the count returned by length().
typedef const RWUChar16* RWBasicUString::const_iterator |
A type that provides a const
random-access iterator over the elements in the container.
typedef const RWUChar16& RWBasicUString::const_reference |
Declares an alias for a const
reference to the RWBasicUString value type.
typedef std::reverse_iterator<const_iterator> RWBasicUString::const_reverse_iterator |
A type that provides a const
random-access, reverse-order iterator over the elements in the container.
typedef ptrdiff_t RWBasicUString::difference_type |
Declares an alias for the type used to represent the distance between two RWBasicUString iterators.
typedef RWUChar16* RWBasicUString::iterator |
A type that provides a random-access iterator over the elements in the container.
typedef RWUChar16* RWBasicUString::pointer |
Declares an alias for a pointer to the RWBasicUString value type.
typedef RWUChar16& RWBasicUString::reference |
Declares an alias for a reference to the RWBasicUString value type.
typedef std::reverse_iterator<iterator> RWBasicUString::reverse_iterator |
A type that provides a random-access, reverse-order iterator over the elements in the container.
This iterator type is const
to prohibit modification of the underlying RWBasicUString data.
typedef size_t RWBasicUString::size_type |
Declares an alias for the type used to represent non-negative values of the distance or difference type. Used for sizes and indices.
An enumeration whose values are used to indicate whether the source array provided by a client should be copied or simply referenced.
Enumerator | |
---|---|
Transient |
Indicates that a source string or array may have a duration less than that of the RWBasicUString and must therefore be copied, |
Persistent |
Indicates that a source string or array will have a duration greater than that of the RWBasicUString and may therefore be simply referenced. |
|
inline |
Constructs an empty (null) instance.
RWBasicUString::RWBasicUString | ( | const RWBasicUString & | source | ) |
Constructs an RWBasicUString instance from source.
The new instance either copies the data stored in source, or refers to the same storage as source, depending on the storage strategy used to construct source.
Constructs an RWBasicUString instance that copies or references the contents of source, a null-terminated sequence of RWUChar16 values. The new RWBasicUString instance assumes no responsibility for deallocating the storage associated with source.
If duration is Transient, this method copies the contents of source into an internally allocated and managed array.
If duration is Persistent, the client retains responsibility for the storage used for source. This mode may be used when source resides in static or otherwise durable storage. The storage associated with source must not be deallocated while the RWBasicUString instance still references it. The original source array cannot be modified by any of the non-const
methods provided by this class. Any attempt to do so forces RWBasicUString to create a copy of source.
RWBasicUString::RWBasicUString | ( | const RWUChar16 * | source, |
size_t | sourceLength, | ||
Duration | duration = Transient |
||
) |
Constructs an RWBasicUString instance that copies or references the contents of source, an array of RWUChar16 values that contains sourceLength elements and may contain embedded nulls. The new RWBasicUString instance assumes no responsibility for deallocating the storage associated with source.
If duration is Transient, this method copies the contents of source into an internally allocated and managed array.
If duration is Persistent, the client retains responsibility for the storage used for source. This mode may be used when source resides in static or otherwise durable storage. The storage associated with source must not be deallocated while the RWBasicUString instance still references it. The original source array cannot be modified by any of the non-const
methods provided by this class. Any attempt to do so forces RWBasicUString to create a copy of source.
RWBasicUString::RWBasicUString | ( | const RWUChar16 * | source, |
size_t | sourceLength, | ||
size_t | initialCapacity | ||
) |
Constructs an RWBasicUString instance that copies sourceLength characters from the array source into an internally managed buffer with a minimum capacity of initialCapacity. If the original allocation does not possess the capacity required by an append, insert, or replace operation, a new buffer allocation is made to accommodate the change in length.
If the value passed for sourceLength is RW_NPOS, the source is assumed to be a null-terminated array and the entire array is copied. Otherwise, sourceLength characters are copied.
|
inline |
Constructs an RWBasicUString instance that assumes ownership of clientBuffer, a dynamically-allocated, null-terminated sequence of RWUChar16 values. The terminating null may appear at any position within the storage allocated for the Unicode string.
The deallocator parameter is used to supply a Deallocator object that can be used to deallocate the storage referenced by clientBuffer.
Copy construction or assignment produces an RWBasicUString that refers to the same client-supplied buffer.
RWBasicUString does not synchronize access to the client-supplied buffer. External synchronization is required if multiple threads will have access to the buffer through one or more RWBasicUString instances.
|
inline |
Constructs an RWBasicUString instance that assumes ownership of clientBuffer, a dynamically-allocated array of RWUChar16 values that contains contentLength elements and may contain embedded nulls.
The storage required to hold contentLength elements may be less than the storage that was allocated for clientBuffer.
The deallocator parameter is used to supply a Deallocator object that can be used to deallocate the storage referenced by clientBuffer.
Copy construction or assignment produces an RWBasicUString that refers to the same client-supplied buffer.
RWBasicUString does not synchronize access to the client-supplied buffer. External synchronization is required if multiple threads will have access to the buffer through one or more RWBasicUString instances.
|
inline |
Constructs an RWBasicUString instance that manipulates clientBuffer, a writable, client-supplied array that initially contains contentLength elements and whose total usable size is given by bufferCapacity.
The deallocator parameter is used to supply a Deallocator object that can be used to deallocate the storage referenced by clientBuffer.
The storage associated with clientBuffer must not be deallocated while the RWBasicUString instance still references it.
If the original clientBuffer array does not possess the capacity required by an append, insert, or replace operation, the buffer is copied into an internally allocated buffer.
Copy-construction or assignment produces an RWBasicUString that refers to the same client-supplied buffer.
RWBasicUString does not synchronize access to the client-supplied buffer. External synchronization is required if multiple threads will have access to the buffer through one or more RWBasicUString instances.
RWBasicUString::RWBasicUString | ( | const RWUChar32 * | source | ) |
Constructs an RWBasicUString from the code units produced by converting the null-terminated UCS-4 or UTF-32 encoded source into its equivalent UTF-16 representation.
RWBasicUString::RWBasicUString | ( | const RWUChar32 * | source, |
size_t | sourceLength | ||
) |
Constructs an RWBasicUString from the code units produced by converting the UCS-4 or UTF-32 encoded source into its equivalent UTF-16 representation.
The number of elements in source is specified using sourceLength.
The source array may contain embedded nulls.
RWBasicUString::RWBasicUString | ( | const RWSize_T & | initialCapacity | ) |
Constructs RWBasicUString containing a zero-length string and a capacity of initialCapacity.
An RWSize_T instance must be constructed to eliminate potential ambiguity with the RWBasicUString(RWUChar32,size_t) constructor.
RWBasicUString::RWBasicUString | ( | RWUChar16 | codeUnit, |
size_t | repeat = 1 |
||
) |
Constructs an RWBasicUString that contains repeat copies of the codeUnit.
RWBasicUString::RWBasicUString | ( | RWUChar32 | codePoint, |
size_t | repeat = 1 |
||
) |
Constructs an RWBasicUString that contains repeat copies of the code unit or surrogate pair of code units produced by converting the UTF-32 codePoint into its equivalent UTF-16 representation.
RWBasicUString::RWBasicUString | ( | const char * | utf8Source | ) |
Constructs an RWBasicUString instance that contains the code units produced by converting the UTF-8 encoded Unicode text in utf8Source into a UTF-16 representation.
The source string must be null-terminated.
RWBasicUString::RWBasicUString | ( | const char * | utf8Source, |
size_t | length | ||
) |
Constructs an RWBasicUString instance that contains the code units produced by converting the UTF-8 encoded Unicode text in utf8Source into a UTF-16 representation.
The source string length is given by length and may contain embedded nulls.
RWBasicUString::RWBasicUString | ( | const RWCString & | utf8Source | ) |
Constructs an RWBasicUString instance that contains the code units produced by converting the UTF-8 encoded Unicode text in utf8Source into a UTF-16 representation.
|
inline |
Move constructor. The constructed instance takes ownership of the data owned by rhs.
RWBasicUString::~RWBasicUString | ( | ) |
Destroys self. Relinquishes ownership and frees any resources used by self.
|
inline |
Appends the contents of source to the contents of self.
|
inline |
Appends the contents of the specified range in source to the contents of self.
RWBoundsErr | Thrown if the sum of sourceOffset and sourceLength is greater than source.length(). |
|
inline |
Appends the contents of the null-terminated array source to the contents of self.
|
inline |
Appends the contents of the array source to the contents of self. The size of the source array is specified using sourceLength. The source array may contain embedded nulls.
|
inline |
Converts the code points in the null-terminated array source into UTF-16 code units and appends those code units to the contents of self.
|
inline |
Converts the code points in the array source into UTF-16 code units and appends those code units to the contents of self. The size of the source array is specified using sourceLength.
|
inline |
Appends repeat copies of codeUnit to the contents of self. The code unit may be zero or null.
|
inline |
Converts the UTF-32 codePoint into its equivalent UTF-16 representation and appends repeat copies of the resultant code unit or surrogate pair of code units to the contents of self. The code point may be zero or null.
|
inline |
Returns an iterator that refers to the position of the first code unit in self.
|
inline |
Returns a const_iterator that refers to the position of the first code unit in self.
RWspace RWBasicUString::binaryStoreSize | ( | ) | const |
Returns the number of bytes necessary to serialize the object.
|
inline |
Returns offset if the value is in bounds.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns length if the value is in bounds.
RWBoundsErr | Thrown if offset plus length is greater than or equal to length(). |
|
inline |
Returns the maximum number of UTF-16 code units that may be stored in self without allocating new storage.
size_t RWBasicUString::capacity | ( | size_t | newCapacity | ) |
Allocates and copies the existing buffer contents as required to provide the capacity specified by newCapacity. The new capacity must be greater than or equal to the current value of length(); otherwise no reallocation or copy occurs. Returns the resultant capacity of self, which in some cases may be larger than the capacity requested.
|
inline |
Returns a const_iterator that refers to the position of the first code unit in self.
|
inline |
Returns a const_iterator that refers to the position after the last code unit in self.
|
inline |
Returns the number of Unicode code points encoded by the code units contained in self, including embedded nulls. This method recalculates the result each time it is called. Use codeUnitLength() to determine the number of UTF-16 code units contained in self.
|
inlinestatic |
Returns the number of Unicode code points encoded by the code units in the null-terminated sequence array. The terminating null is not included in the count.
|
inlinestatic |
Returns the number of Unicode code points encoded by the code units in the sequence array. The size of array is specified using length.
|
inlinestatic |
Returns the size of the null-terminated sequence array. The terminating null is not included in the count.
|
inline |
Returns the number of code units contained in self, including embedded nulls. This method uses a cached value and may be called repeatedly without incurring a significant performance penalty. This method returns the same value as length(). Use codePointLength() to determine the number of Unicode code points contained in self.
|
inlinestatic |
Returns the size of the null-terminated sequence array. The terminating null is not included in the count.
|
inlinestatic |
Returns the number of UTF-16 code units required to encode the null-terminated UTF-32 code point sequence contained in array. The terminating null is not included in the count.
|
inlinestatic |
Returns the number of UTF-16 code units required to encode the UTF-32 code point sequence contained in array. The size of array is specified using length.
|
inline |
Returns a value that describes the lexical ordering between self and rhs. The return value should be interpreted as follows:
If the two strings have different lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
|
inline |
Returns a value that describes the lexical ordering between self and the specified range in rhs. The return value should be interpreted as follows:
If the two strings have different lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
RWBoundsErr | Thrown if the sum of rhsOffset and rhsLength is greater than rhs.length(). |
|
inline |
Returns a value that describes the lexical ordering between self and the null-terminated array rhs. The return value should be interpreted as follows:
If the two strings have different lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
|
inline |
Returns a value that describes the lexical ordering between self and the array rhs whose length is given by rhsLength. The return value should be interpreted as follows:
If the two strings have different lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
|
inline |
Returns a value that describes the lexical ordering between self and the null-terminated array rhs. The return value should be interpreted as follows:
If the two strings have different code unit lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
|
inline |
Returns a value that describes the lexical ordering between self and the array rhs whose length is given by rhsLength. The return value should be interpreted as follows:
If the two string have different code unit lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
|
inline |
Returns a value that describes the lexical ordering between self and rhs. The return value should be interpreted as follows:
If the two strings have different lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
This method compares code unit values, not code point values. This may not produce the desired result if either string contains surrogate pairs or code unit values above the surrogate region. Use compareCodePoints() if code point ordering is required.
|
inline |
Returns a value that describes the lexical ordering between self and the specified range in rhs. The return value should be interpreted as follows:
If the two strings have different lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
This method compares code unit values, not code point values. This may not produce the desired result if either string contains surrogate pairs or code unit values above the surrogate region. Use compareCodePoints() if code point ordering is required.
RWBoundsErr | Thrown if the sum of rhsOffset and rhsLength is greater than rhs.length(). |
|
inline |
Returns a value that describes the lexical ordering between self and the null-terminated array rhs. The return value should be interpreted as follows:
If the two strings have different lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
This method compares code unit values, not code point values. This may not produce the desired result if either string contains surrogate pairs or code unit values above the surrogate region. Use compareCodePoints() if code point ordering is required.
|
inline |
Returns a value that describes the lexical ordering between self and the array rhs whose length is given by rhsLength. The return value should be interpreted as follows:
If the two strings have different lengths, the shorter string appears before the longer string if both strings are identical over the length of the shorter string.
This method compares code unit values, not code point values. This may not produce the desired result if either string contains surrogate pairs or code unit values above the surrogate region. Use compareCodePoints() if code point ordering is required.
|
inline |
Returns a value that describes the lexical ordering between self and rhs. Equivalent to compareCodeUnits(const RWBasicUString&) const.
|
inline |
Returns a value that describes the lexical ordering between self and the specified range in rhs. Equivalent to compareCodeUnits(const RWBasicUString&,size_t,size_t) const.
|
inline |
Returns a value that describes the lexical ordering between self and the null-terminated array rhs. Equivalent to compareCodeUnits(const RWUChar16*) const.
|
inline |
Returns a value that describes the lexical ordering between self and the array rhs whose length is give by rhsLength. Equivalent to compareCodeUnits(const RWUChar16*,size_t) const.
|
inline |
Returns a value that describes the lexical ordering between self and the null-terminated array rhs. Equivalent to compareCodePoints(const RWUChar32*) const.
|
inline |
Returns a value that describes the lexical ordering between self and the array rhs whose length is give by rhsLength. Equivalent to compareCodePoints(const RWUChar32*,size_t) const.
|
inlinestatic |
Returns the code point value encoded by the specified pair of code units. The code units must describe a valid surrogate pair. Any other values produce an undefined and erroneous result.
|
inline |
Returns true
if self contains pattern, otherwise returns false
. A zero-length pattern returns true
.
|
inline |
Returns true
if self contains the specified range in pattern, otherwise returns false
. The pattern range starts at index patternOffset and extends for patternLength code units. A zero-length pattern returns true
.
RWBoundsErr | Thrown if the sum of patternOffset and patternLength is greater than pattern.length(). |
|
inline |
Returns true
if self contains pattern, otherwise returns false
. The pattern array must be null-terminated. A zero-length pattern returns true
.
|
inline |
Returns true
if self contains pattern, otherwise returns false
. The size of the pattern array is specified using patternLength. A zero-length pattern returns true
.
|
inline |
Returns true
if self contains pattern, otherwise returns false
. The pattern array must be null-terminated. A zero-length pattern returns true
.
|
inline |
Returns true
if self contains pattern, otherwise returns false
. The size of the pattern array is specified using patternLength. A zero-length pattern returns true
.
|
inline |
Returns true
if self contains codeUnit, otherwise returns false
.
|
inline |
Returns true
if self contains codePoint, otherwise returns false
.
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search begins at index offset within self. A zero-length pattern returns true
.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns true
if the specified range in self contains the specified range in pattern, otherwise returns false
. The search begins at index offset within self. The pattern range starts at index patternOffset and extends for patternLength code units. A zero-length pattern returns true
.
RWBoundsErr | Thrown if offset is greater than or equal to length(), or the sum of patternOffset and patternLength is greater than pattern.length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search begins at index offset within self. The pattern array must be null-terminated. A zero-length pattern returns true
.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search begins at index offset within self. The size of the pattern array is specified using patternLength. A zero-length pattern returns true
.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search begins at index offset within self. The pattern array must be null-terminated. A zero-length pattern returns true
.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search begins at index offset within self. The size of the pattern array is specified using patternLength. A zero-length pattern returns true
.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns true
if the specified range in self contains codeUnit, otherwise returns false
. The search begins at index offset within self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns true
if the specified range in self contains codePoint, otherwise returns false
. The search begins at index offset within self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search range starts at index offset within self, and extends for length code units. A zero-length pattern returns true
.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns true
if the specified range in self contains the specified range in pattern, otherwise returns false
. The search range starts at index offset within self and extends for length code units. The pattern range starts at index patternOffset and extends for patternLength code units. A zero-length pattern returns true
.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(), or the sum of patternOffset and patternLength is greater than pattern.length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search range starts at index offset within self and extends for length code units. The pattern array must be null-terminated. A zero-length pattern returns true
.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search range starts at index offset within self, and extends for length code units. The size of the pattern array is specified using patternLength. A zero-length pattern returns true
.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search range starts at index offset within self, and extends for length code units. The pattern array must be null-terminated. A zero-length pattern returns true
.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns true
if the specified range in self contains pattern, otherwise returns false
. The search range starts at index offset within self and extends for length code units. The size of the pattern array is specified using patternLength. A zero-length pattern returns true
.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns true
if the specified range in self contains codeUnit, otherwise returns false
. The search range starts at index offset within self and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns true
if the specified range in self contains codePoint, otherwise returns false
. The search range starts at index offset within self, and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns a const_reverse_iterator that refers to the position before the first code unit in self.
|
inline |
Returns a const_reverse_iterator that refers to the position before the first code unit in self.
|
inline |
Returns a pointer to the contents of self. The storage referenced by this pointer is owned by RWBasicUString and may not be deleted or modified. The pointer becomes invalid if self is modified or destroyed. The contents may not be null-terminated if the client provided the underlying buffer and there was insufficient space for a terminating null. In all other cases, the contents will be null terminated. The contents may contain embedded nulls, in which case the length of the code-unit sequence is determined using length().
|
inline |
|
inline |
Returns an iterator that refers to the position after the last code unit in self.
|
inline |
Returns a const_iterator that refers to the position after the last code unit in self.
bool RWBasicUString::equals | ( | const RWBasicUString & | array | ) | const |
Returns true
if the contents and length of self are identical to array, otherwise returns false
. This method is more efficient than compareCodeUnits() when testing for equality.
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet, or RW_NPOS if none of the code units in the set are found.
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet, or RW_NPOS if none of the code units in the set are found. The codeUnitSet array must be null-terminated.
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet, or RW_NPOS if none of the code units in the set are found. The size of the codeUnitSet array is specified using numCodeUnits.
|
inline |
Returns the index of the first occurrence of any code point in codePointSet, or RW_NPOS if none of the code points in the set are found. The codePointSet array must be null-terminated.
|
inline |
Returns the index of the first occurrence of any code point in codePointSet, or RW_NPOS if none of the code points in the set are found. The size of the codePointSet is specified using numCodePoints.
|
inline |
Returns the index of the first occurrence of codeUnit, or RW_NPOS if that code unit is not found. This method produces the same result as index(RWUChar16) const.
|
inline |
Returns the index of the first occurrence of codePoint, or RW_NPOS if the code point is not found. This method produces the same result as index(RWUChar32) const.
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet, or RW_NPOS if none of the code units in the set are found. The search range starts at index offset within self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet within the specified range of self, or RW_NPOS is none of the code units in the set are found. The search range starts at index offset within self. The codeUnitSet array must be null-terminated.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet, or RW_NPOS if none of the code units in the set are found. The search range starts at index offset within self. The size of the codeUnitSet array is specified using numCodeUnits.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of any code point in codePointSet within the specified range in self, or RW_NPOS if none of the code points in the set are found. The search begins at index position offset within self. The codePointSet array must be null-terminated.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of any code point in codePointSet, or RW_NPOS if none of the code points in the set are found. The search begins at index position offset within self. The size of the codePointSet array is specified using numCodePoints.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of codeUnit, or RW_NPOS if the code unit is not found. The search range starts at index offset within self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of codePoint within the specified range in self, or RW_NPOS if the code point is not found. The search begins at index position offset within self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet within the specified range of self, or RW_NPOS if none of the code units in the set are found. The search range starts at index offset within self and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet within the specified range of self, or RW_NPOS if none of the code units in the set are found. The search range starts at index offset within self and extends for length code units. The codeUnitSet array must be null-terminated.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of any code unit in codeUnitSet within the specified range of self, or RW_NPOS if none of the code units in the set are found. The search range starts at index offset within self, and extends for length code units. The size of the codeUnitSet array is specified using numCodeUnits.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of any code point in codePointSet within the specified range of self, or RW_NPOS if the none of the code points in the set are found. The search range starts at index offset within self and extends for length code units. The codePointSet array must be null-terminated.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of any code point in codePointSet within the specified range of self, or RW_NPOS if the none of the code points in the set are found. The search range starts at index offset within self and extends for length code units. The size of the codePointSet array is specified using numCodePoints.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of codeUnit within the specified range of self, or RW_NPOS if the code unit is not found. The search range starts at index offset within self and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of codePoint within the specified range of self, or RW_NPOS if the code point is not found. The search range starts at index offset within self and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
static |
Retrieves a deallocator for use in constructing an RWBasicUString instance that has been given access to a client-owned and managed buffer.
The Deallocator object is owned by this class and must not be deleted.
unsigned long RWBasicUString::hash | ( | ) | const |
Returns a hash value computed from the contents of self.
Returns the high, UTF-16 surrogate (0xD800
..0xDBFF
) for a code point in the range 0x10000
..0x10FFFF
.
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. Returns an index value of zero if the pattern length is zero.
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The pattern range starts at index patternOffset and extends for patternLength code units. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if the sum of patternOffset and patternLength is greater than pattern.length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The pattern must be null-terminated. Returns an index value of zero if the pattern length is zero.
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The size of the pattern is specified using patternLength. Returns an index value of zero if the pattern length is zero.
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The pattern must be null-terminated. Returns an index value of zero if the pattern length is zero.
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The size of the pattern is specified using patternLength. Returns an index value of zero if the pattern length is zero.
|
inline |
Returns the index of the first occurrence of codeUnit, or RW_NPOS if the code unit is not found. This function produces the same result as first(RWUChar16) const.
|
inline |
Returns the index of the first occurrence of codePoint, or RW_NPOS if the code unit is not found. This function produces the same result as first(RWUChar32) const.
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index position offset within self. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of the specified range in pattern, or RW_NPOS if the pattern is not found. The search begins at index position offset within self. The pattern range starts at index patternOffset and extends for patternLength code units. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(), or if the sum of patternOffset and patternLength is greater than pattern.length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index position offset within self. The pattern must be null-terminated. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index position offset within self. The size of the pattern is specified using patternLength. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index position offset within self. The pattern must be null-terminated. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index position offset within self. The size of the pattern is specified using patternLength. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of codeUnit, or RW_NPOS if the code unit is not found. The search begins at index position offset within self. This function produces the same result as first(size_t,RWUChar16) const.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of codePoint, or RW_NPOS if the code unit is not found. The search begins at index position offset within self. This function produces the same result as first(size_t,RWUChar32) const.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. The pattern range starts at index patternOffset, and extends for patternLength code units. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length() or if the sum of patternOffset and patternLength is greater than pattern.length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. The pattern must be null-terminated. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. The size of the pattern is specified using patternLength. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The pattern must be null-terminated. The search begins at index offset within self and extends for length code units. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. The size of the pattern is specified using patternLength. Returns an index value of zero if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of codeUnit, or RW_NPOS if the code unit is not found. The search begins at index offset within self and extends for length code units. This function produces the same result as first(size_t,RWUChar16) const.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the first occurrence of codePoint, or RW_NPOS if the code unit is not found. The search begins at index offset within self and extends for length code units. This function produces the same result as first(size_t,RWUChar32) const.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Inserts the contents of source before the code unit at index offset within the contents of self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Inserts the contents of the specified range in source before the code unit at index offset within the contents of self.
RWBoundsErr | Thrown if offset is greater than or equal to length() or if the sum of sourceOffset and sourceLength is greater than source.length(). |
|
inline |
Inserts the contents of the null-terminated array source before the code unit at index offset within the contents of self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Inserts the contents of the array source before the code unit at index offset within the contents of self. The size of the source array is specified using sourceLength. The source array may contain embedded nulls.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Converts the code points in the null-terminated array source into UTF-16 code units and inserts those code units before the code unit at index offset within the contents of self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Converts the code points in the array source into UTF-16 code units and inserts those code units before the code unit at index offset within the contents of self. The size of the source array is specified using sourceLength.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Inserts repeat copies of codeUnit before the code unit at index offset within the contents of self. The code unit may be zero or null.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Converts the UTF-32 codePoint into its equivalent UTF-16 representation and inserts repeat copies of the resultant code unit or surrogate pair of code units before the code unit at index offset within the contents of self. The code point may be zero or null.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inlinestatic |
Returns true
if codeUnit encodes the high surrogate of a surrogate pair, otherwise returns false
.
|
inlinestatic |
Returns true
if codeUnit encodes the low surrogate of a surrogate pair, otherwise returns false
.
|
inline |
|
inlinestatic |
Returns true
if codePoint is a valid Unicode character, otherwise returns false
.
Non-characters include:
U+d800
..U+dfff
, 2048 code points)U+__fffe
and U+__ffff
, 34 code points)U+fdd0
..U+fdef
(new with Unicode 3.1, 32 code points)U+10ffff
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet, or RW_NPOS is none of the code units in the set are found.
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet, or RW_NPOS is none of the code units in the set are found. The codeUnitSet array must be null-terminated.
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet, or RW_NPOS if none of the code units in the set are found. The size of the codeUnitSet array is specified using numCodeUnits.
|
inline |
Returns the index of the last occurrence of any code point in codePointSet, or RW_NPOS if none of the code points in the set are found. The codePointSet array must be null-terminated.
|
inline |
Returns the index of the last occurrence of any code point in codePointSet, or RW_NPOS if none of the code points in the set are found. The size of the codePointSet is specified using numCodePoints.
|
inline |
Returns the index of the last occurrence of codeUnit, or RW_NPOS if that code unit is not found.
|
inline |
Returns the index of the last occurrence of codePoint, or RW_NPOS if that code point is not found.
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet within the specified range in self, or RW_NPOS is none of the code units in the set are found. The search begins at index position offset within self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet within the specified range in self, or RW_NPOS if none of the code units in the set are found. The search begins at index position offset within self. The codeUnitSet array must be null-terminated.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet within the specified range in self, or RW_NPOS if none of the code units in the set are found. The search begins at index position offset within self. The size of the codeUnitSet array is specified using numCodeUnits.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of any code point in codePointSet within the specified range of self, or RW_NPOS if none of the code points in the set are found. The search begins at index position offset within self. The codePointSet array must be null-terminated.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of any code point in codePointSet within the specified range in self, or RW_NPOS if none of the code points in the set are found. The search begins at index position offset within self. The size of the codePointSet is specified using numCodePoints.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of codeUnit, within the specified range in self, or RW_NPOS if that code unit is not found. The search begins at index position offset within self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of codePoint within the specified range in self, or RW_NPOS if that code point is not found. The search begins at index position offset within self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet within the specified range in self, or RW_NPOS if none of the code units in the set are found. The search range starts at index offset within self and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet within the specified range in self, or RW_NPOS if none of the code units in the set are found. The search range starts at index offset within self and extends for length code units. The codeUnitSet array must be null-terminated.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of any code unit in codeUnitSet within the specified range in self, or RW_NPOS if none of the code units in the set are found. The search range starts at index offset within self, and extends for length code units. The size of the codeUnitSet array is specified using numCodeUnits.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of any code point in codePointSet within the specified range of self, or RW_NPOS if none of the code points in the set are found. The search range starts at index offset within self and extends for length code units. The codePointSet array must be null-terminated.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of any code point in codePointSet within the specified range in self, or RW_NPOS if none of the code points in the set are found. The search range starts at index offset within self, and extends for length code units. The size of the codePointSet is specified using numCodePoints.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of codeUnit within the specified range in self, or RW_NPOS if that code unit is not found. The search range starts at index offset within self and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of codePoint within the specified range in self, or RW_NPOS if that code point is not found. The search range starts at index offset within self and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the number of UTF-16 code units contained in self, including embedded nulls. This method returns the same value as codeUnitLength(). Use codePointLength() to determine the number of Unicode code points contained in self.
Returns the second or low UTF-16 surrogate (0xDC00
..0xDFFF
) for a code point in the range 0x10000
..0x10FFFF
.
|
inline |
Returns the maximum number of code units that may be stored in an RWBasicUString instance.
|
inline |
Returns a pointer to the contents of self. This array is owned by RWBasicUString and may not be deleted or modified. The pointer becomes invalid if self is modified or destroyed.
The contents may not be null-terminated if the client provided the underlying buffer and there was insufficient space for a terminating null. In all other cases, the contents will be null terminated.
The array may also contain embedded nulls, in which case the length of the code-unit sequence can be determined using length().
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Appends the contents of source to the contents of self and returns a reference to self.
|
inline |
Appends the contents of the null-terminated array source to the contents of self and returns a reference to self.
|
inline |
Appends the contents of the null-terminated array source to the contents of self and returns a reference to self.
|
inline |
Appends codeUnit to the contents of self and returns a reference to self.
|
inline |
Appends codePoint to the contents of self and returns a reference to self.
|
inline |
Move assignment. Self takes ownership of the data owned by rhs.
RWBasicUString& RWBasicUString::operator= | ( | const RWBasicUString & | source | ) |
Replaces the contents of self with the contents of source and returns a reference to self.
RWBasicUString& RWBasicUString::operator= | ( | const RWUChar16 * | source | ) |
Replaces the contents of self with the null-terminated contents of source and returns a reference to self.
RWBasicUString& RWBasicUString::operator= | ( | const RWUChar32 * | source | ) |
Replaces the contents of self with the code unit sequence required to represent the null-terminated, UTF-32 encoded contents of source in the UTF-16 encoding form and returns a reference to self.
RWBasicUString& RWBasicUString::operator= | ( | RWUChar16 | codeUnit | ) |
Replaces the contents of self with the single code unit codeUnit and returns a reference to self.
RWBasicUString& RWBasicUString::operator= | ( | RWUChar32 | codePoint | ) |
Replaces the contents of self with the code unit sequence required to represent codePoint in the UTF-16 encoding form and returns a reference to self.
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns a reference to the code unit at the position specified by offset. This non-const variant can be used as an l-value in an assignment expression.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the code unit value at the position specified by offset.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Prepends the contents of source to the contents of self.
|
inline |
Prepends the contents of the specified range in source to the contents of self. The range starts at index sourceOffset within source and extends for sourceLength code units.
RWBoundsErr | Thrown if the sum of sourceOffset and sourceLength is greater than source.length(). |
|
inline |
Prepends the contents of the null-terminated array source to the contents of self.
|
inline |
Prepends the contents of the array source to the contents of self. The size of the source array is specified using sourceLength. The source array may contain embedded nulls.
|
inline |
Converts the code points in the null-terminated array source into UTF-16 code units and prepends those code units to the contents of self.
|
inline |
Converts the code points in the array source into UTF-16 code units and prepends those code units to the contents of self. The size of the source array is specified using sourceLength.
|
inline |
Prepends repeat copies of codeUnit to the contents of self. The code unit may be zero or null.
|
inline |
Converts the UTF-32 codePoint into its equivalent UTF-16 representation and prepends repeat copies of the resultant code unit or surrogate pair of code units to the contents of self. The code point may be zero or null.
|
inline |
Returns a reverse_iterator that refers to the position of the last code unit in self.
|
inline |
Returns a const_reverse_iterator that refers to the position before the first code unit in self.
|
inline |
Removes the range of code units that start at offset and extend through the end of self.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Removes the specified range of code units from the contents of self, and collapses the contents as necessary to produce a contiguous result.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns a reverse_iterator that refers to the position before the first code unit in self.
|
inline |
Returns a const_reverse_iterator that refers to the position before the first code unit in self.
|
inline |
Replaces the specified range of code units in self with the contents of source. The sum of offset and length must be less than or equal to length().
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Replaces the specified range of code units in self with the specified range of code units in source. The range in self starts at index offset and extends for length code units. The range in source starts at index sourceOffset and extends for sourceLength code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length() or the sum of sourceOffset and sourceLength is greater than source.length(). |
|
inline |
Replaces the specified range of code units in self with the contents of the null-terminated array source. The range in self starts at index offset and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Replaces the specified range of code units in self with the contents of the array source. The range in self starts at index offset and extends for length code units. The size of the source array is specified using sourceLength. The source array may contain embedded nulls.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Converts the code points in the null-terminated array source into UTF-16 code units and replaces the specified range of code units in self with those code units. The range in self starts at index offset and extends for length code units.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Converts the code points in the array source into UTF-16 code units and replaces the specified range of code units in self with those code units. The range in self starts at index offset and extends for length code units. The size of the source array is specified using sourceLength. The source array may contain embedded nulls.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Replaces the specified range of code units in self with repeat copies of codeUnit. The range in self starts at index offset and extends for length code units. The code unit may be zero or null.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Converts the UTF-32 codePoint into its equivalent UTF-16 representation and replaces the specified range of code units in self with repeat copies of the resultant code unit or surrogate pair of code units. The range in self starts at index offset and extends for length code units. The code point may be zero or null.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inlinestatic |
Returns true
if the UTF-16 representation of codeUnit requires the use of a surrogate pair, otherwise returns false
.
|
inline |
Pads or truncates the contents of self as required to produce a length() of newCodeUnitLength. If the new length is greater than the old length, codeUnit is used to pad the contents.
void RWBasicUString::resize | ( | size_t | newCodePointLength, |
RWUChar32 | codePoint | ||
) |
Pads or truncates the contents of self as required to produce a length() of newCodePointLength. If the new length is greater than the old length, codePoint is used to pad the contents.
void RWBasicUString::restoreFrom | ( | RWvistream & | vis | ) |
Replaces the contents of self with the code unit sequence read from vis.
void RWBasicUString::restoreFrom | ( | RWFile & | file | ) |
Replaces the contents of self with the code unit sequence read from file.
|
inline |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The pattern range starts at index patternOffset and extends for patternLength code units. Returns an index value equal to length() if the pattern length is zero.
RWBoundsErr | Thrown if the sum of patternOffset and patternLength is greater than pattern.length(). |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the index of the last occurrence of codeUnit, or RW_NPOS if the code unit is not found. This method is equivalent to last(RWUChar16) const.
|
inline |
Returns the index of the last occurrence of codePoint, or RW_NPOS if the code unit was not found. This method is equivalent to last(RWUChar32) const.
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends through the end of self. Returns an index value equal to length() if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of the specified range in pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends through the end of self.
The pattern begins at index patternOffset within the supplied pattern and extends for patternLength code units. Returns an index value equal to length() if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(), or the sum of patternOffset and patternLength is greater than length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends through the end of self. The pattern must be null-terminated. Returns an index value equal to length() if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends through the end of self. The size of the pattern is specified using patternLength. Returns an index value equal to length() if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends through the end of self. The pattern must be null-terminated. Returns an index value equal to length() if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends through the end of self. The size of the pattern is specified using patternLength. Returns an index value equal to length() if the pattern length is zero.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of codeUnit, or RW_NPOS if the code unit is not found. The search begins at index offset within self and extends through the end of self. This function produces the same result as last(size_t,RWUChar16) const.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of codePoint, or RW_NPOS if the code unit is not found. The search begins at index offset within self and extends through the end of self. This function produces the same result as last(size_t,RWUChar32) const.
RWBoundsErr | Thrown if offset is greater than or equal to length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. Returns an index value equal to the sum of offset and length if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of the specified range in pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units.
The pattern range begins at index patternOffset within pattern and extends for patternLength code units. Returns an index value equal to the sum of offset and length if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(), or the sum of patternOffset and patternLength is greater than pattern.length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. The pattern must be null-terminated. Returns an index value equal to the sum of offset and length if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. The size of the pattern is specified using patternLength. Returns an index value equal to the sum of offset and length if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. The pattern must be null-terminated. Returns an index value equal to the sum of offset and length if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of pattern, or RW_NPOS if the pattern is not found. The search begins at index offset within self and extends for length code units. The size of the pattern is specified using patternLength. Returns an index value equal to the sum of offset and length if the pattern length is zero.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of codeUnit, or RW_NPOS if the code unit is not found. The search begins at index offset within self and extends for length code units. This method is equivalent to last(size_t,RWUChar16) const.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
|
inline |
Returns the index of the last occurrence of codeUnit, or RW_NPOS if the code unit is not found. The search begins at index offset within self and extends for length code units. This method is equivalent to last(size_t,RWUChar32) const.
RWBoundsErr | Thrown if the sum of offset and length is greater than length(). |
void RWBasicUString::saveOn | ( | RWvostream & | vos | ) | const |
Writes the binary contents of self to vos as an array of 16-bit values.
void RWBasicUString::saveOn | ( | RWFile & | file | ) | const |
Writes the binary contents of self to file as an array of 16-bit values.
|
inline |
Returns the size of the code unit sequence contained in self. This method is an alias for length().
Returns the offset of the code unit in self that immediately follows a prefix consisting of a repeated set of code units that correspond to codePoint. If no such prefix exists, a value of 0 is returned. If the contents of self consists entirely of a repeated sequence of codePoint, a value equal to length() is returned. The skip code point defaults to U+0020
, the US-ASCII space character.
Returns the offset of the code unit in self that immediately precedes a suffix consisting of a repeated set of code units that correspond to codePoint. If no such suffix exists, a value length() is returned. If the contents of self consists entirely of a repeated sequence of codePoint, a value of RW_NPOS is returned. The skip code point defaults to U+0020
, the US-ASCII space character.
|
inline |
Swaps the contents of self with that of ustr. This method is provided to satisfy the C++ Standard Library requirements for a container.
std::basic_string<RWUChar32> RWBasicUString::toUtf32 | ( | ) | const |
Returns a UTF-32 encoded representation of the contents of self.
RWConversionErr | Thrown if an illegal or truncated surrogate pair is encountered during the conversion. |
Returns a UTF-8 encoded representation of the contents of self.
RWWString RWBasicUString::toWide | ( | ) | const |
Returns an RWWString containing a UTF-16 or UTF-32 representation of the contents of self, depending on the size of wchar_t
. If sizeof(wchar_t)
is 2
, the RWWString is encoded in UTF-16. If sizeof(wchar_t)
is 4
, the RWWString is encoded in UTF-32.
This method produces Unicode-encoded wide-character strings. This encoding may not match that of the execution environment. The "native" encoding for wchar_t
strings may be determined by the current ANSI/POSIX LC_CTYPE locale and the execution environment. Many environments use Unicode (ISO-10646) as the native encoding for wchar_t
. For those that do, the choice of encoding is typically made based on the size of wchar_t
.
RWConversionErr | Thrown if an illegal or truncated surrogate pair is encountered during the conversion to UTF-32. Such errors are ignored if the result is encoded as UTF-16. |
|
inlinestatic |
Uses the C++ operator delete[]
expression to deallocate an array that was allocated using operator new
.
The method must be defined as an inline method to ensure that the code generated to implement the delete resides in the client library or executable, and not within the Essential Tools library.
The code must be compiled this way to avoid the problems that arise when an application contains some libraries that use debug versions of heap management routines while others do not.
|
inlinestatic |
Calls the C++ Standard Library function std::free() method to deallocate an array that was allocated by a call to std::malloc().
The method must be defined as an inline method to ensure that the version of std::free() called by this method is the same version that is used within the client code, and that it manipulates the same heap as that of std::malloc().
The code must be compiled this way to avoid the problems that arise when an application contains some libraries that use debug versions of heap management routines while others do not.
|
inlinestatic |
When passed to the constructor of StaticDeallocator, results in a StaticDeallocator instance that does nothing.
Use this method when constructing an RWBasicUString instance that has been given access to a client-owned and managed buffer.
Returns codePoint if it is valid. Invalid characters include:
U+d800
..U+dfff
, 2048 code points)U+__fffe
and U+__ffff
, 34 code points)U+fdd0
..U+fdef
(new with Unicode 3.1, 32 code points)U+10ffff
This method may be used anywhere an individual code point value is passed to a method:
RWConversionErr | Thrown if codePoint is not a valid Unicode character. |
|
related |
Returns true
if lhs does not have the same length as, or lexically differs from rhs, otherwise returns false
. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case. This operator represents the logical negation of operator==(const RWUChar16*,const RWBasicUString&).
|
related |
Returns true
if lhs does not have the same length as, or lexically differs from rhs, otherwise returns false
. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case. This operator represents the logical negation of operator==(const RWBasicUString&, const RWUChar16*).
|
related |
Returns true
if lhs does not have the same length as, or lexically differs from rhs, otherwise returns false
. This operator represents the logical negation of operator==(const RWBasicUString&,const RWBasicUString&).
|
related |
Returns true
if lhs does not have the same length as, or lexically differs from rhs, otherwise returns false
. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case. This operator represents the logical negation of operator==(const RWUChar32*,const RWBasicUString&).
|
related |
Returns true
if lhs is lexically greater than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case. This operator represents the logical negation of operator==(const RWBasicUString&,const RWUChar32*).
|
related |
Returns true
if lhs is lexically less than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs is lexically less than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs is lexically less than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array.
|
related |
Returns true
if lhs is lexically less than rhs; otherwise, returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Returns true
if lhs is lexically less than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Converts the contents of ustr into a UTF-8 sequence and writes that sequence to the output stream. The output sequence may contain embedded nulls.
If the width()
of the output stream is greater than the number of code points contained in the source string, the output is padded using a single space fill character, [U+0020]. If the
width()
is less than the number of code points contained in the source string, the entire contents of the string is inserted into the output stream. Any padding is inserted after the string if the ios_base::left
format flag is set, or before if ios_base::right
is set or neither flag is set.
RWConversionErr | Thrown to report conversion errors. |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
|
related |
Converts the contents of ustr into a UTF-8 sequence and writes that sequence to the output stream. The output sequence may contain embedded nulls.
If the width()
of the output stream is greater than the number of code points contained in the source string, the output is padded using a single space fill character, [U+0020]. If the
width()
is less than the number of code points contained in the source string, the entire contents of the string is inserted into the output stream. Any padding is inserted after the string if the ios_base::left
format flag is set, or before if ios_base::right
is set or neither flag is set.
RWConversionErr | Thrown to report conversion errors. |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
|
related |
Converts the contents of ustr into a UTF-8 sequence and writes that sequence to the output stream. The output sequence may contain embedded nulls.
If the width()
of the output stream is greater than the number of code points contained in the source string, the output is padded using a single space fill character, [U+0020]. If the
width()
is less than the number of code points contained in the source string, the entire contents of the string is inserted into the output stream. Any padding is inserted after the string if the ios_base::left
format flag is set, or before if ios_base::right
is set or neither flag is set.
RWConversionErr | Thrown to report conversion errors. |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
|
related |
Returns true
if lhs is lexically less than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs is lexically less than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs is lexically less than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array.
|
related |
Returns true
if lhs is lexically less than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Returns true
if lhs is lexically less than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the shorter array is considered less than the longer array. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Returns true
if lhs has the same length and is lexically identical to rhs, otherwise returns false
. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs has the same length and is lexically identical to rhs, otherwise returns false
. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs has the same length and is lexically identical to rhs, otherwise returns false
.
|
related |
Returns true
if lhs has the same length and is lexically identical to rhs, otherwise returns false
. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Returns true
if lhs has the same length and is lexically identical to rhs, otherwise returns false
. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Returns true
if lhs is lexically greater than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs is lexically greater than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs is lexically greater than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array.
|
related |
Returns true
if lhs is lexically greater than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Returns true
if lhs is lexically greater than rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Returns true
if lhs is lexically greater than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs is lexically greater than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodeUnits() in that case.
|
related |
Returns true
if lhs is lexically greater than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array.
|
related |
Returns true
if lhs is lexically greater than or equal to rhs, otherwise returns false
. If the two arrays are identical over the length of the shortest array, then the longer array is considered greater than the shorter array. The lhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
related |
Returns true
if lhs does not have the same length as, or lexically differs from rhs, otherwise returns false
. The rhs array must be null-terminated. This method cannot be used to compare arrays containing embedded nulls. Use RWBasicUString::compareCodePoints() in that case.
|
friend |
Reads a UTF-8 encoded string from the input stream and stores it in the provided RWBasicUString instance. Leading white space is always skipped before storing any code points, regardless of the ios::skipws
format flag setting. Code points are then extracted until:
width()
is greater than zero, until width() code points have been readThe following Unicode characters are treated as whitespace delimiters:
Unlike standard extractors, this extractor must consume and discard the trailing whitespace delimiter. This behavior is due to the nature of the UTF-8 encoding scheme, which requires multiple bytes to encode some whitespace characters.
For the same reason, this extractor cannot support the noskipws
condition where the ios_base::skipws
format flag has been cleared because each extraction would consume one whitespace character. A whitespace manipulator is not provided either, since such a manipulator would consume the first non-whitespace character following a sequence of whitespace characters.
RWConversionErr | Thrown to report conversion errors. |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
If the virtual stream or file experience an error while extracting the string, the operator returns the original string contents unmodified. Check the virtual stream or file to determine if an error occurred on extraction.
|
related |
Reads a UTF-8 encoded string from the input stream and stores it in the provided RWBasicUString instance. Leading white space is always skipped before storing any code points, regardless of the ios::skipws
format flag setting. Code points are then extracted until:
width()
is greater than zero, until width() code points have been readThe following Unicode characters are treated as whitespace delimiters:
Unlike standard extractors, this extractor must consume and discard the trailing whitespace delimiter. This behavior is due to the nature of the UTF-8 encoding scheme, which requires multiple bytes to encode some whitespace characters.
For the same reason, this extractor cannot support the noskipws
condition where the ios_base::skipws
format flag has been cleared because each extraction would consume one whitespace character. A whitespace manipulator is not provided either, since such a manipulator would consume the first non-whitespace character following a sequence of whitespace characters.
RWConversionErr | Thrown to report conversion errors. |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
If the virtual stream or file experience an error while extracting the string, the operator returns the original string contents unmodified. Check the virtual stream or file to determine if an error occurred on extraction.
|
related |
Reads a UTF-8 encoded string from the input stream and stores it in the provided RWBasicUString instance. Leading white space is always skipped before storing any code points, regardless of the ios::skipws
format flag setting. Code points are then extracted until:
width()
is greater than zero, until width() code points have been readThe following Unicode characters are treated as whitespace delimiters:
Unlike standard extractors, this extractor must consume and discard the trailing whitespace delimiter. This behavior is due to the nature of the UTF-8 encoding scheme, which requires multiple bytes to encode some whitespace characters.
For the same reason, this extractor cannot support the noskipws
condition where the ios_base::skipws
format flag has been cleared because each extraction would consume one whitespace character. A whitespace manipulator is not provided either, since such a manipulator would consume the first non-whitespace character following a sequence of whitespace characters.
RWConversionErr | Thrown to report conversion errors. |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
If the virtual stream or file experience an error while extracting the string, the operator returns the original string contents unmodified. Check the virtual stream or file to determine if an error occurred on extraction.
|
related |
Reads a UTF-8 encoded string from the input stream and stores it in the provided RWBasicUString instance. Leading white space is always skipped before storing any code points, regardless of the ios::skipws
format flag setting. Code points are then extracted until:
width()
is greater than zero, until width() code points have been readThe following Unicode characters are treated as whitespace delimiters:
Unlike standard extractors, this extractor must consume and discard the trailing whitespace delimiter. This behavior is due to the nature of the UTF-8 encoding scheme, which requires multiple bytes to encode some whitespace characters.
For the same reason, this extractor cannot support the noskipws
condition where the ios_base::skipws
format flag has been cleared because each extraction would consume one whitespace character. A whitespace manipulator is not provided either, since such a manipulator would consume the first non-whitespace character following a sequence of whitespace characters.
RWConversionErr | Thrown to report conversion errors. |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
If the virtual stream or file experience an error while extracting the string, the operator returns the original string contents unmodified. Check the virtual stream or file to determine if an error occurred on extraction.
|
related |
Reads a UTF-8 encoded string from the input stream and stores it in the provided RWBasicUString instance. Leading white space is always skipped before storing any code points, regardless of the ios::skipws
format flag setting. Code points are then extracted until:
width()
is greater than zero, until width() code points have been readThe following Unicode characters are treated as whitespace delimiters:
Unlike standard extractors, this extractor must consume and discard the trailing whitespace delimiter. This behavior is due to the nature of the UTF-8 encoding scheme, which requires multiple bytes to encode some whitespace characters.
For the same reason, this extractor cannot support the noskipws
condition where the ios_base::skipws
format flag has been cleared because each extraction would consume one whitespace character. A whitespace manipulator is not provided either, since such a manipulator would consume the first non-whitespace character following a sequence of whitespace characters.
RWConversionErr | Thrown to report conversion errors. |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
If the virtual stream or file experience an error while extracting the string, the operator returns the original string contents unmodified. Check the virtual stream or file to determine if an error occurred on extraction.
|
static |
A static constant representing the Unicode space character.
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |