Struct qt_core::QStringRef

source ·
#[repr(C)]
pub struct QStringRef { /* private fields */ }
Expand description

The QStringRef class provides a thin wrapper around QString substrings.

C++ class: QStringRef.

C++ documentation:

The QStringRef class provides a thin wrapper around QString substrings.

QStringRef provides a read-only subset of the QString API.

A string reference explicitly references a portion of a string() with a given size(), starting at a specific position(). Calling toString() returns a copy of the data as a real QString instance.

This class is designed to improve the performance of substring handling when manipulating substrings obtained from existing QString instances. QStringRef avoids the memory allocation and reference counting overhead of a standard QString by simply referencing a part of the original string. This can prove to be advantageous in low level code, such as that used in a parser, at the expense of potentially more complex code.

For most users, there are no semantic benefits to using QStringRef instead of QString since QStringRef requires attention to be paid to memory management issues, potentially making code more complex to write and maintain.

Warning: A QStringRef is only valid as long as the referenced string exists. If the original string is deleted, the string reference points to an invalid memory location.

We suggest that you only use this class in stable code where profiling has clearly identified that performance improvements can be made by replacing standard string operations with the optimized substring handling provided by this class.

Implementations§

source§

impl QStringRef

source

pub unsafe fn append_to( &self, string: impl CastInto<Ptr<QString>> ) -> CppBox<QStringRef>

Appends the string reference to string, and returns a new reference to the combined string data.

Calls C++ function: QStringRef QStringRef::appendTo(QString* string) const.

C++ documentation:

Appends the string reference to string, and returns a new reference to the combined string data.

source

pub unsafe fn at(&self, i: c_int) -> CppBox<QChar>

Returns the character at the given index position in the string reference.

Calls C++ function: QChar QStringRef::at(int i) const.

C++ documentation:

Returns the character at the given index position in the string reference.

The position must be a valid index position in the string (i.e., 0 <= position < size()).

source

pub unsafe fn back(&self) -> CppBox<QChar>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the last character in the string. Same as at(size() - 1).

Calls C++ function: QChar QStringRef::back() const.

C++ documentation:

Returns the last character in the string. Same as at(size() - 1).

This function is provided for STL compatibility.

Warning: Calling this function on an empty string constitutes undefined behavior.

This function was introduced in Qt 5.10.

See also front(), at(), and operator[]().

source

pub unsafe fn begin(&self) -> Ptr<QChar>

Returns a const STL-style iterator pointing to the first character in the string.

Calls C++ function: const QChar* QStringRef::begin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first character in the string.

This function was introduced in Qt 5.4.

See also cbegin(), constBegin(), end(), constEnd(), rbegin(), and rend().

source

pub unsafe fn cbegin(&self) -> Ptr<QChar>

Same as begin().

Calls C++ function: const QChar* QStringRef::cbegin() const.

C++ documentation:

Same as begin().

This function was introduced in Qt 5.4.

See also begin(), constBegin(), cend(), constEnd(), rbegin(), and rend().

source

pub unsafe fn cend(&self) -> Ptr<QChar>

Same as end().

Calls C++ function: const QChar* QStringRef::cend() const.

C++ documentation:

Same as end().

This function was introduced in Qt 5.4.

See also end(), constEnd(), cbegin(), constBegin(), rbegin(), and rend().

source

pub unsafe fn chop(&self, n: c_int)

Removes n characters from the end of the string.

Calls C++ function: void QStringRef::chop(int n).

C++ documentation:

Removes n characters from the end of the string.

If n is greater than or equal to size(), the result is an empty string; if n is negative, it is equivalent to passing zero.

This function was introduced in Qt 5.8.

See also QString::chop() and truncate().

source

pub unsafe fn chopped(&self, n: c_int) -> CppBox<QStringRef>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns a substring reference to the size() - len leftmost characters of this string.

Calls C++ function: QStringRef QStringRef::chopped(int n) const.

C++ documentation:

Returns a substring reference to the size() - len leftmost characters of this string.

Note: The behavior is undefined if len is negative or greater than size().

This function was introduced in Qt 5.10.

See also endsWith(), left(), right(), mid(), chop(), and truncate().

source

pub unsafe fn clear(&self)

Clears the contents of the string reference by making it null and empty.

Calls C++ function: void QStringRef::clear().

C++ documentation:

Clears the contents of the string reference by making it null and empty.

See also isEmpty() and isNull().

source

pub unsafe fn compare_q_string_case_sensitivity( &self, s: impl CastInto<Ref<QString>>, cs: CaseSensitivity ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::compare(const QString& s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This is an overloaded function.

Compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

Equivalent to compare(*this, other, cs).

This function was introduced in Qt 4.5.

See also QString::compare().

source

pub unsafe fn compare_q_string_ref_case_sensitivity( &self, s: impl CastInto<Ref<QStringRef>>, cs: CaseSensitivity ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::compare(const QStringRef& s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This is an overloaded function.

Compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

Equivalent to compare(*this, other, cs).

This function was introduced in Qt 4.5.

See also QString::compare().

source

pub unsafe fn compare_q_latin1_string_case_sensitivity( &self, s: impl CastInto<Ref<QLatin1String>>, cs: CaseSensitivity ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This is an overloaded function.

Compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

Equivalent to compare(*this, other, cs).

This function was introduced in Qt 4.5.

See also QString::compare().

source

pub unsafe fn compare_q_byte_array_case_sensitivity( &self, s: impl CastInto<Ref<QByteArray>>, cs: CaseSensitivity ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::compare(const QByteArray& s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This is an overloaded function.

Compares this string with other and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other byte array, interpreted as a UTF-8 sequence.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

Equivalent to compare(*this, other, cs).

This function was introduced in Qt 5.8.

See also QString::compare().

source

pub unsafe fn compare_q_string_ref_q_string_case_sensitivity( s1: impl CastInto<Ref<QStringRef>>, s2: impl CastInto<Ref<QString>>, arg3: CaseSensitivity ) -> c_int

Compares the string s1 with the string s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

Calls C++ function: static int QStringRef::compare(const QStringRef& s1, const QString& s2, Qt::CaseSensitivity arg3 = …).

C++ documentation:

Compares the string s1 with the string s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

This function was introduced in Qt 4.5.

source

pub unsafe fn compare_2_q_string_ref_case_sensitivity( s1: impl CastInto<Ref<QStringRef>>, s2: impl CastInto<Ref<QStringRef>>, arg3: CaseSensitivity ) -> c_int

This is an overloaded function.

Calls C++ function: static int QStringRef::compare(const QStringRef& s1, const QStringRef& s2, Qt::CaseSensitivity arg3 = …).

C++ documentation:

This is an overloaded function.

Compares the string s1 with the string s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

This function was introduced in Qt 4.5.

source

pub unsafe fn compare_q_string_ref_q_latin1_string_case_sensitivity( s1: impl CastInto<Ref<QStringRef>>, s2: impl CastInto<Ref<QLatin1String>>, cs: CaseSensitivity ) -> c_int

This is an overloaded function.

Calls C++ function: static int QStringRef::compare(const QStringRef& s1, QLatin1String s2, Qt::CaseSensitivity cs = …).

C++ documentation:

This is an overloaded function.

Compares the string s1 with the string s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

This function was introduced in Qt 4.5.

source

pub unsafe fn compare_q_string(&self, s: impl CastInto<Ref<QString>>) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::compare(const QString& s) const.

C++ documentation:

This is an overloaded function.

Compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

Equivalent to compare(*this, other, cs).

This function was introduced in Qt 4.5.

See also QString::compare().

source

pub unsafe fn compare_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::compare(const QStringRef& s) const.

C++ documentation:

This is an overloaded function.

Compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

Equivalent to compare(*this, other, cs).

This function was introduced in Qt 4.5.

See also QString::compare().

source

pub unsafe fn compare_q_latin1_string( &self, s: impl CastInto<Ref<QLatin1String>> ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::compare(QLatin1String s) const.

C++ documentation:

This is an overloaded function.

Compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

Equivalent to compare(*this, other, cs).

This function was introduced in Qt 4.5.

See also QString::compare().

source

pub unsafe fn compare_q_byte_array( &self, s: impl CastInto<Ref<QByteArray>> ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::compare(const QByteArray& s) const.

C++ documentation:

This is an overloaded function.

Compares this string with other and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other byte array, interpreted as a UTF-8 sequence.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

Equivalent to compare(*this, other, cs).

This function was introduced in Qt 5.8.

See also QString::compare().

source

pub unsafe fn compare_q_string_ref_q_string( s1: impl CastInto<Ref<QStringRef>>, s2: impl CastInto<Ref<QString>> ) -> c_int

Compares the string s1 with the string s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

Calls C++ function: static int QStringRef::compare(const QStringRef& s1, const QString& s2).

C++ documentation:

Compares the string s1 with the string s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

This function was introduced in Qt 4.5.

source

pub unsafe fn compare_2_q_string_ref( s1: impl CastInto<Ref<QStringRef>>, s2: impl CastInto<Ref<QStringRef>> ) -> c_int

This is an overloaded function.

Calls C++ function: static int QStringRef::compare(const QStringRef& s1, const QStringRef& s2).

C++ documentation:

This is an overloaded function.

Compares the string s1 with the string s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

This function was introduced in Qt 4.5.

source

pub unsafe fn compare_q_string_ref_q_latin1_string( s1: impl CastInto<Ref<QStringRef>>, s2: impl CastInto<Ref<QLatin1String>> ) -> c_int

This is an overloaded function.

Calls C++ function: static int QStringRef::compare(const QStringRef& s1, QLatin1String s2).

C++ documentation:

This is an overloaded function.

Compares the string s1 with the string s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

If cs is Qt::CaseSensitive, the comparison is case sensitive; otherwise the comparison is case insensitive.

This function was introduced in Qt 4.5.

source

pub unsafe fn const_begin(&self) -> Ptr<QChar>

Same as begin().

Calls C++ function: const QChar* QStringRef::constBegin() const.

C++ documentation:

Same as begin().

This function was introduced in Qt 5.9.

See also begin(), cend(), constEnd(), rbegin(), and rend().

source

pub unsafe fn const_data(&self) -> Ptr<QChar>

Same as unicode().

Calls C++ function: const QChar* QStringRef::constData() const.

C++ documentation:

Same as unicode().

source

pub unsafe fn const_end(&self) -> Ptr<QChar>

Same as end().

Calls C++ function: const QChar* QStringRef::constEnd() const.

C++ documentation:

Same as end().

This function was introduced in Qt 5.9.

See also end(), cend(), cbegin(), constBegin(), rbegin(), and rend().

source

pub unsafe fn contains_q_string_case_sensitivity( &self, str: impl CastInto<Ref<QString>>, cs: CaseSensitivity ) -> bool

Returns true if this string reference contains an occurrence of the string str; otherwise returns false.

Calls C++ function: bool QStringRef::contains(const QString& str, Qt::CaseSensitivity cs = …) const.

C++ documentation:

Returns true if this string reference contains an occurrence of the string str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also indexOf() and count().

source

pub unsafe fn contains_q_char_case_sensitivity( &self, ch: impl CastInto<Ref<QChar>>, cs: CaseSensitivity ) -> bool

This function overloads contains().

Calls C++ function: bool QStringRef::contains(QChar ch, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads contains().

Returns true if this string contains an occurrence of the character ch; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

source

pub unsafe fn contains_q_latin1_string_case_sensitivity( &self, str: impl CastInto<Ref<QLatin1String>>, cs: CaseSensitivity ) -> bool

This function overloads contains().

Calls C++ function: bool QStringRef::contains(QLatin1String str, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads contains().

Returns true if this string reference contains an occurrence of the string str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also indexOf() and count().

source

pub unsafe fn contains_q_string_ref_case_sensitivity( &self, str: impl CastInto<Ref<QStringRef>>, cs: CaseSensitivity ) -> bool

This function overloads contains().

Calls C++ function: bool QStringRef::contains(const QStringRef& str, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads contains().

Returns true if this string reference contains an occurrence of the string reference str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also indexOf() and count().

source

pub unsafe fn contains_q_string(&self, str: impl CastInto<Ref<QString>>) -> bool

Returns true if this string reference contains an occurrence of the string str; otherwise returns false.

Calls C++ function: bool QStringRef::contains(const QString& str) const.

C++ documentation:

Returns true if this string reference contains an occurrence of the string str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also indexOf() and count().

source

pub unsafe fn contains_q_char(&self, ch: impl CastInto<Ref<QChar>>) -> bool

This function overloads contains().

Calls C++ function: bool QStringRef::contains(QChar ch) const.

C++ documentation:

This function overloads contains().

Returns true if this string contains an occurrence of the character ch; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

source

pub unsafe fn contains_q_latin1_string( &self, str: impl CastInto<Ref<QLatin1String>> ) -> bool

This function overloads contains().

Calls C++ function: bool QStringRef::contains(QLatin1String str) const.

C++ documentation:

This function overloads contains().

Returns true if this string reference contains an occurrence of the string str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also indexOf() and count().

source

pub unsafe fn contains_q_string_ref( &self, str: impl CastInto<Ref<QStringRef>> ) -> bool

This function overloads contains().

Calls C++ function: bool QStringRef::contains(const QStringRef& str) const.

C++ documentation:

This function overloads contains().

Returns true if this string reference contains an occurrence of the string reference str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also indexOf() and count().

source

pub unsafe fn contains_q_string_view_case_sensitivity( &self, str: impl CastInto<Ref<QStringView>>, cs: CaseSensitivity ) -> bool

Available on cpp_lib_version="5.14.0" only.

This function overloads contains().

Calls C++ function: bool QStringRef::contains(QStringView str, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads contains().

Returns true if this string reference contains an occurrence of the string view str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 5.14.

See also indexOf() and count().

source

pub unsafe fn contains_q_string_view( &self, str: impl CastInto<Ref<QStringView>> ) -> bool

Available on cpp_lib_version="5.14.0" only.

This function overloads contains().

Calls C++ function: bool QStringRef::contains(QStringView str) const.

C++ documentation:

This function overloads contains().

Returns true if this string reference contains an occurrence of the string view str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 5.14.

See also indexOf() and count().

source

pub unsafe fn copy_from_q_string_ref( &self, other: impl CastInto<Ref<QStringRef>> ) -> Ref<QStringRef>

Assigns the other string reference to this string reference, and returns the result.

Calls C++ function: QStringRef& QStringRef::operator=(const QStringRef& other).

C++ documentation:

Assigns the other string reference to this string reference, and returns the result.

source

pub unsafe fn copy_from_q_string( &self, string: impl CastInto<Ptr<QString>> ) -> Ref<QStringRef>

Constructs a string reference to the given string and assigns it to this string reference, returning the result.

Calls C++ function: QStringRef& QStringRef::operator=(const QString* string).

C++ documentation:

Constructs a string reference to the given string and assigns it to this string reference, returning the result.

source

pub unsafe fn count(&self) -> c_int

Returns the number of characters referred to by the string reference. Equivalent to size() and length().

Calls C++ function: int QStringRef::count() const.

C++ documentation:

Returns the number of characters referred to by the string reference. Equivalent to size() and length().

See also position() and string().

source

pub unsafe fn count_q_string_case_sensitivity( &self, s: impl CastInto<Ref<QString>>, cs: CaseSensitivity ) -> c_int

Returns the number of (potentially overlapping) occurrences of the string str in this string reference.

Calls C++ function: int QStringRef::count(const QString& s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

Returns the number of (potentially overlapping) occurrences of the string str in this string reference.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::count(), contains(), and indexOf().

source

pub unsafe fn count_q_char_case_sensitivity( &self, c: impl CastInto<Ref<QChar>>, cs: CaseSensitivity ) -> c_int

This function overloads count().

Calls C++ function: int QStringRef::count(QChar c, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads count().

Returns the number of occurrences of the character ch in the string reference.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::count(), contains(), and indexOf().

source

pub unsafe fn count_q_string_ref_case_sensitivity( &self, s: impl CastInto<Ref<QStringRef>>, cs: CaseSensitivity ) -> c_int

This function overloads count().

Calls C++ function: int QStringRef::count(const QStringRef& s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads count().

Returns the number of (potentially overlapping) occurrences of the string reference str in this string reference.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::count(), contains(), and indexOf().

source

pub unsafe fn count_q_string(&self, s: impl CastInto<Ref<QString>>) -> c_int

Returns the number of (potentially overlapping) occurrences of the string str in this string reference.

Calls C++ function: int QStringRef::count(const QString& s) const.

C++ documentation:

Returns the number of (potentially overlapping) occurrences of the string str in this string reference.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::count(), contains(), and indexOf().

source

pub unsafe fn count_q_char(&self, c: impl CastInto<Ref<QChar>>) -> c_int

This function overloads count().

Calls C++ function: int QStringRef::count(QChar c) const.

C++ documentation:

This function overloads count().

Returns the number of occurrences of the character ch in the string reference.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::count(), contains(), and indexOf().

source

pub unsafe fn count_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_int

This function overloads count().

Calls C++ function: int QStringRef::count(const QStringRef& s) const.

C++ documentation:

This function overloads count().

Returns the number of (potentially overlapping) occurrences of the string reference str in this string reference.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::count(), contains(), and indexOf().

source

pub unsafe fn data(&self) -> Ptr<QChar>

Same as unicode().

Calls C++ function: const QChar* QStringRef::data() const.

C++ documentation:

Same as unicode().

source

pub unsafe fn end(&self) -> Ptr<QChar>

Returns a const STL-style iterator pointing to the imaginary character after the last character in the list.

Calls C++ function: const QChar* QStringRef::end() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary character after the last character in the list.

This function was introduced in Qt 5.4.

See also cbegin(), constBegin(), end(), constEnd(), rbegin(), and rend().

source

pub unsafe fn ends_with_q_string_case_sensitivity( &self, s: impl CastInto<Ref<QString>>, cs: CaseSensitivity ) -> bool

Returns true if the string reference ends with str; otherwise returns false.

Calls C++ function: bool QStringRef::endsWith(const QString& s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

Returns true if the string reference ends with str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::endsWith() and startsWith().

source

pub unsafe fn ends_with_q_latin1_string_case_sensitivity( &self, s: impl CastInto<Ref<QLatin1String>>, cs: CaseSensitivity ) -> bool

This function overloads endsWith().

Calls C++ function: bool QStringRef::endsWith(QLatin1String s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads endsWith().

This function was introduced in Qt 4.8.

See also QString::endsWith() and endsWith().

source

pub unsafe fn ends_with_q_char_case_sensitivity( &self, c: impl CastInto<Ref<QChar>>, cs: CaseSensitivity ) -> bool

This function overloads endsWith().

Calls C++ function: bool QStringRef::endsWith(QChar c, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads endsWith().

Returns true if the string reference ends with ch; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::endsWith() and endsWith().

source

pub unsafe fn ends_with_q_string_ref_case_sensitivity( &self, c: impl CastInto<Ref<QStringRef>>, cs: CaseSensitivity ) -> bool

This function overloads endsWith().

Calls C++ function: bool QStringRef::endsWith(const QStringRef& c, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads endsWith().

This function was introduced in Qt 4.8.

See also QString::endsWith() and endsWith().

source

pub unsafe fn ends_with_q_string(&self, s: impl CastInto<Ref<QString>>) -> bool

Returns true if the string reference ends with str; otherwise returns false.

Calls C++ function: bool QStringRef::endsWith(const QString& s) const.

C++ documentation:

Returns true if the string reference ends with str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::endsWith() and startsWith().

source

pub unsafe fn ends_with_q_latin1_string( &self, s: impl CastInto<Ref<QLatin1String>> ) -> bool

This function overloads endsWith().

Calls C++ function: bool QStringRef::endsWith(QLatin1String s) const.

C++ documentation:

This function overloads endsWith().

This function was introduced in Qt 4.8.

See also QString::endsWith() and endsWith().

source

pub unsafe fn ends_with_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool

This function overloads endsWith().

Calls C++ function: bool QStringRef::endsWith(QChar c) const.

C++ documentation:

This function overloads endsWith().

Returns true if the string reference ends with ch; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::endsWith() and endsWith().

source

pub unsafe fn ends_with_q_string_ref( &self, c: impl CastInto<Ref<QStringRef>> ) -> bool

This function overloads endsWith().

Calls C++ function: bool QStringRef::endsWith(const QStringRef& c) const.

C++ documentation:

This function overloads endsWith().

This function was introduced in Qt 4.8.

See also QString::endsWith() and endsWith().

source

pub unsafe fn ends_with_q_string_view_case_sensitivity( &self, s: impl CastInto<Ref<QStringView>>, cs: CaseSensitivity ) -> bool

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This function overloads endsWith().

Calls C++ function: bool QStringRef::endsWith(QStringView s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads endsWith().

This function was introduced in Qt 5.10.

See also QString::endsWith() and startsWith().

source

pub unsafe fn ends_with_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> bool

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This function overloads endsWith().

Calls C++ function: bool QStringRef::endsWith(QStringView s) const.

C++ documentation:

This function overloads endsWith().

This function was introduced in Qt 5.10.

See also QString::endsWith() and startsWith().

source

pub unsafe fn front(&self) -> CppBox<QChar>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the first character in the string. Same as at(0).

Calls C++ function: QChar QStringRef::front() const.

C++ documentation:

Returns the first character in the string. Same as at(0).

This function is provided for STL compatibility.

Warning: Calling this function on an empty string constitutes undefined behavior.

This function was introduced in Qt 5.10.

See also back(), at(), and operator[]().

source

pub unsafe fn index(&self, i: c_int) -> CppBox<QChar>

Returns the character at the given index position in the string reference.

Calls C++ function: QChar QStringRef::operator[](int i) const.

C++ documentation:

Returns the character at the given index position in the string reference.

The position must be a valid index position in the string reference (i.e., 0 <= position < size()).

This function was introduced in Qt 5.7.

See also at().

source

pub unsafe fn index_of_q_string_int_case_sensitivity( &self, str: impl CastInto<Ref<QString>>, from: c_int, cs: CaseSensitivity ) -> c_int

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

Calls C++ function: int QStringRef::indexOf(const QString& str, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_char_int_case_sensitivity( &self, ch: impl CastInto<Ref<QChar>>, from: c_int, cs: CaseSensitivity ) -> c_int

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(QChar ch, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the character ch in the string reference, searching forward from index position from. Returns -1 if ch could not be found.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_latin1_string_int_case_sensitivity( &self, str: impl CastInto<Ref<QLatin1String>>, from: c_int, cs: CaseSensitivity ) -> c_int

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

Calls C++ function: int QStringRef::indexOf(QLatin1String str, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_string_ref_int_case_sensitivity( &self, str: impl CastInto<Ref<QStringRef>>, from: c_int, cs: CaseSensitivity ) -> c_int

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(const QStringRef& str, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the string reference str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_string_int( &self, str: impl CastInto<Ref<QString>>, from: c_int ) -> c_int

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

Calls C++ function: int QStringRef::indexOf(const QString& str, int from = …) const.

C++ documentation:

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_string( &self, str: impl CastInto<Ref<QString>> ) -> c_int

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

Calls C++ function: int QStringRef::indexOf(const QString& str) const.

C++ documentation:

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_char_int( &self, ch: impl CastInto<Ref<QChar>>, from: c_int ) -> c_int

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(QChar ch, int from = …) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the character ch in the string reference, searching forward from index position from. Returns -1 if ch could not be found.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_char(&self, ch: impl CastInto<Ref<QChar>>) -> c_int

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(QChar ch) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the character ch in the string reference, searching forward from index position from. Returns -1 if ch could not be found.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_latin1_string_int( &self, str: impl CastInto<Ref<QLatin1String>>, from: c_int ) -> c_int

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

Calls C++ function: int QStringRef::indexOf(QLatin1String str, int from = …) const.

C++ documentation:

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_latin1_string( &self, str: impl CastInto<Ref<QLatin1String>> ) -> c_int

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

Calls C++ function: int QStringRef::indexOf(QLatin1String str) const.

C++ documentation:

Returns the index position of the first occurrence of the string str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_string_ref_int( &self, str: impl CastInto<Ref<QStringRef>>, from: c_int ) -> c_int

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(const QStringRef& str, int from = …) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the string reference str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_string_ref( &self, str: impl CastInto<Ref<QStringRef>> ) -> c_int

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(const QStringRef& str) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the string reference str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_string_view_int_case_sensitivity( &self, s: impl CastInto<Ref<QStringView>>, from: c_int, cs: CaseSensitivity ) -> c_int

Available on cpp_lib_version="5.14.0" only.

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(QStringView s, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the string view str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 5.14.

See also QString::indexOf(), QStringView::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_string_view_int( &self, s: impl CastInto<Ref<QStringView>>, from: c_int ) -> c_int

Available on cpp_lib_version="5.14.0" only.

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(QStringView s, int from = …) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the string view str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 5.14.

See also QString::indexOf(), QStringView::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn index_of_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_int

Available on cpp_lib_version="5.14.0" only.

This function overloads indexOf().

Calls C++ function: int QStringRef::indexOf(QStringView s) const.

C++ documentation:

This function overloads indexOf().

Returns the index position of the first occurrence of the string view str in this string reference, searching forward from index position from. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

If from is -1, the search starts at the last character; if it is -2, at the next to last character and so on.

This function was introduced in Qt 5.14.

See also QString::indexOf(), QStringView::indexOf(), lastIndexOf(), contains(), and count().

source

pub unsafe fn is_empty(&self) -> bool

Returns true if the string reference has no characters; otherwise returns false.

Calls C++ function: bool QStringRef::isEmpty() const.

C++ documentation:

Returns true if the string reference has no characters; otherwise returns false.

A string reference is empty if its size is zero.

See also size().

source

pub unsafe fn is_null(&self) -> bool

Returns true if string() returns a null pointer or a pointer to a null string; otherwise returns true.

Calls C++ function: bool QStringRef::isNull() const.

C++ documentation:

Returns true if string() returns a null pointer or a pointer to a null string; otherwise returns true.

See also size().

source

pub unsafe fn is_right_to_left(&self) -> bool

Returns true if the string is read right to left.

Calls C++ function: bool QStringRef::isRightToLeft() const.

C++ documentation:

Returns true if the string is read right to left.

This function was introduced in Qt 5.9.

See also QString::isRightToLeft().

source

pub unsafe fn last_index_of_q_string_int_case_sensitivity( &self, str: impl CastInto<Ref<QString>>, from: c_int, cs: CaseSensitivity ) -> c_int

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

Calls C++ function: int QStringRef::lastIndexOf(const QString& str, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_char_int_case_sensitivity( &self, ch: impl CastInto<Ref<QChar>>, from: c_int, cs: CaseSensitivity ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QChar ch, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the character ch, searching backward from position from.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_latin1_string_int_case_sensitivity( &self, str: impl CastInto<Ref<QLatin1String>>, from: c_int, cs: CaseSensitivity ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QLatin1String str, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_string_ref_int_case_sensitivity( &self, str: impl CastInto<Ref<QStringRef>>, from: c_int, cs: CaseSensitivity ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(const QStringRef& str, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string reference str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_string_int( &self, str: impl CastInto<Ref<QString>>, from: c_int ) -> c_int

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

Calls C++ function: int QStringRef::lastIndexOf(const QString& str, int from = …) const.

C++ documentation:

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_string( &self, str: impl CastInto<Ref<QString>> ) -> c_int

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

Calls C++ function: int QStringRef::lastIndexOf(const QString& str) const.

C++ documentation:

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_char_int( &self, ch: impl CastInto<Ref<QChar>>, from: c_int ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QChar ch, int from = …) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the character ch, searching backward from position from.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_char( &self, ch: impl CastInto<Ref<QChar>> ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QChar ch) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the character ch, searching backward from position from.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_latin1_string_int( &self, str: impl CastInto<Ref<QLatin1String>>, from: c_int ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QLatin1String str, int from = …) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_latin1_string( &self, str: impl CastInto<Ref<QLatin1String>> ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QLatin1String str) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_string_ref_int( &self, str: impl CastInto<Ref<QStringRef>>, from: c_int ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(const QStringRef& str, int from = …) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string reference str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_string_ref( &self, str: impl CastInto<Ref<QStringRef>> ) -> c_int

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(const QStringRef& str) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string reference str in this string reference, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::lastIndexOf(), indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_string_view_int_case_sensitivity( &self, s: impl CastInto<Ref<QStringView>>, from: c_int, cs: CaseSensitivity ) -> c_int

Available on cpp_lib_version="5.14.0" only.

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QStringView s, int from = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string view str in this string, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 5.14.

See also indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_string_view_int( &self, s: impl CastInto<Ref<QStringView>>, from: c_int ) -> c_int

Available on cpp_lib_version="5.14.0" only.

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QStringView s, int from = …) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string view str in this string, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 5.14.

See also indexOf(), contains(), and count().

source

pub unsafe fn last_index_of_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_int

Available on cpp_lib_version="5.14.0" only.

This function overloads lastIndexOf().

Calls C++ function: int QStringRef::lastIndexOf(QStringView s) const.

C++ documentation:

This function overloads lastIndexOf().

Returns the index position of the last occurrence of the string view str in this string, searching backward from index position from. If from is -1 (default), the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 5.14.

See also indexOf(), contains(), and count().

source

pub unsafe fn left(&self, n: c_int) -> CppBox<QStringRef>

Returns a substring reference to the n leftmost characters of the string.

Calls C++ function: QStringRef QStringRef::left(int n) const.

C++ documentation:

Returns a substring reference to the n leftmost characters of the string.

If n is greater than or equal to size(), or less than zero, a reference to the entire string is returned.

This function was introduced in Qt 5.2.

See also right(), mid(), and startsWith().

source

pub unsafe fn length(&self) -> c_int

Returns the number of characters referred to by the string reference. Equivalent to size() and count().

Calls C++ function: int QStringRef::length() const.

C++ documentation:

Returns the number of characters referred to by the string reference. Equivalent to size() and count().

See also position() and string().

source

pub unsafe fn locale_aware_compare_q_string( &self, s: impl CastInto<Ref<QString>> ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::localeAwareCompare(const QString& s) const.

C++ documentation:

This is an overloaded function.

Compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.

This function was introduced in Qt 4.5.

source

pub unsafe fn locale_aware_compare_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_int

This is an overloaded function.

Calls C++ function: int QStringRef::localeAwareCompare(const QStringRef& s) const.

C++ documentation:

This is an overloaded function.

Compares this string with the other string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the other string.

The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.

This function was introduced in Qt 4.5.

source

pub unsafe fn locale_aware_compare_q_string_ref_q_string( s1: impl CastInto<Ref<QStringRef>>, s2: impl CastInto<Ref<QString>> ) -> c_int

Compares s1 with s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

Calls C++ function: static int QStringRef::localeAwareCompare(const QStringRef& s1, const QString& s2).

C++ documentation:

Compares s1 with s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.

On macOS and iOS, this function compares according the "Order for sorted lists" setting in the International prefereces panel.

This function was introduced in Qt 4.5.

See also compare() and QLocale.

source

pub unsafe fn locale_aware_compare_2_q_string_ref( s1: impl CastInto<Ref<QStringRef>>, s2: impl CastInto<Ref<QStringRef>> ) -> c_int

This is an overloaded function.

Calls C++ function: static int QStringRef::localeAwareCompare(const QStringRef& s1, const QStringRef& s2).

C++ documentation:

This is an overloaded function.

Compares s1 with s2 and returns an integer less than, equal to, or greater than zero if s1 is less than, equal to, or greater than s2.

The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.

This function was introduced in Qt 4.5.

source

pub unsafe fn mid_2a(&self, pos: c_int, n: c_int) -> CppBox<QStringRef>

Returns a substring reference to n characters of this string, starting at the specified position.

Calls C++ function: QStringRef QStringRef::mid(int pos, int n = …) const.

C++ documentation:

Returns a substring reference to n characters of this string, starting at the specified position.

If the position exceeds the length of the string, a null reference is returned.

If there are less than n characters available in the string, starting at the given position, or if n is -1 (default), the function returns all characters from the specified position onwards.

This function was introduced in Qt 5.2.

See also left() and right().

source

pub unsafe fn mid_1a(&self, pos: c_int) -> CppBox<QStringRef>

Returns a substring reference to n characters of this string, starting at the specified position.

Calls C++ function: QStringRef QStringRef::mid(int pos) const.

C++ documentation:

Returns a substring reference to n characters of this string, starting at the specified position.

If the position exceeds the length of the string, a null reference is returned.

If there are less than n characters available in the string, starting at the given position, or if n is -1 (default), the function returns all characters from the specified position onwards.

This function was introduced in Qt 5.2.

See also left() and right().

source

pub unsafe fn new_0a() -> CppBox<QStringRef>

Constructs an empty string reference.

Calls C++ function: [constructor] void QStringRef::QStringRef().

C++ documentation:

Constructs an empty string reference.

source

pub unsafe fn new_3a( string: impl CastInto<Ptr<QString>>, position: c_int, size: c_int ) -> CppBox<QStringRef>

Constructs a string reference to the range of characters in the given string specified by the starting position and length in characters.

Calls C++ function: [constructor] void QStringRef::QStringRef(const QString* string, int position, int size).

C++ documentation:

Constructs a string reference to the range of characters in the given string specified by the starting position and length in characters.

Warning: This function exists to improve performance as much as possible, and performs no bounds checking. For program correctness, position and length must describe a valid substring of string.

This means that the starting position must be positive or 0 and smaller than string's length, and length must be positive or 0 but smaller than the string's length minus the starting position; i.e, 0 <= position < string->length() and 0 <= length <= string->length() - position must both be satisfied.

source

pub unsafe fn new_1a(string: impl CastInto<Ptr<QString>>) -> CppBox<QStringRef>

Constructs a string reference to the given string.

Calls C++ function: [constructor] void QStringRef::QStringRef(const QString* string).

C++ documentation:

Constructs a string reference to the given string.

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QStringRef>> ) -> CppBox<QStringRef>

Constructs a copy of the other string reference.

Calls C++ function: [constructor] void QStringRef::QStringRef(const QStringRef& other).

C++ documentation:

Constructs a copy of the other string reference.

source

pub unsafe fn position(&self) -> c_int

Returns the starting position in the referenced string that is referred to by the string reference.

Calls C++ function: int QStringRef::position() const.

C++ documentation:

Returns the starting position in the referenced string that is referred to by the string reference.

See also size() and string().

source

pub unsafe fn right(&self, n: c_int) -> CppBox<QStringRef>

Returns a substring reference to the n rightmost characters of the string.

Calls C++ function: QStringRef QStringRef::right(int n) const.

C++ documentation:

Returns a substring reference to the n rightmost characters of the string.

If n is greater than or equal to size(), or less than zero, a reference to the entire string is returned.

This function was introduced in Qt 5.2.

See also left(), mid(), and endsWith().

source

pub unsafe fn size(&self) -> c_int

Returns the number of characters referred to by the string reference. Equivalent to length() and count().

Calls C++ function: int QStringRef::size() const.

C++ documentation:

Returns the number of characters referred to by the string reference. Equivalent to length() and count().

See also position() and string().

source

pub unsafe fn split_q_string_split_behavior_case_sensitivity( &self, sep: impl CastInto<Ref<QString>>, behavior: SplitBehavior, cs: CaseSensitivity ) -> CppBox<QVectorOfQStringRef>

Splits the string into substrings references wherever sep occurs, and returns the list of those strings.

Calls C++ function: QVector<QStringRef> QStringRef::split(const QString& sep, QString::SplitBehavior behavior = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

Splits the string into substrings references wherever sep occurs, and returns the list of those strings.

See QString::split() for how sep, behavior and cs interact to form the result.

Note: All references are valid as long this string is alive. Destroying this string will cause all references be dangling pointers.

This function was introduced in Qt 5.4.

source

pub unsafe fn split_q_char_split_behavior_case_sensitivity( &self, sep: impl CastInto<Ref<QChar>>, behavior: SplitBehavior, cs: CaseSensitivity ) -> CppBox<QVectorOfQStringRef>

This is an overloaded function.

Calls C++ function: QVector<QStringRef> QStringRef::split(QChar sep, QString::SplitBehavior behavior = …, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.4.

source

pub unsafe fn split_q_string_split_behavior( &self, sep: impl CastInto<Ref<QString>>, behavior: SplitBehavior ) -> CppBox<QVectorOfQStringRef>

Splits the string into substrings references wherever sep occurs, and returns the list of those strings.

Calls C++ function: QVector<QStringRef> QStringRef::split(const QString& sep, QString::SplitBehavior behavior = …) const.

C++ documentation:

Splits the string into substrings references wherever sep occurs, and returns the list of those strings.

See QString::split() for how sep, behavior and cs interact to form the result.

Note: All references are valid as long this string is alive. Destroying this string will cause all references be dangling pointers.

This function was introduced in Qt 5.4.

source

pub unsafe fn split_q_string( &self, sep: impl CastInto<Ref<QString>> ) -> CppBox<QVectorOfQStringRef>

Splits the string into substrings references wherever sep occurs, and returns the list of those strings.

Calls C++ function: QVector<QStringRef> QStringRef::split(const QString& sep) const.

C++ documentation:

Splits the string into substrings references wherever sep occurs, and returns the list of those strings.

See QString::split() for how sep, behavior and cs interact to form the result.

Note: All references are valid as long this string is alive. Destroying this string will cause all references be dangling pointers.

This function was introduced in Qt 5.4.

source

pub unsafe fn split_q_char_split_behavior( &self, sep: impl CastInto<Ref<QChar>>, behavior: SplitBehavior ) -> CppBox<QVectorOfQStringRef>

This is an overloaded function.

Calls C++ function: QVector<QStringRef> QStringRef::split(QChar sep, QString::SplitBehavior behavior = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.4.

source

pub unsafe fn split_q_char( &self, sep: impl CastInto<Ref<QChar>> ) -> CppBox<QVectorOfQStringRef>

This is an overloaded function.

Calls C++ function: QVector<QStringRef> QStringRef::split(QChar sep) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.4.

source

pub unsafe fn split_q_string_q_flags_split_behavior_flags_case_sensitivity( &self, sep: impl CastInto<Ref<QString>>, behavior: QFlags<SplitBehaviorFlags>, cs: CaseSensitivity ) -> CppBox<QVectorOfQStringRef>

Available on cpp_lib_version="5.14.0" only.

Calls C++ function: QVector<QStringRef> QStringRef::split(const QString& sep, QFlags<Qt::SplitBehaviorFlags> behavior, Qt::CaseSensitivity cs = …) const.

source

pub unsafe fn split_q_char_q_flags_split_behavior_flags_case_sensitivity( &self, sep: impl CastInto<Ref<QChar>>, behavior: QFlags<SplitBehaviorFlags>, cs: CaseSensitivity ) -> CppBox<QVectorOfQStringRef>

Available on cpp_lib_version="5.14.0" only.

Calls C++ function: QVector<QStringRef> QStringRef::split(QChar sep, QFlags<Qt::SplitBehaviorFlags> behavior, Qt::CaseSensitivity cs = …) const.

source

pub unsafe fn split_q_string_q_flags_split_behavior_flags( &self, sep: impl CastInto<Ref<QString>>, behavior: QFlags<SplitBehaviorFlags> ) -> CppBox<QVectorOfQStringRef>

Available on cpp_lib_version="5.14.0" only.

Calls C++ function: QVector<QStringRef> QStringRef::split(const QString& sep, QFlags<Qt::SplitBehaviorFlags> behavior) const.

source

pub unsafe fn split_q_char_q_flags_split_behavior_flags( &self, sep: impl CastInto<Ref<QChar>>, behavior: QFlags<SplitBehaviorFlags> ) -> CppBox<QVectorOfQStringRef>

Available on cpp_lib_version="5.14.0" only.

Calls C++ function: QVector<QStringRef> QStringRef::split(QChar sep, QFlags<Qt::SplitBehaviorFlags> behavior) const.

source

pub unsafe fn starts_with_q_string_case_sensitivity( &self, s: impl CastInto<Ref<QString>>, cs: CaseSensitivity ) -> bool

Returns true if the string reference starts with str; otherwise returns false.

Calls C++ function: bool QStringRef::startsWith(const QString& s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

Returns true if the string reference starts with str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_latin1_string_case_sensitivity( &self, s: impl CastInto<Ref<QLatin1String>>, cs: CaseSensitivity ) -> bool

This function overloads startsWith().

Calls C++ function: bool QStringRef::startsWith(QLatin1String s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads startsWith().

This function was introduced in Qt 4.8.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_char_case_sensitivity( &self, c: impl CastInto<Ref<QChar>>, cs: CaseSensitivity ) -> bool

This function overloads startsWith().

Calls C++ function: bool QStringRef::startsWith(QChar c, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads startsWith().

Returns true if the string reference starts with ch; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_string_ref_case_sensitivity( &self, c: impl CastInto<Ref<QStringRef>>, cs: CaseSensitivity ) -> bool

This function overloads startsWith().

Calls C++ function: bool QStringRef::startsWith(const QStringRef& c, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads startsWith().

This function was introduced in Qt 4.8.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_string( &self, s: impl CastInto<Ref<QString>> ) -> bool

Returns true if the string reference starts with str; otherwise returns false.

Calls C++ function: bool QStringRef::startsWith(const QString& s) const.

C++ documentation:

Returns true if the string reference starts with str; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_latin1_string( &self, s: impl CastInto<Ref<QLatin1String>> ) -> bool

This function overloads startsWith().

Calls C++ function: bool QStringRef::startsWith(QLatin1String s) const.

C++ documentation:

This function overloads startsWith().

This function was introduced in Qt 4.8.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool

This function overloads startsWith().

Calls C++ function: bool QStringRef::startsWith(QChar c) const.

C++ documentation:

This function overloads startsWith().

Returns true if the string reference starts with ch; otherwise returns false.

If cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive.

This function was introduced in Qt 4.8.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_string_ref( &self, c: impl CastInto<Ref<QStringRef>> ) -> bool

This function overloads startsWith().

Calls C++ function: bool QStringRef::startsWith(const QStringRef& c) const.

C++ documentation:

This function overloads startsWith().

This function was introduced in Qt 4.8.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_string_view_case_sensitivity( &self, s: impl CastInto<Ref<QStringView>>, cs: CaseSensitivity ) -> bool

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This function overloads startsWith().

Calls C++ function: bool QStringRef::startsWith(QStringView s, Qt::CaseSensitivity cs = …) const.

C++ documentation:

This function overloads startsWith().

This function was introduced in Qt 5.10.

See also QString::startsWith() and endsWith().

source

pub unsafe fn starts_with_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> bool

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This function overloads startsWith().

Calls C++ function: bool QStringRef::startsWith(QStringView s) const.

C++ documentation:

This function overloads startsWith().

This function was introduced in Qt 5.10.

See also QString::startsWith() and endsWith().

source

pub unsafe fn string(&self) -> Ptr<QString>

Returns a pointer to the string referred to by the string reference, or 0 if it does not reference a string.

Calls C++ function: const QString* QStringRef::string() const.

C++ documentation:

Returns a pointer to the string referred to by the string reference, or 0 if it does not reference a string.

See also unicode().

source

pub unsafe fn to_double_1a(&self, ok: *mut bool) -> c_double

Returns the string converted to a double value.

Calls C++ function: double QStringRef::toDouble(bool* ok = …) const.

C++ documentation:

Returns the string converted to a double value.

Returns 0.0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toDouble()

For historic reasons, this function does not handle thousands group separators. If you need to convert such numbers, use QLocale::toDouble().

This function was introduced in Qt 5.1.

See also QString::toDouble().

source

pub unsafe fn to_double_0a(&self) -> c_double

Returns the string converted to a double value.

Calls C++ function: double QStringRef::toDouble() const.

C++ documentation:

Returns the string converted to a double value.

Returns 0.0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toDouble()

For historic reasons, this function does not handle thousands group separators. If you need to convert such numbers, use QLocale::toDouble().

This function was introduced in Qt 5.1.

See also QString::toDouble().

source

pub unsafe fn to_float_1a(&self, ok: *mut bool) -> c_float

Returns the string converted to a float value.

Calls C++ function: float QStringRef::toFloat(bool* ok = …) const.

C++ documentation:

Returns the string converted to a float value.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true. Returns 0.0 if the conversion fails.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toFloat()

This function was introduced in Qt 5.1.

See also QString::toFloat().

source

pub unsafe fn to_float_0a(&self) -> c_float

Returns the string converted to a float value.

Calls C++ function: float QStringRef::toFloat() const.

C++ documentation:

Returns the string converted to a float value.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true. Returns 0.0 if the conversion fails.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toFloat()

This function was introduced in Qt 5.1.

See also QString::toFloat().

source

pub unsafe fn to_int_2a(&self, ok: *mut bool, base: c_int) -> c_int

Returns the string converted to an int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: int QStringRef::toInt(bool* ok = …, int base = …) const.

C++ documentation:

Returns the string converted to an int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toInt()

This function was introduced in Qt 5.1.

See also QString::toInt().

source

pub unsafe fn to_int_1a(&self, ok: *mut bool) -> c_int

Returns the string converted to an int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: int QStringRef::toInt(bool* ok = …) const.

C++ documentation:

Returns the string converted to an int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toInt()

This function was introduced in Qt 5.1.

See also QString::toInt().

source

pub unsafe fn to_int_0a(&self) -> c_int

Returns the string converted to an int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: int QStringRef::toInt() const.

C++ documentation:

Returns the string converted to an int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toInt()

This function was introduced in Qt 5.1.

See also QString::toInt().

source

pub unsafe fn to_latin1(&self) -> CppBox<QByteArray>

Returns a Latin-1 representation of the string as a QByteArray.

Calls C++ function: QByteArray QStringRef::toLatin1() const.

C++ documentation:

Returns a Latin-1 representation of the string as a QByteArray.

The returned byte array is undefined if the string contains non-Latin1 characters. Those characters may be suppressed or replaced with a question mark.

This function was introduced in Qt 4.8.

See also toUtf8(), toLocal8Bit(), and QTextCodec.

source

pub unsafe fn to_local8_bit(&self) -> CppBox<QByteArray>

Returns the local 8-bit representation of the string as a QByteArray. The returned byte array is undefined if the string contains characters not supported by the local 8-bit encoding.

Calls C++ function: QByteArray QStringRef::toLocal8Bit() const.

C++ documentation:

Returns the local 8-bit representation of the string as a QByteArray. The returned byte array is undefined if the string contains characters not supported by the local 8-bit encoding.

QTextCodec::codecForLocale() is used to perform the conversion from Unicode. If the locale encoding could not be determined, this function does the same as toLatin1().

If this string contains any characters that cannot be encoded in the locale, the returned byte array is undefined. Those characters may be suppressed or replaced by another.

This function was introduced in Qt 4.8.

See also toLatin1(), toUtf8(), and QTextCodec.

source

pub unsafe fn to_long_2a(&self, ok: *mut bool, base: c_int) -> c_long

Returns the string converted to a long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: long QStringRef::toLong(bool* ok = …, int base = …) const.

C++ documentation:

Returns the string converted to a long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toLong()

This function was introduced in Qt 5.1.

See also QString::toLong().

source

pub unsafe fn to_long_1a(&self, ok: *mut bool) -> c_long

Returns the string converted to a long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: long QStringRef::toLong(bool* ok = …) const.

C++ documentation:

Returns the string converted to a long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toLong()

This function was introduced in Qt 5.1.

See also QString::toLong().

source

pub unsafe fn to_long_0a(&self) -> c_long

Returns the string converted to a long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: long QStringRef::toLong() const.

C++ documentation:

Returns the string converted to a long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toLong()

This function was introduced in Qt 5.1.

See also QString::toLong().

source

pub unsafe fn to_long_long_2a(&self, ok: *mut bool, base: c_int) -> i64

Returns the string converted to a long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: qlonglong QStringRef::toLongLong(bool* ok = …, int base = …) const.

C++ documentation:

Returns the string converted to a long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toLongLong()

This function was introduced in Qt 5.1.

See also QString::toLongLong().

source

pub unsafe fn to_long_long_1a(&self, ok: *mut bool) -> i64

Returns the string converted to a long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: qlonglong QStringRef::toLongLong(bool* ok = …) const.

C++ documentation:

Returns the string converted to a long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toLongLong()

This function was introduced in Qt 5.1.

See also QString::toLongLong().

source

pub unsafe fn to_long_long_0a(&self) -> i64

Returns the string converted to a long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: qlonglong QStringRef::toLongLong() const.

C++ documentation:

Returns the string converted to a long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toLongLong()

This function was introduced in Qt 5.1.

See also QString::toLongLong().

source

pub unsafe fn to_short_2a(&self, ok: *mut bool, base: c_int) -> c_short

Returns the string converted to a short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: short QStringRef::toShort(bool* ok = …, int base = …) const.

C++ documentation:

Returns the string converted to a short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toShort()

This function was introduced in Qt 5.1.

See also QString::toShort().

source

pub unsafe fn to_short_1a(&self, ok: *mut bool) -> c_short

Returns the string converted to a short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: short QStringRef::toShort(bool* ok = …) const.

C++ documentation:

Returns the string converted to a short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toShort()

This function was introduced in Qt 5.1.

See also QString::toShort().

source

pub unsafe fn to_short_0a(&self) -> c_short

Returns the string converted to a short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: short QStringRef::toShort() const.

C++ documentation:

Returns the string converted to a short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toShort()

This function was introduced in Qt 5.1.

See also QString::toShort().

source

pub unsafe fn to_string(&self) -> CppBox<QString>

Returns a copy of the string reference as a QString object.

Calls C++ function: QString QStringRef::toString() const.

C++ documentation:

Returns a copy of the string reference as a QString object.

If the string reference is not a complete reference of the string (meaning that position() is 0 and size() equals string()->size()), this function will allocate a new string to return.

See also string().

source

pub unsafe fn to_u_int_2a(&self, ok: *mut bool, base: c_int) -> c_uint

Returns the string converted to an unsigned int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned int QStringRef::toUInt(bool* ok = …, int base = …) const.

C++ documentation:

Returns the string converted to an unsigned int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toUInt()

This function was introduced in Qt 5.1.

See also QString::toUInt().

source

pub unsafe fn to_u_int_1a(&self, ok: *mut bool) -> c_uint

Returns the string converted to an unsigned int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned int QStringRef::toUInt(bool* ok = …) const.

C++ documentation:

Returns the string converted to an unsigned int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toUInt()

This function was introduced in Qt 5.1.

See also QString::toUInt().

source

pub unsafe fn to_u_int_0a(&self) -> c_uint

Returns the string converted to an unsigned int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned int QStringRef::toUInt() const.

C++ documentation:

Returns the string converted to an unsigned int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toUInt()

This function was introduced in Qt 5.1.

See also QString::toUInt().

source

pub unsafe fn to_u_long_2a(&self, ok: *mut bool, base: c_int) -> c_ulong

Returns the string converted to an unsigned long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned long QStringRef::toULong(bool* ok = …, int base = …) const.

C++ documentation:

Returns the string converted to an unsigned long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toULongLong()

This function was introduced in Qt 5.1.

See also QString::toULong().

source

pub unsafe fn to_u_long_1a(&self, ok: *mut bool) -> c_ulong

Returns the string converted to an unsigned long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned long QStringRef::toULong(bool* ok = …) const.

C++ documentation:

Returns the string converted to an unsigned long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toULongLong()

This function was introduced in Qt 5.1.

See also QString::toULong().

source

pub unsafe fn to_u_long_0a(&self) -> c_ulong

Returns the string converted to an unsigned long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned long QStringRef::toULong() const.

C++ documentation:

Returns the string converted to an unsigned long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toULongLong()

This function was introduced in Qt 5.1.

See also QString::toULong().

source

pub unsafe fn to_u_long_long_2a(&self, ok: *mut bool, base: c_int) -> u64

Returns the string converted to an unsigned long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: qulonglong QStringRef::toULongLong(bool* ok = …, int base = …) const.

C++ documentation:

Returns the string converted to an unsigned long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toULongLong()

This function was introduced in Qt 5.1.

See also QString::toULongLong().

source

pub unsafe fn to_u_long_long_1a(&self, ok: *mut bool) -> u64

Returns the string converted to an unsigned long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: qulonglong QStringRef::toULongLong(bool* ok = …) const.

C++ documentation:

Returns the string converted to an unsigned long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toULongLong()

This function was introduced in Qt 5.1.

See also QString::toULongLong().

source

pub unsafe fn to_u_long_long_0a(&self) -> u64

Returns the string converted to an unsigned long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: qulonglong QStringRef::toULongLong() const.

C++ documentation:

Returns the string converted to an unsigned long long using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toULongLong()

This function was introduced in Qt 5.1.

See also QString::toULongLong().

source

pub unsafe fn to_u_short_2a(&self, ok: *mut bool, base: c_int) -> c_ushort

Returns the string converted to an unsigned short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned short QStringRef::toUShort(bool* ok = …, int base = …) const.

C++ documentation:

Returns the string converted to an unsigned short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toUShort()

This function was introduced in Qt 5.1.

See also QString::toUShort().

source

pub unsafe fn to_u_short_1a(&self, ok: *mut bool) -> c_ushort

Returns the string converted to an unsigned short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned short QStringRef::toUShort(bool* ok = …) const.

C++ documentation:

Returns the string converted to an unsigned short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toUShort()

This function was introduced in Qt 5.1.

See also QString::toUShort().

source

pub unsafe fn to_u_short_0a(&self) -> c_ushort

Returns the string converted to an unsigned short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

Calls C++ function: unsigned short QStringRef::toUShort() const.

C++ documentation:

Returns the string converted to an unsigned short using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If a conversion error occurs, *ok is set to false; otherwise *ok is set to true.

If base is 0, the C language convention is used: If the string begins with "0x", base 16 is used; if the string begins with "0", base 8 is used; otherwise, base 10 is used.

The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toUShort()

This function was introduced in Qt 5.1.

See also QString::toUShort().

source

pub unsafe fn to_ucs4(&self) -> CppBox<QVectorOfUint>

Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.

Calls C++ function: QVector<unsigned int> QStringRef::toUcs4() const.

C++ documentation:

Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.

UCS-4 is a Unicode codec and therefore it is lossless. All characters from this string will be encoded in UCS-4. Any invalid sequence of code units in this string is replaced by the Unicode's replacement character (QChar::ReplacementCharacter, which corresponds to U+FFFD).

The returned vector is not NUL terminated.

This function was introduced in Qt 4.8.

See also toUtf8(), toLatin1(), toLocal8Bit(), and QTextCodec.

source

pub unsafe fn to_utf8(&self) -> CppBox<QByteArray>

Returns a UTF-8 representation of the string as a QByteArray.

Calls C++ function: QByteArray QStringRef::toUtf8() const.

C++ documentation:

Returns a UTF-8 representation of the string as a QByteArray.

UTF-8 is a Unicode codec and can represent all characters in a Unicode string like QString.

This function was introduced in Qt 4.8.

See also toLatin1(), toLocal8Bit(), and QTextCodec.

source

pub unsafe fn trimmed(&self) -> CppBox<QStringRef>

Returns a string that has whitespace removed from the start and the end.

Calls C++ function: QStringRef QStringRef::trimmed() const.

C++ documentation:

Returns a string that has whitespace removed from the start and the end.

Whitespace means any character for which QChar::isSpace() returns true. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.

Unlike QString::simplified(), trimmed() leaves internal whitespace alone.

This function was introduced in Qt 5.1.

See also QString::trimmed().

source

pub unsafe fn truncate(&self, pos: c_int)

Truncates the string at the given position index.

Calls C++ function: void QStringRef::truncate(int pos).

C++ documentation:

Truncates the string at the given position index.

If the specified position index is beyond the end of the string, nothing happens.

If position is negative, it is equivalent to passing zero.

This function was introduced in Qt 5.6.

See also QString::truncate().

source

pub unsafe fn unicode(&self) -> Ptr<QChar>

Returns a Unicode representation of the string reference. Since the data stems directly from the referenced string, it is not null-terminated unless the string reference includes the string's null terminator.

Calls C++ function: const QChar* QStringRef::unicode() const.

C++ documentation:

Returns a Unicode representation of the string reference. Since the data stems directly from the referenced string, it is not null-terminated unless the string reference includes the string’s null terminator.

See also string().

Trait Implementations§

source§

impl Add<Ref<QChar>> for &QStringRef

source§

fn add(self, s2: Ref<QChar>) -> CppBox<QString>

Calls C++ function: QString operator+(const QStringRef& s1, QChar s2).

§

type Output = CppBox<QString>

The resulting type after applying the + operator.
source§

impl Add<Ref<QLatin1String>> for &QStringRef

source§

fn add(self, s2: Ref<QLatin1String>) -> CppBox<QString>

Calls C++ function: QString operator+(const QStringRef& s1, QLatin1String s2).

§

type Output = CppBox<QString>

The resulting type after applying the + operator.
source§

impl Add<Ref<QString>> for &QStringRef

source§

fn add(self, s2: Ref<QString>) -> CppBox<QString>

Calls C++ function: QString operator+(const QStringRef& s1, const QString& s2).

§

type Output = CppBox<QString>

The resulting type after applying the + operator.
source§

impl Add<Ref<QStringRef>> for &QStringRef

source§

fn add(self, s2: Ref<QStringRef>) -> CppBox<QString>

Calls C++ function: QString operator+(const QStringRef& s1, const QStringRef& s2).

§

type Output = CppBox<QString>

The resulting type after applying the + operator.
source§

impl Begin for QStringRef

source§

unsafe fn begin(&self) -> Ptr<QChar>

Returns a const STL-style iterator pointing to the first character in the string.

Calls C++ function: const QChar* QStringRef::begin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first character in the string.

This function was introduced in Qt 5.4.

See also cbegin(), constBegin(), end(), constEnd(), rbegin(), and rend().

§

type Output = Ptr<QChar>

Output type.
source§

impl CppDeletable for QStringRef

source§

unsafe fn delete(&self)

Destroys the string reference.

Calls C++ function: [destructor] void QStringRef::~QStringRef().

C++ documentation:

Destroys the string reference.

Since this class is only used to refer to string data, and does not take ownership of it, no memory is freed when instances are destroyed.

source§

impl Data for QStringRef

source§

unsafe fn data(&self) -> Ptr<QChar>

Same as unicode().

Calls C++ function: const QChar* QStringRef::data() const.

C++ documentation:

Same as unicode().

§

type Output = Ptr<QChar>

Return type of data() function.
source§

impl End for QStringRef

source§

unsafe fn end(&self) -> Ptr<QChar>

Returns a const STL-style iterator pointing to the imaginary character after the last character in the list.

Calls C++ function: const QChar* QStringRef::end() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary character after the last character in the list.

This function was introduced in Qt 5.4.

See also cbegin(), constBegin(), end(), constEnd(), rbegin(), and rend().

§

type Output = Ptr<QChar>

Output type.
source§

impl Ge<*const i8> for QStringRef

source§

unsafe fn ge(&self, s: &*const c_char) -> bool

This function overloads operator>=().

Calls C++ function: bool QStringRef::operator>=(const char* s) const.

C++ documentation:

This function overloads operator>=().

The s const char pointer is converted to a QStringRef using the fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

Returns true if this string is lexically greater than or equal to the parameter string s. Otherwise returns false.

See also QT_NO_CAST_FROM_ASCII.

source§

impl Ge<Ref<QByteArray>> for QStringRef

source§

unsafe fn ge(&self, rhs: &Ref<QByteArray>) -> bool

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator>=(const QStringRef& lhs, const QByteArray& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator>=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

source§

impl Ge<Ref<QChar>> for QStringRef

source§

unsafe fn ge(&self, rhs: &Ref<QChar>) -> bool

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator>=(const QStringRef& lhs, QChar rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator>=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

source§

impl Ge<Ref<QLatin1String>> for QStringRef

source§

unsafe fn ge(&self, rhs: &Ref<QLatin1String>) -> bool

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator>=(const QStringRef& lhs, QLatin1String rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator>=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

source§

impl Ge<Ref<QString>> for QStringRef

source§

unsafe fn ge(&self, rhs: &Ref<QString>) -> bool

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator>=(const QStringRef& lhs, const QString& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator>=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

source§

impl Ge<Ref<QStringRef>> for QStringRef

source§

unsafe fn ge(&self, s2: &Ref<QStringRef>) -> bool

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator>=(const QStringRef& s1, const QStringRef& s2).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator>=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

source§

impl Gt<*const i8> for QStringRef

source§

unsafe fn gt(&self, s: &*const c_char) -> bool

This function overloads operator>().

Calls C++ function: bool QStringRef::operator>(const char* s) const.

C++ documentation:

This function overloads operator>().

The s const char pointer is converted to a QStringRef using the fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

Returns true if this string is lexically greater than the parameter string s. Otherwise returns false.

See also QT_NO_CAST_FROM_ASCII.

source§

impl Gt<Ref<QByteArray>> for QStringRef

source§

unsafe fn gt(&self, rhs: &Ref<QByteArray>) -> bool

Calls C++ function: bool operator>(const QStringRef& lhs, const QByteArray& rhs).

source§

impl Gt<Ref<QChar>> for QStringRef

source§

unsafe fn gt(&self, rhs: &Ref<QChar>) -> bool

Calls C++ function: bool operator>(const QStringRef& lhs, QChar rhs).

source§

impl Gt<Ref<QLatin1String>> for QStringRef

source§

unsafe fn gt(&self, rhs: &Ref<QLatin1String>) -> bool

Calls C++ function: bool operator>(const QStringRef& lhs, QLatin1String rhs).

source§

impl Gt<Ref<QString>> for QStringRef

source§

unsafe fn gt(&self, rhs: &Ref<QString>) -> bool

Calls C++ function: bool operator>(const QStringRef& lhs, const QString& rhs).

source§

impl Gt<Ref<QStringRef>> for QStringRef

source§

unsafe fn gt(&self, s2: &Ref<QStringRef>) -> bool

Calls C++ function: bool operator>(const QStringRef& s1, const QStringRef& s2).

source§

impl Le<*const i8> for QStringRef

source§

unsafe fn le(&self, s: &*const c_char) -> bool

This function overloads operator<=().

Calls C++ function: bool QStringRef::operator<=(const char* s) const.

C++ documentation:

This function overloads operator<=().

The s const char pointer is converted to a QStringRef using the fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

Returns true if this string is lexically smaller than or equal to the parameter string s. Otherwise returns false.

See also QT_NO_CAST_FROM_ASCII.

source§

impl Le<Ref<QByteArray>> for QStringRef

source§

unsafe fn le(&self, rhs: &Ref<QByteArray>) -> bool

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator<=(const QStringRef& lhs, const QByteArray& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator<=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

source§

impl Le<Ref<QChar>> for QStringRef

source§

unsafe fn le(&self, rhs: &Ref<QChar>) -> bool

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator<=(const QStringRef& lhs, QChar rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator<=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

source§

impl Le<Ref<QLatin1String>> for QStringRef

source§

unsafe fn le(&self, rhs: &Ref<QLatin1String>) -> bool

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator<=(const QStringRef& lhs, QLatin1String rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator<=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

source§

impl Le<Ref<QString>> for QStringRef

source§

unsafe fn le(&self, rhs: &Ref<QString>) -> bool

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator<=(const QStringRef& lhs, const QString& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator<=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

source§

impl Le<Ref<QStringRef>> for QStringRef

source§

unsafe fn le(&self, s2: &Ref<QStringRef>) -> bool

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

Calls C++ function: bool operator<=(const QStringRef& s1, const QStringRef& s2).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator<=(QChar c1, QChar c2):

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

source§

impl Lt<*const i8> for QStringRef

source§

unsafe fn lt(&self, s: &*const c_char) -> bool

This function overloads operator<().

Calls C++ function: bool QStringRef::operator<(const char* s) const.

C++ documentation:

This function overloads operator<().

The s const char pointer is converted to a QStringRef using the fromUtf8() function.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

Returns true if this string is lexically smaller than the parameter string s. Otherwise returns false.

See also QT_NO_CAST_FROM_ASCII.

source§

impl Lt<Ref<QByteArray>> for QStringRef

source§

unsafe fn lt(&self, rhs: &Ref<QByteArray>) -> bool

Calls C++ function: bool operator<(const QStringRef& lhs, const QByteArray& rhs).

source§

impl Lt<Ref<QChar>> for QStringRef

source§

unsafe fn lt(&self, rhs: &Ref<QChar>) -> bool

Calls C++ function: bool operator<(const QStringRef& lhs, QChar rhs).

source§

impl Lt<Ref<QLatin1String>> for QStringRef

source§

unsafe fn lt(&self, rhs: &Ref<QLatin1String>) -> bool

Calls C++ function: bool operator<(const QStringRef& lhs, QLatin1String rhs).

source§

impl Lt<Ref<QString>> for QStringRef

source§

unsafe fn lt(&self, rhs: &Ref<QString>) -> bool

Calls C++ function: bool operator<(const QStringRef& lhs, const QString& rhs).

source§

impl Lt<Ref<QStringRef>> for QStringRef

source§

unsafe fn lt(&self, s2: &Ref<QStringRef>) -> bool

Calls C++ function: bool operator<(const QStringRef& s1, const QStringRef& s2).

source§

impl PartialEq<*const i8> for QStringRef

source§

fn eq(&self, s: &*const c_char) -> bool

This function overloads operator==().

Calls C++ function: bool QStringRef::operator==(const char* s) const.

C++ documentation:

This function overloads operator==().

The s byte array is converted to a QStringRef using the fromUtf8() function. This function stops conversion at the first NUL character found, or the end of the byte array.

You can disable this operator by defining QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example.

Returns true if this string is lexically equal to the parameter string s. Otherwise returns false.

See also QT_NO_CAST_FROM_ASCII.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Ref<QByteArray>> for QStringRef

source§

fn eq(&self, rhs: &Ref<QByteArray>) -> bool

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(const QStringRef& lhs, const QByteArray& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Ref<QChar>> for QStringRef

source§

fn eq(&self, rhs: &Ref<QChar>) -> bool

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(const QStringRef& lhs, QChar rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Ref<QLatin1String>> for QStringRef

source§

fn eq(&self, rhs: &Ref<QLatin1String>) -> bool

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(const QStringRef& lhs, QLatin1String rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Ref<QString>> for QStringRef

source§

fn eq(&self, rhs: &Ref<QString>) -> bool

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(const QStringRef& lhs, const QString& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Ref<QStringRef>> for QStringRef

source§

fn eq(&self, s2: &Ref<QStringRef>) -> bool

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(const QStringRef& s1, const QStringRef& s2).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Size for QStringRef

source§

unsafe fn size(&self) -> usize

Returns the number of characters referred to by the string reference. Equivalent to length() and count().

Calls C++ function: int QStringRef::size() const.

C++ documentation:

Returns the number of characters referred to by the string reference. Equivalent to length() and count().

See also position() and string().

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.