[][src]Struct qt_core::QStringMatcher

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

The QStringMatcher class holds a sequence of characters that can be quickly matched in a Unicode string.

C++ class: QStringMatcher.

C++ documentation:

The QStringMatcher class holds a sequence of characters that can be quickly matched in a Unicode string.

This class is useful when you have a sequence of QChars that you want to repeatedly match against some strings (perhaps in a loop), or when you want to search for the same sequence of characters multiple times in the same string. Using a matcher object and indexIn() is faster than matching a plain QString with QString::indexOf() if repeated matching takes place. This class offers no benefit if you are doing one-off string matches.

Create the QStringMatcher with the QString you want to search for. Then call indexIn() on the QString that you want to search.

Methods

impl QStringMatcher[src]

pub unsafe fn case_sensitivity(&self) -> CaseSensitivity[src]

Returns the case sensitivity setting for this string matcher.

Calls C++ function: Qt::CaseSensitivity QStringMatcher::caseSensitivity() const.

C++ documentation:

Returns the case sensitivity setting for this string matcher.

See also setCaseSensitivity().

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

Assigns the other string matcher to this string matcher.

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

C++ documentation:

Assigns the other string matcher to this string matcher.

pub unsafe fn index_in_q_string_int(
    &self,
    str: impl CastInto<Ref<QString>>,
    from: c_int
) -> c_int
[src]

Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

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

C++ documentation:

Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

See also setPattern() and setCaseSensitivity().

pub unsafe fn index_in_q_char2_int(
    &self,
    str: impl CastInto<Ptr<QChar>>,
    length: c_int,
    from: c_int
) -> c_int
[src]

Searches the string starting at str (of length length) from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

Calls C++ function: int QStringMatcher::indexIn(const QChar* str, int length, int from = …) const.

C++ documentation:

Searches the string starting at str (of length length) from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

This function was introduced in Qt 4.5.

See also setPattern() and setCaseSensitivity().

pub unsafe fn index_in_q_string(
    &self,
    str: impl CastInto<Ref<QString>>
) -> c_int
[src]

Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

Calls C++ function: int QStringMatcher::indexIn(const QString& str) const.

C++ documentation:

Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

See also setPattern() and setCaseSensitivity().

pub unsafe fn index_in_q_char_int(
    &self,
    str: impl CastInto<Ptr<QChar>>,
    length: c_int
) -> c_int
[src]

Searches the string starting at str (of length length) from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

Calls C++ function: int QStringMatcher::indexIn(const QChar* str, int length) const.

C++ documentation:

Searches the string starting at str (of length length) from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

This function was introduced in Qt 4.5.

See also setPattern() and setCaseSensitivity().

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

This is supported on cpp_lib_version="5.14.0" only.

Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

Calls C++ function: long long QStringMatcher::indexIn(QStringView str, long long from = …) const.

C++ documentation:

Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

This function was introduced in Qt 5.14.

See also setPattern() and setCaseSensitivity().

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

This is supported on cpp_lib_version="5.14.0" only.

Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

Calls C++ function: long long QStringMatcher::indexIn(QStringView str) const.

C++ documentation:

Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in str, or -1 if no match was found.

This function was introduced in Qt 5.14.

See also setPattern() and setCaseSensitivity().

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

Constructs an empty string matcher that won't match anything. Call setPattern() to give it a pattern to match.

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

C++ documentation:

Constructs an empty string matcher that won't match anything. Call setPattern() to give it a pattern to match.

pub unsafe fn from_q_string_case_sensitivity(
    pattern: impl CastInto<Ref<QString>>,
    cs: CaseSensitivity
) -> CppBox<QStringMatcher>
[src]

Constructs a string matcher that will search for pattern, with case sensitivity cs.

Calls C++ function: [constructor] void QStringMatcher::QStringMatcher(const QString& pattern, Qt::CaseSensitivity cs = …).

C++ documentation:

Constructs a string matcher that will search for pattern, with case sensitivity cs.

Call indexIn() to perform a search.

pub unsafe fn from_q_char_int_case_sensitivity(
    uc: impl CastInto<Ptr<QChar>>,
    len: c_int,
    cs: CaseSensitivity
) -> CppBox<QStringMatcher>
[src]

Constructs a string matcher that will search for the pattern referred to by uc with the given length and case sensitivity specified by cs.

Calls C++ function: [constructor] void QStringMatcher::QStringMatcher(const QChar* uc, int len, Qt::CaseSensitivity cs = …).

C++ documentation:

Constructs a string matcher that will search for the pattern referred to by uc with the given length and case sensitivity specified by cs.

This function was introduced in Qt 4.5.

pub unsafe fn from_q_string(
    pattern: impl CastInto<Ref<QString>>
) -> CppBox<QStringMatcher>
[src]

Constructs a string matcher that will search for pattern, with case sensitivity cs.

Calls C++ function: [constructor] void QStringMatcher::QStringMatcher(const QString& pattern).

C++ documentation:

Constructs a string matcher that will search for pattern, with case sensitivity cs.

Call indexIn() to perform a search.

pub unsafe fn from_q_char_int(
    uc: impl CastInto<Ptr<QChar>>,
    len: c_int
) -> CppBox<QStringMatcher>
[src]

Constructs a string matcher that will search for the pattern referred to by uc with the given length and case sensitivity specified by cs.

Calls C++ function: [constructor] void QStringMatcher::QStringMatcher(const QChar* uc, int len).

C++ documentation:

Constructs a string matcher that will search for the pattern referred to by uc with the given length and case sensitivity specified by cs.

This function was introduced in Qt 4.5.

pub unsafe fn from_q_string_view_case_sensitivity(
    pattern: impl CastInto<Ref<QStringView>>,
    cs: CaseSensitivity
) -> CppBox<QStringMatcher>
[src]

This is supported on cpp_lib_version="5.14.0" only.

Constructs a string matcher that will search for pattern, with case sensitivity cs.

Calls C++ function: [constructor] void QStringMatcher::QStringMatcher(QStringView pattern, Qt::CaseSensitivity cs = …).

C++ documentation:

Constructs a string matcher that will search for pattern, with case sensitivity cs.

Call indexIn() to perform a search.

This function was introduced in Qt 5.14.

pub unsafe fn from_q_string_view(
    pattern: impl CastInto<Ref<QStringView>>
) -> CppBox<QStringMatcher>
[src]

This is supported on cpp_lib_version="5.14.0" only.

Constructs a string matcher that will search for pattern, with case sensitivity cs.

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

C++ documentation:

Constructs a string matcher that will search for pattern, with case sensitivity cs.

Call indexIn() to perform a search.

This function was introduced in Qt 5.14.

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

Copies the other string matcher to this string matcher.

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

C++ documentation:

Copies the other string matcher to this string matcher.

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

Returns the string pattern that this string matcher will search for.

Calls C++ function: QString QStringMatcher::pattern() const.

C++ documentation:

Returns the string pattern that this string matcher will search for.

See also setPattern().

pub unsafe fn set_case_sensitivity(&self, cs: CaseSensitivity)[src]

Sets the case sensitivity setting of this string matcher to cs.

Calls C++ function: void QStringMatcher::setCaseSensitivity(Qt::CaseSensitivity cs).

C++ documentation:

Sets the case sensitivity setting of this string matcher to cs.

See also caseSensitivity(), setPattern(), and indexIn().

pub unsafe fn set_pattern(&self, pattern: impl CastInto<Ref<QString>>)[src]

Sets the string that this string matcher will search for to pattern.

Calls C++ function: void QStringMatcher::setPattern(const QString& pattern).

C++ documentation:

Sets the string that this string matcher will search for to pattern.

See also pattern(), setCaseSensitivity(), and indexIn().

Trait Implementations

impl CppDeletable for QStringMatcher[src]

unsafe fn delete(&self)[src]

Destroys the string matcher.

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

C++ documentation:

Destroys the string matcher.

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.