[][src]Struct qt_core::QStringView

#[repr(C)]
pub struct QStringView { /* fields omitted */ }

The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.

C++ class: QStringView.

C++ documentation:

The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.

A QStringView references a contiguous portion of a UTF-16 string it does not own. It acts as an interface type to all kinds of UTF-16 string, without the need to construct a QString first.

The UTF-16 string may be represented as an array (or an array-compatible data-structure such as QString, std::basic_string, etc.) of QChar, ushort, char16_t (on compilers that support C++11 Unicode strings) or (on platforms, such as Windows, where it is a 16-bit type) wchar_t.

QStringView is designed as an interface type; its main use-case is as a function parameter type. When QStringViews are used as automatic variables or data members, care must be taken to ensure that the referenced string data (for example, owned by a QString) outlives the QStringView on all code paths, lest the string view ends up referencing deleted data.

When used as an interface type, QStringView allows a single function to accept a wide variety of UTF-16 string data sources. One function accepting QStringView thus replaces three function overloads (taking QString, QStringRef, and (const QChar*, int)), while at the same time enabling even more string data sources to be passed to the function, such as u"Hello World", a char16_t string literal.

QStringViews should be passed by value, not by reference-to-const:

void myfun1(QStringView sv); // preferred void myfun2(const QStringView &sv); // compiles and works, but slower

If you want to give your users maximum freedom in what strings they can pass to your function, accompany the QStringView overload with overloads for

  • QChar: this overload can delegate to the QStringView version:

    void fun(QChar ch) { fun(QStringView(&ch, 1)); }

    even though, for technical reasons, QStringView cannot provide a QChar constructor by itself.

  • QString: if you store an unmodified copy of the string and thus would like to take advantage of QString's implicit sharing.
  • QLatin1String: if you can implement the function without converting the QLatin1String to UTF-16 first; users expect a function overloaded on QLatin1String to perform strictly less memory allocations than the semantically equivalent call of the QStringView version, involving construction of a QString from the QLatin1String.

QStringView can also be used as the return value of a function. If you call a function returning QStringView, take extra care to not keep the QStringView around longer than the function promises to keep the referenced string data alive. If in doubt, obtain a strong reference to the data by calling toString() to convert the QStringView into a QString.

QStringView is a Literal Type, but since it stores data as char16_t, iteration is not constexpr (casts from const char16_t* to const QChar*, which is not allowed in constexpr functions). You can use an indexed loop and/or utf16() in constexpr contexts instead.

Note: We strongly discourage the use of QList<QStringView>, because QList is a very inefficient container for QStringViews (it would heap-allocate every element). Use QVector (or std::vector) to hold QStringViews instead.

Methods

impl QStringView[src]

pub unsafe fn at(&self, n: c_longlong) -> CppBox<QChar>[src]

Returns the character at position n in this string view.

Calls C++ function: QChar QStringView::at(long long n) const.

C++ documentation:

Returns the character at position n in this string view.

The behavior is undefined if n is negative or not less than size().

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

Returns the last character in the string. Same as last().

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

C++ documentation:

Returns the last character in the string. Same as last().

This function is provided for STL compatibility.

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

See also front(), first(), and last().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

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

C++ documentation:

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

This function is provided for STL compatibility.

See also end(), cbegin(), rbegin(), and data().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

Same as begin().

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

C++ documentation:

Same as begin().

This function is provided for STL compatibility.

See also cend(), begin(), crbegin(), and data().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

Same as end().

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

C++ documentation:

Same as end().

This function is provided for STL compatibility.

See also cbegin(), end(), and crend().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn chop(&mut self, n: c_longlong)[src]

Truncates this string view by length characters.

Calls C++ function: void QStringView::chop(long long n).

C++ documentation:

Truncates this string view by length characters.

Same as *this = left(size() - length).

Note: The behavior is undefined when length < 0 or length > size().

See also mid(), left(), right(), chopped(), and truncate().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn chopped(&self, n: c_longlong) -> CppBox<QStringView>[src]

Returns the substring of length size() - length starting at the beginning of this object.

Calls C++ function: QStringView QStringView::chopped(long long n) const.

C++ documentation:

Returns the substring of length size() - length starting at the beginning of this object.

Same as left(size() - length).

Note: The behavior is undefined when length < 0 or length > size().

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn compare_2a(
    &self,
    other: impl CastInto<Ref<QStringView>>,
    cs: CaseSensitivity
) -> c_int
[src]

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

Calls C++ function: int QStringView::compare(QStringView other, Qt::CaseSensitivity cs = …) const.

C++ documentation:

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

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

This function was introduced in Qt 5.12.

See also operator==(), operator<(), and operator>().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn compare_1a(&self, other: impl CastInto<Ref<QStringView>>) -> c_int[src]

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

Calls C++ function: int QStringView::compare(QStringView other) const.

C++ documentation:

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

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

This function was introduced in Qt 5.12.

See also operator==(), operator<(), and operator>().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if cpp_lib_version="5.14.0".

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

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

This item is available if cpp_lib_version="5.14.0".

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

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn contains_q_char(&self, c: impl CastInto<Ref<QChar>>) -> bool[src]

Calls C++ function: bool QStringView::contains(QChar c) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn contains_q_string_view(
    &self,
    s: impl CastInto<Ref<QStringView>>
) -> bool
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn contains_q_latin1_string(
    &self,
    s: impl CastInto<Ref<QLatin1String>>
) -> bool
[src]

Calls C++ function: bool QStringView::contains(QLatin1String s) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn copy_from(
    &mut self,
    other: impl CastInto<Ref<QStringView>>
) -> MutRef<QStringView>
[src]

The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.

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

C++ documentation:

The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.

A QStringView references a contiguous portion of a UTF-16 string it does not own. It acts as an interface type to all kinds of UTF-16 string, without the need to construct a QString first.

The UTF-16 string may be represented as an array (or an array-compatible data-structure such as QString, std::basic_string, etc.) of QChar, ushort, char16_t (on compilers that support C++11 Unicode strings) or (on platforms, such as Windows, where it is a 16-bit type) wchar_t.

QStringView is designed as an interface type; its main use-case is as a function parameter type. When QStringViews are used as automatic variables or data members, care must be taken to ensure that the referenced string data (for example, owned by a QString) outlives the QStringView on all code paths, lest the string view ends up referencing deleted data.

When used as an interface type, QStringView allows a single function to accept a wide variety of UTF-16 string data sources. One function accepting QStringView thus replaces three function overloads (taking QString, QStringRef, and (const QChar*, int)), while at the same time enabling even more string data sources to be passed to the function, such as u"Hello World", a char16_t string literal.

QStringViews should be passed by value, not by reference-to-const:

void myfun1(QStringView sv); // preferred void myfun2(const QStringView &sv); // compiles and works, but slower

If you want to give your users maximum freedom in what strings they can pass to your function, accompany the QStringView overload with overloads for

  • QChar: this overload can delegate to the QStringView version:

    void fun(QChar ch) { fun(QStringView(&ch, 1)); }

    even though, for technical reasons, QStringView cannot provide a QChar constructor by itself.

  • QString: if you store an unmodified copy of the string and thus would like to take advantage of QString's implicit sharing.
  • QLatin1String: if you can implement the function without converting the QLatin1String to UTF-16 first; users expect a function overloaded on QLatin1String to perform strictly less memory allocations than the semantically equivalent call of the QStringView version, involving construction of a QString from the QLatin1String.

QStringView can also be used as the return value of a function. If you call a function returning QStringView, take extra care to not keep the QStringView around longer than the function promises to keep the referenced string data alive. If in doubt, obtain a strong reference to the data by calling toString() to convert the QStringView into a QString.

QStringView is a Literal Type, but since it stores data as char16_t, iteration is not constexpr (casts from const char16_t* to const QChar*, which is not allowed in constexpr functions). You can use an indexed loop and/or utf16() in constexpr contexts instead.

Note: We strongly discourage the use of QList<QStringView>, because QList is a very inefficient container for QStringViews (it would heap-allocate every element). Use QVector (or std::vector) to hold QStringViews instead.

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

Returns a const pointer to the first character in the string.

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

C++ documentation:

Returns a const pointer to the first character in the string.

Note: The character array represented by the return value is not null-terminated.

See also begin(), end(), and utf16().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn empty(&self) -> bool[src]

Returns whether this string view is empty - that is, whether size() == 0.

Calls C++ function: bool QStringView::empty() const.

C++ documentation:

Returns whether this string view is empty - that is, whether size() == 0.

This function is provided for STL compatibility.

See also isEmpty(), isNull(), size(), and length().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

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

C++ documentation:

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

This function is provided for STL compatibility.

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn first(&self) -> CppBox<QChar>[src]

Returns the first character in the string. Same as front().

Calls C++ function: QChar QStringView::first() const.

C++ documentation:

Returns the first character in the string. Same as front().

This function is provided for compatibility with other Qt containers.

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

See also front(), back(), and last().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

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

C++ documentation:

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

This function is provided for STL compatibility.

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

See also back(), first(), and last().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn index(&self, n: c_longlong) -> CppBox<QChar>[src]

Returns the character at position n in this string view.

Calls C++ function: QChar QStringView::operator[](long long n) const.

C++ documentation:

Returns the character at position n in this string view.

The behavior is undefined if n is negative or not less than size().

See also at(), front(), and back().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn index_of_q_char_longlong_case_sensitivity(
    &self,
    c: impl CastInto<Ref<QChar>>,
    from: c_longlong,
    cs: CaseSensitivity
) -> c_longlong
[src]

Calls C++ function: long long QStringView::indexOf(QChar c, long long from = …, Qt::CaseSensitivity cs = …) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn index_of_q_string_view_longlong_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    from: c_longlong,
    cs: CaseSensitivity
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn index_of_q_latin1_string_longlong_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    from: c_longlong,
    cs: CaseSensitivity
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn index_of_q_char_longlong(
    &self,
    c: impl CastInto<Ref<QChar>>,
    from: c_longlong
) -> c_longlong
[src]

Calls C++ function: long long QStringView::indexOf(QChar c, long long from = …) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn index_of_q_char(&self, c: impl CastInto<Ref<QChar>>) -> c_longlong[src]

Calls C++ function: long long QStringView::indexOf(QChar c) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn index_of_q_string_view_longlong(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    from: c_longlong
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn index_of_q_string_view(
    &self,
    s: impl CastInto<Ref<QStringView>>
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn index_of_q_latin1_string_longlong(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    from: c_longlong
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn index_of_q_latin1_string(
    &self,
    s: impl CastInto<Ref<QLatin1String>>
) -> c_longlong
[src]

Calls C++ function: long long QStringView::indexOf(QLatin1String s) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn is_empty(&self) -> bool[src]

Returns whether this string view is empty - that is, whether size() == 0.

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

C++ documentation:

Returns whether this string view is empty - that is, whether size() == 0.

This function is provided for compatibility with other Qt containers.

See also empty(), isNull(), size(), and length().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn is_null(&self) -> bool[src]

Returns whether this string view is null - that is, whether data() == nullptr.

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

C++ documentation:

Returns whether this string view is null - that is, whether data() == nullptr.

This functions is provided for compatibility with other Qt containers.

See also empty(), isEmpty(), size(), and length().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn is_right_to_left(&self) -> bool[src]

Returns true if the string is read right to left.

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

C++ documentation:

Returns true if the string is read right to left.

This function was introduced in Qt 5.11.

See also QString::isRightToLeft().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn last(&self) -> CppBox<QChar>[src]

Returns the last character in the string. Same as back().

Calls C++ function: QChar QStringView::last() const.

C++ documentation:

Returns the last character in the string. Same as back().

This function is provided for compatibility with other Qt containers.

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

See also back(), front(), and first().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn last_index_of_q_char_longlong_case_sensitivity(
    &self,
    c: impl CastInto<Ref<QChar>>,
    from: c_longlong,
    cs: CaseSensitivity
) -> c_longlong
[src]

Calls C++ function: long long QStringView::lastIndexOf(QChar c, long long from = …, Qt::CaseSensitivity cs = …) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn last_index_of_q_string_view_longlong_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    from: c_longlong,
    cs: CaseSensitivity
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn last_index_of_q_latin1_string_longlong_case_sensitivity(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    from: c_longlong,
    cs: CaseSensitivity
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn last_index_of_q_char_longlong(
    &self,
    c: impl CastInto<Ref<QChar>>,
    from: c_longlong
) -> c_longlong
[src]

Calls C++ function: long long QStringView::lastIndexOf(QChar c, long long from = …) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn last_index_of_q_char(
    &self,
    c: impl CastInto<Ref<QChar>>
) -> c_longlong
[src]

Calls C++ function: long long QStringView::lastIndexOf(QChar c) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn last_index_of_q_string_view_longlong(
    &self,
    s: impl CastInto<Ref<QStringView>>,
    from: c_longlong
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn last_index_of_q_string_view(
    &self,
    s: impl CastInto<Ref<QStringView>>
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn last_index_of_q_latin1_string_longlong(
    &self,
    s: impl CastInto<Ref<QLatin1String>>,
    from: c_longlong
) -> c_longlong
[src]

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

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn last_index_of_q_latin1_string(
    &self,
    s: impl CastInto<Ref<QLatin1String>>
) -> c_longlong
[src]

Calls C++ function: long long QStringView::lastIndexOf(QLatin1String s) const.

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn left(&self, n: c_longlong) -> CppBox<QStringView>[src]

Returns the substring of length length starting at position 0 in this object.

Calls C++ function: QStringView QStringView::left(long long n) const.

C++ documentation:

Returns the substring of length length starting at position 0 in this object.

Note: The behavior is undefined when length < 0 or length > size().

See also mid(), right(), chopped(), chop(), and truncate().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn length(&self) -> c_int[src]

Same as size(), except returns the result as an int.

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

C++ documentation:

Same as size(), except returns the result as an int.

This function is provided for compatibility with other Qt containers.

Warning: QStringView can represent strings with more than 231 characters. Calling this function on a string view for which size() returns a value greater than INT_MAX constitutes undefined behavior.

See also empty(), isEmpty(), isNull(), and size().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn mid_1a(&self, pos: c_longlong) -> CppBox<QStringView>[src]

Returns the substring starting at position start in this object, and extending to the end of the string.

Calls C++ function: QStringView QStringView::mid(long long pos) const.

C++ documentation:

Returns the substring starting at position start in this object, and extending to the end of the string.

Note: The behavior is undefined when start < 0 or start > size().

See also left(), right(), chopped(), chop(), and truncate().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn mid_2a(
    &self,
    pos: c_longlong,
    n: c_longlong
) -> CppBox<QStringView>
[src]

This is an overloaded function.

Calls C++ function: QStringView QStringView::mid(long long pos, long long n) const.

C++ documentation:

This is an overloaded function.

Returns the substring of length length starting at position start in this object.

Note: The behavior is undefined when start < 0, length < 0, or start + length > size().

See also left(), right(), chopped(), chop(), and truncate().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn new() -> CppBox<QStringView>[src]

Constructs a null string view.

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

C++ documentation:

Constructs a null string view.

See also isNull().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QStringView>>
) -> CppBox<QStringView>
[src]

The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.

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

C++ documentation:

The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.

A QStringView references a contiguous portion of a UTF-16 string it does not own. It acts as an interface type to all kinds of UTF-16 string, without the need to construct a QString first.

The UTF-16 string may be represented as an array (or an array-compatible data-structure such as QString, std::basic_string, etc.) of QChar, ushort, char16_t (on compilers that support C++11 Unicode strings) or (on platforms, such as Windows, where it is a 16-bit type) wchar_t.

QStringView is designed as an interface type; its main use-case is as a function parameter type. When QStringViews are used as automatic variables or data members, care must be taken to ensure that the referenced string data (for example, owned by a QString) outlives the QStringView on all code paths, lest the string view ends up referencing deleted data.

When used as an interface type, QStringView allows a single function to accept a wide variety of UTF-16 string data sources. One function accepting QStringView thus replaces three function overloads (taking QString, QStringRef, and (const QChar*, int)), while at the same time enabling even more string data sources to be passed to the function, such as u"Hello World", a char16_t string literal.

QStringViews should be passed by value, not by reference-to-const:

void myfun1(QStringView sv); // preferred void myfun2(const QStringView &sv); // compiles and works, but slower

If you want to give your users maximum freedom in what strings they can pass to your function, accompany the QStringView overload with overloads for

  • QChar: this overload can delegate to the QStringView version:

    void fun(QChar ch) { fun(QStringView(&ch, 1)); }

    even though, for technical reasons, QStringView cannot provide a QChar constructor by itself.

  • QString: if you store an unmodified copy of the string and thus would like to take advantage of QString's implicit sharing.
  • QLatin1String: if you can implement the function without converting the QLatin1String to UTF-16 first; users expect a function overloaded on QLatin1String to perform strictly less memory allocations than the semantically equivalent call of the QStringView version, involving construction of a QString from the QLatin1String.

QStringView can also be used as the return value of a function. If you call a function returning QStringView, take extra care to not keep the QStringView around longer than the function promises to keep the referenced string data alive. If in doubt, obtain a strong reference to the data by calling toString() to convert the QStringView into a QString.

QStringView is a Literal Type, but since it stores data as char16_t, iteration is not constexpr (casts from const char16_t* to const QChar*, which is not allowed in constexpr functions). You can use an indexed loop and/or utf16() in constexpr contexts instead.

Note: We strongly discourage the use of QList<QStringView>, because QList is a very inefficient container for QStringViews (it would heap-allocate every element). Use QVector (or std::vector) to hold QStringViews instead.

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn right(&self, n: c_longlong) -> CppBox<QStringView>[src]

Returns the substring of length length starting at position size() - length in this object.

Calls C++ function: QStringView QStringView::right(long long n) const.

C++ documentation:

Returns the substring of length length starting at position size() - length in this object.

Note: The behavior is undefined when length < 0 or length > size().

See also mid(), left(), chopped(), chop(), and truncate().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn size(&self) -> c_longlong[src]

Returns the size of this string view, in UTF-16 code points (that is, surrogate pairs count as two for the purposes of this function, the same as in QString and QStringRef).

Calls C++ function: long long QStringView::size() const.

C++ documentation:

Returns the size of this string view, in UTF-16 code points (that is, surrogate pairs count as two for the purposes of this function, the same as in QString and QStringRef).

See also empty(), isEmpty(), isNull(), and length().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

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

C++ documentation:

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

The behavior is undefined if the string contains non-Latin1 characters.

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

Returns a local 8-bit representation of the string as a QByteArray.

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

C++ documentation:

Returns a local 8-bit representation of the string as a QByteArray.

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

The behavior is undefined if the string contains characters not supported by the locale's 8-bit encoding.

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

Returns a deep copy of this string view's data as a QString.

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

C++ documentation:

Returns a deep copy of this string view's data as a QString.

The return value will be the null QString if and only if this string view is null.

Warning: QStringView can store strings with more than 230 characters while QString cannot. Calling this function on a string view for which size() returns a value greater than INT_MAX / 2 constitutes undefined behavior.

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

Calls C++ function: QVector<unsigned int> QStringView::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 replacement character (QChar::ReplacementCharacter, which corresponds to U+FFFD).

The returned vector is not 0-terminated.

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

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

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

Calls C++ function: QByteArray QStringView::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.

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn to_w_char_array(
    &self,
    array: impl CastInto<MutPtr<wchar_t>>
) -> c_int
[src]

Transcribes this string into the given array.

Calls C++ function: int QStringView::toWCharArray(wchar_t* array) const.

C++ documentation:

Transcribes this string into the given array.

The caller is responsible for ensuring array is large enough to hold the wchar_t encoding of this string (allocating the array with the same length as the string is always sufficient). The array is encoded in UTF-16 on platforms where wchar_t is 2 bytes wide (e.g. Windows); otherwise (Unix systems), wchar_t is assumed to be 4 bytes wide and the data is written in UCS-4.

Note: This function writes no null terminator to the end of array.

Returns the number of wchar_t entries written to array.

This function was introduced in Qt 5.14.

See also QString::toWCharArray().

This item is available if cpp_lib_version="5.14.0".

pub unsafe fn trimmed(&self) -> CppBox<QStringView>[src]

Strips leading and trailing whitespace and returns the result.

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

C++ documentation:

Strips leading and trailing whitespace and returns the result.

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

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn truncate(&mut self, n: c_longlong)[src]

Truncates this string view to length length.

Calls C++ function: void QStringView::truncate(long long n).

C++ documentation:

Truncates this string view to length length.

Same as *this = left(length).

Note: The behavior is undefined when length < 0 or length > size().

See also mid(), left(), right(), chopped(), and chop().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

pub unsafe fn utf16(&self) -> Ptr<char16_t>[src]

Returns a const pointer to the first character in the string.

Calls C++ function: const char16_t* QStringView::utf16() const.

C++ documentation:

Returns a const pointer to the first character in the string.

storage_type is char16_t.

Note: The character array represented by the return value is not null-terminated.

See also begin(), end(), and data().

This item is available if any(cpp_lib_version="5.11.3", cpp_lib_version="5.12.2", cpp_lib_version="5.13.0", cpp_lib_version="5.14.0").

Trait Implementations

impl Begin for QStringView[src]

type Output = Ptr<QChar>

Output type.

unsafe fn begin(&self) -> Ptr<QChar>[src]

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

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

C++ documentation:

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

This function is provided for STL compatibility.

See also end(), cbegin(), rbegin(), and data().

impl CppDeletable for QStringView[src]

unsafe fn delete(&mut self)[src]

The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.

Calls C++ function: [destructor] void QStringView::~QStringView().

C++ documentation:

The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QString API.

A QStringView references a contiguous portion of a UTF-16 string it does not own. It acts as an interface type to all kinds of UTF-16 string, without the need to construct a QString first.

The UTF-16 string may be represented as an array (or an array-compatible data-structure such as QString, std::basic_string, etc.) of QChar, ushort, char16_t (on compilers that support C++11 Unicode strings) or (on platforms, such as Windows, where it is a 16-bit type) wchar_t.

QStringView is designed as an interface type; its main use-case is as a function parameter type. When QStringViews are used as automatic variables or data members, care must be taken to ensure that the referenced string data (for example, owned by a QString) outlives the QStringView on all code paths, lest the string view ends up referencing deleted data.

When used as an interface type, QStringView allows a single function to accept a wide variety of UTF-16 string data sources. One function accepting QStringView thus replaces three function overloads (taking QString, QStringRef, and (const QChar*, int)), while at the same time enabling even more string data sources to be passed to the function, such as u"Hello World", a char16_t string literal.

QStringViews should be passed by value, not by reference-to-const:

void myfun1(QStringView sv); // preferred void myfun2(const QStringView &sv); // compiles and works, but slower

If you want to give your users maximum freedom in what strings they can pass to your function, accompany the QStringView overload with overloads for

  • QChar: this overload can delegate to the QStringView version:

    void fun(QChar ch) { fun(QStringView(&ch, 1)); }

    even though, for technical reasons, QStringView cannot provide a QChar constructor by itself.

  • QString: if you store an unmodified copy of the string and thus would like to take advantage of QString's implicit sharing.
  • QLatin1String: if you can implement the function without converting the QLatin1String to UTF-16 first; users expect a function overloaded on QLatin1String to perform strictly less memory allocations than the semantically equivalent call of the QStringView version, involving construction of a QString from the QLatin1String.

QStringView can also be used as the return value of a function. If you call a function returning QStringView, take extra care to not keep the QStringView around longer than the function promises to keep the referenced string data alive. If in doubt, obtain a strong reference to the data by calling toString() to convert the QStringView into a QString.

QStringView is a Literal Type, but since it stores data as char16_t, iteration is not constexpr (casts from const char16_t* to const QChar*, which is not allowed in constexpr functions). You can use an indexed loop and/or utf16() in constexpr contexts instead.

Note: We strongly discourage the use of QList<QStringView>, because QList is a very inefficient container for QStringViews (it would heap-allocate every element). Use QVector (or std::vector) to hold QStringViews instead.

impl Data for QStringView[src]

type Output = Ptr<QChar>

unsafe fn data(&self) -> Ptr<QChar>[src]

Returns a const pointer to the first character in the string.

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

C++ documentation:

Returns a const pointer to the first character in the string.

Note: The character array represented by the return value is not null-terminated.

See also begin(), end(), and utf16().

impl End for QStringView[src]

type Output = Ptr<QChar>

Output type.

unsafe fn end(&self) -> Ptr<QChar>[src]

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

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

C++ documentation:

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

This function is provided for STL compatibility.

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

impl Ge<Ref<QChar>> for QStringView[src]

unsafe fn ge(&self, rhs: &Ref<QChar>) -> bool[src]

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>=(QStringView 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.

impl Ge<Ref<QLatin1String>> for QStringView[src]

unsafe fn ge(&self, rhs: &Ref<QLatin1String>) -> bool[src]

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>=(QStringView 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.

impl Ge<Ref<QStringView>> for QStringView[src]

unsafe fn ge(&self, rhs: &Ref<QStringView>) -> bool[src]

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>=(QStringView lhs, QStringView 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.

impl Gt<Ref<QChar>> for QStringView[src]

unsafe fn gt(&self, rhs: &Ref<QChar>) -> bool[src]

Calls C++ function: bool operator>(QStringView lhs, QChar rhs).

impl Gt<Ref<QLatin1String>> for QStringView[src]

unsafe fn gt(&self, rhs: &Ref<QLatin1String>) -> bool[src]

Calls C++ function: bool operator>(QStringView lhs, QLatin1String rhs).

impl Gt<Ref<QStringView>> for QStringView[src]

unsafe fn gt(&self, rhs: &Ref<QStringView>) -> bool[src]

Calls C++ function: bool operator>(QStringView lhs, QStringView rhs).

impl Le<Ref<QChar>> for QStringView[src]

unsafe fn le(&self, rhs: &Ref<QChar>) -> bool[src]

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<=(QStringView 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.

impl Le<Ref<QLatin1String>> for QStringView[src]

unsafe fn le(&self, rhs: &Ref<QLatin1String>) -> bool[src]

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<=(QStringView 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.

impl Le<Ref<QStringView>> for QStringView[src]

unsafe fn le(&self, rhs: &Ref<QStringView>) -> bool[src]

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<=(QStringView lhs, QStringView 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.

impl Lt<Ref<QChar>> for QStringView[src]

unsafe fn lt(&self, rhs: &Ref<QChar>) -> bool[src]

Calls C++ function: bool operator<(QStringView lhs, QChar rhs).

impl Lt<Ref<QLatin1String>> for QStringView[src]

unsafe fn lt(&self, rhs: &Ref<QLatin1String>) -> bool[src]

Calls C++ function: bool operator<(QStringView lhs, QLatin1String rhs).

impl Lt<Ref<QStringView>> for QStringView[src]

unsafe fn lt(&self, rhs: &Ref<QStringView>) -> bool[src]

Calls C++ function: bool operator<(QStringView lhs, QStringView rhs).

impl PartialEq<Ref<QChar>> for QStringView[src]

fn eq(&self, rhs: &Ref<QChar>) -> bool[src]

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(QStringView 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.

impl PartialEq<Ref<QLatin1String>> for QStringView[src]

fn eq(&self, rhs: &Ref<QLatin1String>) -> bool[src]

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(QStringView 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.

impl PartialEq<Ref<QStringView>> for QStringView[src]

fn eq(&self, rhs: &Ref<QStringView>) -> bool[src]

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Calls C++ function: bool operator==(QStringView lhs, QStringView 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.

impl Size for QStringView[src]

unsafe fn size(&self) -> usize[src]

Returns the size of this string view, in UTF-16 code points (that is, surrogate pairs count as two for the purposes of this function, the same as in QString and QStringRef).

Calls C++ function: long long QStringView::size() const.

C++ documentation:

Returns the size of this string view, in UTF-16 code points (that is, surrogate pairs count as two for the purposes of this function, the same as in QString and QStringRef).

See also empty(), isEmpty(), isNull(), and length().

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VectorAsSlice for V where
    V: Data<Output = Ptr<T>> + Size
[src]

type Item = T