CopperSpice API
1.9.2
|
Provides a UTF-16 string class. More...
Inherits CsString_utf16
Classes | |
class | const_iterator |
STL style const iterator for QString16 More... | |
class | iterator |
STL style iterator for QString16 More... | |
Public Typedefs | |
using | const_reverse_iterator = CsString::CsStringReverseIterator< const_iterator > |
using | difference_type = std::ptrdiff_t |
using | reverse_iterator = CsString::CsStringReverseIterator< iterator > |
using | size_type = std::ptrdiff_t |
using | storage_type = char16_t |
using | value_type = QChar32 |
Public Types | |
enum | NormalizationForm |
Public Methods | |
QString16 () = default | |
template<int N> | |
QString16 (const char (&cStr)[N]) | |
QString16 (const char16_t *data) | |
QString16 (const QByteArray &str) | |
QString16 (const QChar32 *data, size_type numOfChars=-1) | |
QString16 (const QString16 &other) = default | |
QString16 (const_iterator begin, const_iterator end) | |
template<typename Iterator > | |
QString16 (Iterator begin, Iterator end) | |
QString16 (QChar32 c) | |
QString16 (QChar32::SpecialCharacter c) | |
QString16 (QString16 &&other) = default | |
QString16 (QStringView16 str) | |
QString16 (size_type numOfChars, QChar32 c) | |
~QString16 () = default | |
QString16 & | append (char32_t c) |
QString16 & | append (const QChar32 *data, size_type numOfChars) |
QString16 & | append (const QString16 &other) |
QString16 & | append (const_iterator iter_begin, const_iterator iter_end) |
QString16 & | append (QChar32 c) |
QString16 & | append (QStringView16 str) |
QString16 & | append (QStringView16 str, size_type indexStart, size_type numOfChars) |
QChar32 | at (size_type index) const |
QChar32 | back () const |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
void | chop (size_type numOfChars) |
void | clear () |
int | compare (const QString16 &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
int | compare (QStringView16 str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_iterator | constBegin () const |
const char16_t * | constData () const |
const_iterator | constEnd () const |
bool | contains (char ch, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | contains (const QRegularExpression16 ®Exp) const |
bool | contains (const QString16 &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | contains (QChar32 c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | contains (QStringView16 str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
size_type | count () const |
size_type | count (const QRegularExpression16 ®Exp) const |
size_type | count (const QString16 &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
size_type | count (QChar32 c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
size_type | count (QStringView16 str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
const char16_t * | data () const |
bool | empty () const |
iterator | end () |
const_iterator | end () const |
bool | endsWith (const QString16 &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | endsWith (QChar32 c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | endsWith (QStringView16 str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
QString16 & | fill (QChar32 c, size_type numOfChars=-1) |
QChar32 | first () const |
template<typename SP = QStringParser, typename... Ts> | |
QString16 | formatArg (Ts &&...args) const |
template<typename SP = QStringParser, typename... Ts> | |
QString16 | formatArgs (Ts &&...args) const |
QChar32 | front () const |
size_type | indexOf (const QRegularExpression16 ®Exp, size_type from=0) const |
size_type | indexOf (const QString16 &str, size_type from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
size_type | indexOf (QChar32 c, size_type from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_iterator | indexOfFast (const QRegularExpression16 ®Exp) const |
const_iterator | indexOfFast (const QRegularExpression16 ®Exp, const_iterator from) const |
const_iterator | indexOfFast (const QString16 &str) const |
const_iterator | indexOfFast (const QString16 &str, const_iterator from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_iterator | indexOfFast (QChar32 c) const |
const_iterator | indexOfFast (QChar32 c, const_iterator from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_iterator | indexOfFast (QStringView16 str, const_iterator from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
QString16 & | insert (const_iterator first, const QString16 &str) |
template<typename Iterator > | |
QString16 & | insert (const_iterator first, Iterator begin, Iterator end) |
QString16 & | insert (size_type indexStart, const QChar32 *data, size_type numOfChars) |
QString16 & | insert (size_type indexStart, const QString16 &str) |
QString16 & | insert (size_type indexStart, QChar32 c) |
QString16 & | insert (size_type indexStart, QStringView16 str) |
QString16 & | insert (size_type indexStart, QStringView16 str, size_type srcStart, size_type numOfChars) |
bool | isEmpty () const |
QChar32 | last () const |
size_type | lastIndexOf (const QString16 &str, size_type from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
size_type | lastIndexOf (QChar32 c, size_type from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_iterator | lastIndexOfFast (const QString16 &str) const |
const_iterator | lastIndexOfFast (const QString16 &str, const_iterator from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_iterator | lastIndexOfFast (QChar32 c) const |
const_iterator | lastIndexOfFast (QChar32 c, const_iterator from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_iterator | lastIndexOfFast (QStringView16 str, const_iterator from, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
QString16 | left (size_type numOfChars) const |
QString16 | leftJustified (size_type width, QChar32 fill=UCHAR (' '), bool truncate=false) const |
QStringView16 | leftView (size_type numOfChars) const |
size_type | length () const |
int | localeAwareCompare (const QString16 &str) const |
int | localeAwareCompare (QStringView16 str) const |
QString16 | mid (const_iterator iter, size_type numOfChars=-1) const |
QString16 | mid (size_type indexStart, size_type numOfChars=-1) const |
QStringView16 | midView (const_iterator iter, size_type numOfChars=-1) const |
QStringView16 | midView (size_type indexStart, size_type numOfChars=-1) const |
QString16 | normalized (QString16::NormalizationForm mode, QChar32::UnicodeVersion version=QChar32::Unicode_Unassigned) const |
QString16 & | operator+= (const QString16 &other) |
QString16 & | operator+= (QChar32 c) |
QString16 & | operator+= (QChar32::SpecialCharacter c) |
QString16 & | operator+= (QStringView16 str) |
QString16 & | operator= (const QString16 &other) = default |
QString16 & | operator= (QChar32 c) |
QString16 & | operator= (QString16 &&other) = default |
QString16 & | operator= (QStringView16 str) |
QChar32 | operator[] (size_type index) const |
QString16 & | prepend (char32_t c) |
QString16 & | prepend (const QChar32 *data, size_type numOfChars) |
QString16 & | prepend (const QString16 &other) |
QString16 & | prepend (const_iterator iter_begin, const_iterator iter_end) |
QString16 & | prepend (QChar32 c) |
void | push_back (const QString16 &other) |
void | push_back (QChar32 c) |
void | push_front (const QString16 &other) |
void | push_front (QChar32 c) |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
QString16 & | remove (const QRegularExpression16 ®Exp) |
QString16 & | remove (const QString16 &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString16 & | remove (QChar32 c, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString16 & | remove (size_type indexStart, size_type numOfChars) |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
QString16 | repeated (size_type count) const |
QString16 & | replace (const QChar32 *before, size_type beforeSize, const QChar32 *after, size_type afterSize, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString16 & | replace (const QRegularExpression16 ®Exp, const QString16 &after) |
QString16 & | replace (const QString16 &before, const QString16 &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString16 & | replace (const_iterator first, const_iterator last, const QString16 &str) |
template<typename Iterator > | |
QString16 & | replace (const_iterator first1, const_iterator last1, Iterator first2, Iterator last2) |
QString16 & | replace (QChar32 before, QChar32 after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString16 & | replace (QChar32 c, const QString16 &after, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
QString16 & | replace (size_type indexStart, size_type numOfChars, const QChar32 *data, size_type sizeStr) |
QString16 & | replace (size_type indexStart, size_type numOfChars, const QString16 &str) |
QString16 & | replace (size_type indexStart, size_type numOfChars, const QString16 &str, size_type sizeStr) |
QString16 & | replace (size_type indexStart, size_type numOfChars, QChar32 c) |
void | resize (size_type numOfChars) |
void | resize (size_type numOfChars, QChar32 c) |
QString16 | right (size_type count) const |
QString16 | rightJustified (size_type width, QChar32 fill=UCHAR (' '), bool truncate=false) const |
QStringView16 | rightView (size_type count) const |
template<typename SP = QStringParser, typename... Ts> | |
QString16 | section (const QString16 &separator, Ts...args) const |
template<typename SP = QStringParser, typename... Ts> | |
QString16 | section (QChar32 separator, Ts...args) const |
QString16 | simplified () && |
QString16 | simplified () const & |
size_type | size () const |
size_type | size_storage () const |
template<typename SP = QStringParser, typename... Ts> | |
auto | split (const QRegularExpression16 &separator, Ts...args) const |
template<typename SP = QStringParser, typename... Ts> | |
auto | split (const QString16 &separator, Ts...args) const |
template<typename SP = QStringParser, typename... Ts> | |
auto | split (QChar32 separator, Ts...args) const |
void | squeeze () |
bool | startsWith (const QString16 &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | startsWith (QChar32 c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
bool | startsWith (QStringView16 str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
const_storage_iterator | storage_begin () const |
const_storage_iterator | storage_end () const |
const_storage_reverse_iterator | storage_rbegin () const |
const_storage_reverse_iterator | storage_rend () const |
void | swap (QString16 &other) |
QString16 | toCaseFolded () && |
QString16 | toCaseFolded () const & |
CFStringRef | toCFString () const |
template<typename SP = QStringParser> | |
double | toDouble (bool *ok=nullptr) const |
template<typename SP = QStringParser> | |
float | toFloat (bool *ok=nullptr) const |
QString16 | toHtmlEscaped () const |
template<typename R , typename SP = QStringParser> | |
R | toInteger (bool *ok=nullptr, int base=10) const |
QByteArray | toLatin1 () const |
QString16 | toLower () && |
QString16 | toLower () const & |
NSString * | toNSString () const |
std::wstring | toStdWString () const |
QString16 | toUpper () && |
QString16 | toUpper () const & |
QByteArray | toUtf8 () const |
QString16 | trimmed () && |
QString16 | trimmed () const & |
void | truncate (size_type length) |
const uint16_t * | utf16 () const |
Static Public Methods | |
static int | compare (const QString16 &str1, const QString16 &str2, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
static int | compare (QStringView16 str1, QStringView16 str2, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
static QString16 | fromCFString (CFStringRef string) |
static QString16 | fromLatin1 (const char *str, size_type numOfChars=-1) |
static QString16 | fromLatin1 (const QByteArray &str) |
static QString16 | fromNSString (const NSString *string) |
static QString16 | fromStdString (const std::string &str, size_type numOfChars=-1) |
static QString16 | fromStdWString (const std::wstring &str, size_type numOfChars=-1) |
static QString16 | fromUtf16 (const char16_t *str, size_type numOfChars=-1) |
static QString16 | fromUtf8 (const char *str, size_type numOfChars=-1) |
static QString16 | fromUtf8 (const QByteArray &str) |
static QString16 | fromUtf8 (const QString8 &str) |
static int | localeAwareCompare (const QString16 &str1, const QString16 &str2) |
static int | localeAwareCompare (QStringView16 str1, QStringView16 str2) |
template<typename SP = QStringParser> | |
static QString16 | number (double value, char format= 'g', int precision=6) |
template<typename V , typename SP = QStringParser> | |
static QString16 | number (V value, int base=10) |
Related Functions | |
These are not member functions | |
bool | operator!= (const char (&cString)[N], const QString16 &str) |
bool | operator!= (const QString16 &str, const char (&cString)[N]) |
bool | operator!= (const QString16 &str1, const QString16 &str2) |
QString16 | operator+ (const char (&cString)[N], const QString16 &str) |
QString16 | operator+ (const QString16 &str, const char (&cString)[N]) |
QString16 | operator+ (const QString16 &str, QChar32 c) |
QString16 | operator+ (const QString16 &str1, const QString16 &str2) |
QString16 | operator+ (QChar32 c, const QString16 &str) |
QString16 && | operator+ (QString16 &&str, const char (&cString)[N]) |
QString16 && | operator+ (QString16 &&str, QChar32 c) |
QString16 && | operator+ (QString16 &&str1, const QString16 &str2) |
bool | operator< (const char (&cString)[N], const QString16 &str) |
bool | operator< (const QString16 &str, const char (&cString)[N]) |
bool | operator< (const QString16 &str1, const QString16 &str2) |
QDataStream & | operator<< (QDataStream &stream, const QString16 &str) |
bool | operator<= (const char (&cString)[N], const QString16 &str) |
bool | operator<= (const QString16 &str, const char (&cString)[N]) |
bool | operator<= (const QString16 &str1, const QString16 &str2) |
bool | operator== (const char (&cString)[N], const QString16 &str) |
bool | operator== (const QString16 &str, const char (&cString)[N]) |
bool | operator== (const QString16 &str1, const QString16 &str2) |
bool | operator> (const char (&cString)[N], const QString16 &str) |
bool | operator> (const QString16 &str, const char (&cString)[N]) |
bool | operator> (const QString16 &str1, const QString16 &str2) |
bool | operator>= (const char (&cString)[N], const QString16 &str) |
bool | operator>= (const QString16 &str, const char (&cString)[N]) |
bool | operator>= (const QString16 &str1, const QString16 &str2) |
QDataStream & | operator>> (QDataStream &stream, QString16 &str) |
void | swap (QString16 &str1, QString16 &str2) |
QString16 provides a UTF-16 Unicode aware string class which stores a sequence of QChar32 elements. Each QChar32 corresponds to one Unicode code point. Unicode is an international standard which supports the majority of human languages.
CopperSpice also provides QByteArray to store raw bytes and traditional 8-bit null terminated strings. QString8 is the appropriate string class in almost all cases. The QByteArray class is appropriate when storing raw binary data. QString16 should only be used when interfacing with external libraries which expect UTF-16 encoded data.
Using the QString8 class is synonymous with using QString. There is a typedef in CopperSpice which defines QString as equivalent to QString8.
For more information about strings, code points, text encodings, and internationalization refer to Unicode and Internationalization.
Provides an STL style const reverse iterator for QString16.
Typedef for an integer type representing the distance between two elements in a QString16.
Provides an STL style non-const reverse iterator for QString16.
Typedef for an integer type representing sizes in a QString16.
Typedef for char16_t.
Typedef for the elements stored in a QString16.
This enum describes the various normalized forms of Unicode text.
Constant | Value | Description |
---|---|---|
QString16::NormalizationForm_D | 0 | Canonical Decomposition |
QString16::NormalizationForm_C | 1 | Canonical Decomposition followed by Canonical Composition |
QString16::NormalizationForm_KD | 2 | Compatibility Decomposition |
QString16::NormalizationForm_KC | 3 | Compatibility Decomposition followed by Canonical Composition |
|
default |
Constructs an empty string.
|
inline |
Constructs a new QString16 from data.
|
default |
Copy constructs a new QString16 from other.
|
default |
Move constructs a new QString16 from other.
QString16::QString16 | ( | QChar32 | c | ) |
Constructs a string of size 1 containing the code point c.
Constructs a string of the given numOfChars with every code point set to c.
|
inline |
Constructs a string using the special Unicode character c.
|
inline |
Constructs a string using the const iterator range begin to end.
|
inline |
Constructs a string using the given string literal cStr.
|
inline |
Constructs a string initialized with str. The entire string is copied including any null characters. The contents of the QByteArray must be valid UTF-8.
This constructor will only be available if you define CS_STRING_ALLOW_UNSAFE.
|
inline |
Constructs a string using the iterator range begin to end. The elements in the range must be implicitly convertible to QChar32.
|
inline |
Constructs a string using the string view str.
|
default |
Destroys this string.
|
inline |
Appends the code point c to this string and returns a reference to this string.
Appends the first numOfChars number of code points pointed to by data.
|
inline |
Appends the string other to the end of this string. Returns a reference to this string.
|
inline |
Appends from iter_begin to iter_end, to the end of this string. Returns a reference to this string.
|
inline |
Appends the code point c to this string and returns a reference to this string.
|
inline |
Appends the given string view str to this string. Returns a reference to this string.
|
inline |
Appends the given string view str to this string, beginning at position indexStart in str and continuing for the length numOfChars. Returns a reference to this string.
Returns the code point at the given position index in the string. The index must be a valid position in the string.
|
inline |
Returns the last code point in this string.
|
inline |
Returns an STL style iterator pointing to the first code point in the string.
|
inline |
Returns a const STL style iterator pointing to the first code point in the string.
|
inline |
Returns a const STL style iterator pointing to the first code point in the string.
|
inline |
Returns a const STL style iterator pointing to the imaginary item after the last code point in the string.
void QString16::chop | ( | size_type | numOfChars | ) |
|
inline |
|
inline |
Compares this string with the string str. If cs is Qt::CaseSensitive the comparison is case sensitive, otherwise the comparison is case insensitive.
|
inlinestatic |
Compares str1 with str2. If cs is Qt::CaseSensitive the comparison is case sensitive, otherwise the comparison is case insensitive.
|
inline |
Compares this string with the string view str. If cs is Qt::CaseSensitive the comparison is case sensitive, otherwise the comparison is case insensitive.
|
static |
Compares string view str1 with the string view str2. If cs is Qt::CaseSensitive the comparison is case sensitive, otherwise the comparison is case insensitive.
|
inline |
Returns a const STL style iterator pointing to the first code point in the string.
|
inline |
Returns a pointer to the null terminated data stored in the string. The pointer is valid until the string is modified.
|
inline |
Returns a const STL style iterator pointing to the imaginary item after the last code point in the string.
|
inline |
Returns true if this string contains an occurrence of the character ch, otherwise returns false. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns true if this string contains an occurrence of the regular expression regExp, otherwise it returns false.
bool QString16::contains | ( | const QString16 & | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if this string contains an occurrence of the string str, otherwise it returns false. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
bool QString16::contains | ( | QChar32 | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if this string contains an occurrence of the character c, otherwise returns false. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
bool QString16::contains | ( | QStringView16 | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
size_type QString16::count | ( | const QRegularExpression16 & | regExp | ) | const |
Returns the number of occurrences of the regular expression regExp in the string.
size_type QString16::count | ( | const QString16 & | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns the number of (potentially overlapping) occurrences of the string str in this string. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
size_type QString16::count | ( | QChar32 | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns the number of occurrences of character c in the string. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
size_type QString16::count | ( | QStringView16 | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns the number of occurrences of the string view str in this string. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns an STL style iterator pointing to the last code point in the string, in reverse order.
|
inline |
Returns a const STL style iterator pointing to the imaginary item before the first code point in the string, in reverse order.
|
inline |
Returns a pointer to the null terminated data stored in the string. The pointer is valid until the string is modified.
|
inline |
Returns true if the string has no characters, otherwise returns false.
|
inline |
Returns an STL style iterator pointing to the imaginary item after the last code point in the string.
|
inline |
Returns a const STL style iterator pointing to the imaginary item after the last code point in the string.
bool QString16::endsWith | ( | const QString16 & | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the string ends with str, otherwise returns false. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
bool QString16::endsWith | ( | QChar32 | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the current string ends with c, otherwise returns false.
bool QString16::endsWith | ( | QStringView16 | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the current string ends with the string view str, otherwise returns false. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns the first code point in this string.
|
nodiscardinline |
Wrapper for QStringParser::formatArg(). In order to use this method in your application include the <QStringParser> header file.
|
nodiscardinline |
Wrapper for QStringParser::formatArgs(). In order to use this method in your application include the <QStringParser> header file.
|
static |
Constructs a new QString containing a copy of the string CFString.
|
static |
Returns a QString16 containing the first numOfChars number of Latin-1 characters specified in str. If value for numOfChars is -1 the entire str is used.
|
static |
Returns a QString16 containing the Latin-1 string str.
|
static |
Constructs a new QString containing a copy of the string NSString.
|
static |
Returns a QString16 containing the std::string str.
|
static |
Returns a QString16 containing the std::wstring str.
|
static |
Returns a QString16 containing the first numOfChars number of characters from the UTF-16 string str. If the value for numOfChars is -1 the str must be null terminated.
|
static |
Returns a QString16 containing the first numOfChars number of characters from the C string str. If the value for numOfChars is -1 the str must be null terminated.
|
static |
Returns a QString16 containing the UTF-8 string str.
|
static |
Returns a QString16 containing the UTF-8 string str.
|
inline |
Returns the first code point in this string.
|
inline |
Returns the index position of the first occurrence of the regular expression regExp in the string, searching forward from the index position from. Returns -1 if regExp is not found.
|
inline |
Returns the index position of the first occurrence of str in this string. The search begins at position from. Returns -1 if str is not found.
If from is -1 the search starts at the last character, if from is -2 the search starts at the next to last character, and so on. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns the index position of the first occurrence of the character c in the string, searching forward from index position from. Returns -1 if c is not found.
If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns the iterator position of the first occurrence of the regular expression regExp in the string. Returns the end iterator if the regExp is not found.
const_iterator QString16::indexOfFast | ( | const QRegularExpression16 & | regExp, |
const_iterator | from | ||
) | const |
Returns the iterator position of the first occurrence of the string view str in the string, searching forward from iterator position from. Returns the end iterator if str is not found.
|
inline |
Returns an iterator to the first occurrence of str in this string. Returns the end iterator if str is not found.
|
inline |
Returns an iterator to the first occurrence of str in this string, searching forward from iterator from. Returns the end iterator if str is not found.
If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns an iterator to the first occurrence of c in this string. Returns the end iterator if c is not found.
|
inline |
Returns an iterator to the first occurrence of c in this string, searching forward from iterator from. Returns the end iterator if c is not found.
If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns the iterator position of the first occurrence of the string view str in the string, searching forward from iterator position from. Returns the end iterator if str is not found.
If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Beginning at position first in the current string, insert str. Returns a reference to this string.
|
inline |
Beginning at position first in the current string, insert the range of characters from begin to end. Returns a reference to this string.
|
inline |
At position indexStart in the string, insert the first numOfChars number of code points pointed to by data.
|
inline |
Inserts c at the given index indexStart in the string.
|
inline |
Inserts the string view str at the given position indexStart in this string. Returns a reference to this string.
|
inline |
Inserts the string view str at the given position indexStart in the string, beginning at the position srcStart in str and continuing for the length numOfChars.
Returns a reference to this string.
|
inline |
|
inline |
Returns the last code point in this string.
|
inline |
Returns the index position of the last occurrence of the string str in this string, searching backward from index position from. Returns -1 if str is not found.
If from is -1 the search starts at the last character, if from is -2 the search starts at the next to last character, and so on. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns the index position of the last occurrence of the character c, searching backward from position from. Returns -1 if str is not found.
If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns an iterator to the last occurrence of str in this string. Returns the end iterator if str is not found.
|
inline |
Returns an iterator to the first occurrence of str in this string, searching backward from iterator from. Returns the end iterator if str is not found.
If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns an iterator to the last occurrence of c in this string. Returns the end iterator if c is not found.
|
inline |
Returns an iterator to the last occurrence of c in this string, searching backward from iterator from. Returns the end iterator if c is not found.
If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns the iterator position of the last occurrence of the string view str in this string, searching backward from iterator position from. Returns the end iterator if str is not found.
If from is -1 the search starts at the last character, if from is -2 the search starts at the next to last character, and so on. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
nodiscard |
Returns a new QString16 containing the first numOfChars code points in this string. The entire string is returned if numOfChars is greater than size() or less than zero.
|
nodiscard |
Returns a string of size width that contains this string padded by the fill character. If truncate is false and the size() of the string is more than the value of width, then the returned string is a copy of the string.
If truncate is true and the size() of the string is more than width, then any characters in a copy of the string after position width are removed and the copy is returned.
|
nodiscard |
Returns a QStringView16 containing the first numOfChars code points in this string. The entire string is returned if numOfChars is greater than size() or less than zero.
|
inline |
|
inline |
Compares string str with this string object and returns an integer based on the sort relationship of the strings. The comparison is performed platform dependent.
|
inlinestatic |
Compares string str1 with string str2 and returns an integer based on the sort relationship of the strings. The comparison is performed platform dependent.
|
inline |
Compares this string with the string view str and returns an integer based on the sort relationship of the strings. The comparison is performed platform dependent.
|
static |
Compares string view str1 with string view str2 and returns an integer based on the sort relationship of the strings. The comparison is performed platform dependent.
|
nodiscard |
Returns a string containing numOfChars characters of this string, starting at the iterator position iter.
Returns a string containing numOfChars characters of this string, starting at the position indexStart.
Returns an empty string if the index exceeds the length of the string. If there are less than numOfChars characters available in the string, starting at the given index, or if numOfChars is -1, the method returns all characters available from the specified index to the end of the string.
QStringView16 QString16::midView | ( | const_iterator | iter, |
size_type | numOfChars = -1 |
||
) | const |
Returns a QStringView16 containing the code points starting at iterator position iter for a length of numOfChars.
QStringView16 QString16::midView | ( | size_type | indexStart, |
size_type | numOfChars = -1 |
||
) | const |
Returns a QStringView16 containing the code points starting at indexStart for a length of numOfChars.
|
nodiscard |
Returns the string in the given Unicode normalization mode, according to the given version of the Unicode standard.
|
nodiscardinlinestatic |
Wrapper for QStringParser::number(). In order to use this method in your application include the <QStringParser> header file.
|
nodiscardinlinestatic |
Wrapper for QStringParser::number(). In order to use this method in your application include the <QStringParser> header file.
|
inline |
|
inline |
Appends c to this string and returns a reference to this string.
|
inline |
Appends the special Unicode character c to this string and returns a reference to this string.
|
inline |
Appends the string view str to this string.
|
default |
Copy assigns from other and returns a reference to this object.
|
inline |
Assigns c to this string and returns a reference to this string.
|
default |
Move assigns from other and returns a reference to this object.
|
inline |
Assigns the string view str to this string and returns a reference to this string.
Returns the code point at the specified index in the string. Equivalent to calling at(index)
.
|
inline |
Prepends the character c to this string and returns a reference to this string.
Prepends the first numOfChars number of characters pointed to by data.
|
inline |
|
inline |
Prepends from iter_begin to iter_end. Returns a reference to this string.
|
inline |
Prepends the character c to this string and returns a reference to this string.
|
inline |
This method is equivalent to appending the given other string onto the end of this string. It is the same as append(other)
.
|
inline |
Appends the given c character to the end of this string.
|
inline |
This method is equivalent to prepending the given other string to the beginning of this string. It is the same as prepend(other)
.
|
inline |
Prepends the given c character to the beginning of this string.
|
inline |
Returns an STL style iterator pointing to the last code point in the string, in reverse order.
|
inline |
Returns a const STL style iterator pointing to the last code point in the string, in reverse order.
|
inline |
Removes every occurrence of the regular expression regExp in the string and returns a reference to the string.
QString16 & QString16::remove | ( | const QString16 & | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Removes every occurrence of the given str in this string and returns a reference to this string. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
This is the same as replace(str, "", cs)
.
QString16 & QString16::remove | ( | QChar32 | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Removes every occurrence of the character c in this string, and returns a reference to this string. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
This is the same as replace(c, "", cs)
.
Removes numOfChars code points from the string, starting at the given indexStart index. Returns a reference to the string. If (indexStart + numOfChars) is beyond the end of the string, the string is truncated at the specified indexStart.
|
inline |
Returns an STL style iterator pointing to the imaginary item before the first code point in the string, in reverse order.
|
inline |
Returns a const STL style iterator pointing to the imaginary item before the first code point in the string, in reverse order.
|
nodiscard |
Returns a copy of this string repeated the specified number of count. If the value for times is less than 1, an empty string is returned.
QString16 & QString16::replace | ( | const QChar32 * | before, |
size_type | beforeSize, | ||
const QChar32 * | after, | ||
size_type | afterSize, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Replaces each occurrence in this string of the first beforeSize characters of before with the first afterSize characters of after and returns a reference to this string. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
QString16 & QString16::replace | ( | const QRegularExpression16 & | regExp, |
const QString16 & | after | ||
) |
Replaces every occurrence of the regular expression regExp in the string with after. Returns a reference to this string.
For regular expressions containing capturing parentheses in the pattern, occurrences of \1, \2, ..., in the passed parameter string "after" are replaced with the corresponding capture.
QString16 & QString16::replace | ( | const QString16 & | before, |
const QString16 & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Replaces every occurrence of the string before with the string after and returns a reference to this string. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
It is of value to note the replacement text is not rescanned after it is inserted.
|
inline |
Beginning at position first replace the characters up to but not including last with str. Returns a reference to this string.
|
inline |
Replace the range from first1 to last1 with the characters from first2 to last2. Returns a reference to this string.
QString16 & QString16::replace | ( | QChar32 | before, |
QChar32 | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
QString16 & QString16::replace | ( | QChar32 | c, |
const QString16 & | after, | ||
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) |
Replaces every occurrence of the QChar32 c in this string with the string after and returns a reference to this string. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Beginning at position indexStart in this string, replace the next numOfChars with the first sizeStr code points of data. Returns a reference to this string.
|
inline |
Beginning at position indexStart in this string, replace the next numOfChars with the first sizeStr number of code points from the string str. Returns a reference to this string.
Beginning at position indexStart in this string, replace the next numOfChars with a single character c. Returns a reference to this string.
|
inline |
Sets the size of the string to numOfChars code points. If numOfChars is greater than the current size the string is extended to make it numOfChars code points long with the extra code points added to the end. The new code points are uninitialized.
If numOfChars is less than the current size, characters are removed from the end.
If you want to append a certain number of identical code points to the string, use operator+=() as follows rather than resize().
If you want to expand the string so that it reaches a certain width and fill the new positions with a particular code point, use the leftJustified() method:
If size is negative, it is equivalent to passing zero.
Sets the size of the string to numOfChars code points. If numOfChars is greater than the current size the string is extended to make it numOfChars characters long with the extra code points added to the end.
The new code points are initialized to c.
|
nodiscard |
|
nodiscard |
Returns a string of size() width that contains the fill character followed by the string.
If truncate is false and the size() of the string is more than the width, the returned string is a copy of the string.
If truncate is true and the size() of the string is more than width, the resulting string is truncated at position width.
|
nodiscard |
Returns a QStringView16 containing the last count code points in this string. The entire string is returned if numOfChars is greater than size() or less than zero.
|
inline |
Wrapper for QStringParser::section(). In order to use this method in your application include the <QStringParser> header file.
|
inline |
Wrapper for QStringParser::section(). In order to use this method in your application include the <QStringParser> header file.
|
nodiscard |
Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space. This method is only called if this string is an rvalue, this occurs when the string is a temporary or has been moved.
Refer to the const reference version of simplified().
|
nodiscard |
Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space.
Whitespace means any character for which QChar32::isSpace() returns true. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.
|
inline |
Returns the number of code points in this string.
The last character in the string is at position size() - 1. In addition, QString16 ensures the character at position size() is always '\0' so you can use the return value of data() and constData() as arguments to functions which expect null terminated strings.
|
inline |
Returns the number of storage units in this string. The storage size is the actual bytes required in the underlying container for a string. This value will usually be larger than size().
It is normally only used when passing a QString16 to a C API which expects a pointer and a length.
|
inline |
Wrapper for QStringParser::split(). In order to use this method in your application include the <QStringParser> header file.
|
inline |
Wrapper for QStringParser::split(). In order to use this method in your application include the <QStringParser> header file.
|
inline |
Wrapper for QStringParser::split(). In order to use this method in your application include the <QStringParser> header file.
|
inline |
Releases any memory not required to store the character data. In general you will rarely ever need to call this method.
bool QString16::startsWith | ( | const QString16 & | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the current string starts with str, otherwise returns false. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
bool QString16::startsWith | ( | QChar32 | c, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the string starts with c, otherwise returns false. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
bool QString16::startsWith | ( | QStringView16 | str, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns true if the current string starts with the string view str, otherwise returns false. If cs is Qt::CaseSensitive the search is case sensitive, otherwise the search is case insensitive.
|
inline |
Returns a const STL style iterator pointing to the first storage unit in the string. In UTF-16 a code point such as the Greek letter Delta is one code point and requires one storage unit.
|
inline |
Returns a const STL style iterator pointing to the imaginary item after the last storage unit in the string.
|
inline |
Returns a const STL style iterator pointing to the last storage unit in the string, in reverse order.
|
inline |
Returns a const STL style iterator pointing to one before the first storage unit in the string, in reverse order.
|
inline |
Swaps other with this object. This operation is very fast and never fails.
|
nodiscard |
Converts the string to case folded and returns the converted string. This method is only called if this string is an rvalue, this occurs when the string is a temporary or has been moved.
Refer to the const reference version of toCaseFolded().
|
nodiscard |
Returns the case folded equivalent of the string. For most Unicode characters this is the same as toLower().
CFStringRef QString16::toCFString | ( | ) | const |
Creates a CFString from a QString. The caller owns the CFString and is responsible for releasing it.
|
inline |
Wrapper for QStringParser::toDouble(). In order to use this method in your application include the <QStringParser> header file.
|
inline |
Wrapper for QStringParser::toFloat(). In order to use this method in your application include the <QStringParser> header file.
QString16 QString16::toHtmlEscaped | ( | ) | const |
|
inline |
Wrapper for QStringParser::toInteger(). In order to use this method in your application include the <QStringParser> header file.
This method replaces the following set of methods: toInt, toUInt, toLong, toULong, toLongLong, toULongLong, toShort, toUShort. The required data type is passed as the template parameter to this method. The following example shows how to specify long as the type argument.
|
nodiscard |
Returns a Latin-1 representation of the string as a QByteArray. All code points which can not be represented in Latin-1 will be replaced with a question mark.
|
nodiscard |
Converts the string to lowercase and returns the converted string. This method is only called if this string is an rvalue, this occurs when the string is a temporary or has been moved.
Refer to the const reference version of toLower().
|
nodiscard |
Returns a lowercase copy of the string.
The case conversion will always happen in the 'C' locale. For locale dependent lower casing use QLocale::toLower().
NSString * QString16::toNSString | ( | ) | const |
Creates a NSString from a QString. The NSString is autoreleased.
std::wstring QString16::toStdWString | ( | ) | const |
Returns this string as an std::wstring encoded in UTF-16.
|
nodiscard |
Converts the string to uppercase and returns the converted string. This method is only called if this string is an rvalue, this occurs when the string is a temporary or has been moved.
Refer to the const reference version of toUpper().
|
nodiscard |
Returns an uppercase copy of the string.
The case conversion will always happen in the 'C' locale. For locale dependent upper casing use QLocale::toUpper().
|
nodiscard |
Returns this string as a QByteArray.
|
nodiscard |
Trims the string and returns the trimmed string. This method is only called if this string is an rvalue, this occurs when the string is a temporary or has been moved.
Refer to the const reference version of the method trimmed().
|
nodiscard |
Returns a string that has whitespace removed from the start and the end. Whitespace means any character for which QChar32::isSpace() returns true. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.
Unlike simplified(), trimmed() leaves internal whitespace alone.
void QString16::truncate | ( | size_type | length | ) |
|
inline |
Returns a pointer to the null terminated data stored in the string. The pointer is valid until the string is modified.
|
related |
Returns true if the C string cString is not equal to the string str, otherwise returns false.
|
related |
Returns true if the string str is not equal to the C string cString, otherwise returns false.
|
related |
Returns true if str1 is not equal to string str2, otherwise returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns a string which is the result of concatenating string literal cString and the string str.
|
related |
Returns a string which is the result of concatenating str and the string literal cString.
|
related |
Returns a string which is the result of concatenating the string str and the character c.
|
related |
Returns a string which is the result of concatenating str1 and str2.
|
related |
Returns a string which is the result of concatenating the character c and the string str.
|
related |
Returns a string which is the result of concatenating str and the string literal cString. This method is only called if the string is an rvalue, this occurs when the string is a temporary or has been moved.
|
related |
Returns a string which is the result of concatenating the string str and the character c. This method is only called if the string is an rvalue, this occurs when the string is a temporary or has been moved.
|
related |
Returns a string which is the result of concatenating str1 and str2. This method is only called if str1 is an rvalue, this occurs when the string is a temporary or has been moved.
|
related |
Returns true if the C string cString is lexically less than string str, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the string str is lexically less than C string cString, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the string str1 is lexically less than string str2, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Writes str to the stream and returns a reference to the stream.
Refer to Serializing Data Types for additional information.
|
related |
Returns true if the C string cString is lexically less than or equal to than string str, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the string str is lexically less than or equal to than C string cString, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the string str1 is lexically less than or equal to than string str2, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the C string cString is equal to string str, otherwise returns false.
|
related |
Returns true if string str is equal to the C string cString, otherwise returns false.
|
related |
Returns true if string str1 is equal to str2, otherwise returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the C string cString is lexically greater than string str, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the string str is lexically greater than C string cString, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the string str1 is lexically greater than string str2, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the C string cString is lexically greater than or equal to than string str, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the string str is lexically greater than or equal to than C string cString, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Returns true if the string str1 is lexically greater than or equal to than string str2, otherwise it returns false.
The comparison is based exclusively on the numeric Unicode values of the code points and is very fast, but may not be what a person would expect.
|
related |
Reads from the stream into str and returns a reference to the stream.
Refer to Serializing Data Types for additional information.
|
related |
Swaps string str1 with str2. This operation is very fast and never fails.