[−][src]Struct qt_core::QStringMatcher
The QStringMatcher class holds a sequence of characters that can be quickly matched in a Unicode string.
C++ class: QStringMatcher
.
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
.
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]
&self,
other: impl CastInto<Ref<QStringMatcher>>
) -> Ref<QStringMatcher>
Assigns the other string matcher to this string matcher.
Calls C++ function: QStringMatcher& QStringMatcher::operator=(const QStringMatcher& other)
.
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]
&self,
str: impl CastInto<Ref<QString>>,
from: c_int
) -> c_int
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
.
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]
&self,
str: impl CastInto<Ptr<QChar>>,
length: c_int,
from: c_int
) -> c_int
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
.
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]
&self,
str: impl CastInto<Ref<QString>>
) -> c_int
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
.
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]
&self,
str: impl CastInto<Ptr<QChar>>,
length: c_int
) -> c_int
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
.
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]
&self,
str: impl CastInto<Ref<QStringView>>,
from: c_longlong
) -> c_longlong
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
.
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]
&self,
str: impl CastInto<Ref<QStringView>>
) -> c_longlong
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
.
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()
.
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]
pattern: impl CastInto<Ref<QString>>,
cs: CaseSensitivity
) -> CppBox<QStringMatcher>
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 = …)
.
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]
uc: impl CastInto<Ptr<QChar>>,
len: c_int,
cs: CaseSensitivity
) -> CppBox<QStringMatcher>
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 = …)
.
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]
pattern: impl CastInto<Ref<QString>>
) -> CppBox<QStringMatcher>
Constructs a string matcher that will search for pattern, with case sensitivity cs.
Calls C++ function: [constructor] void QStringMatcher::QStringMatcher(const QString& pattern)
.
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]
uc: impl CastInto<Ptr<QChar>>,
len: c_int
) -> CppBox<QStringMatcher>
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)
.
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]
pattern: impl CastInto<Ref<QStringView>>,
cs: CaseSensitivity
) -> CppBox<QStringMatcher>
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 = …)
.
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]
pattern: impl CastInto<Ref<QStringView>>
) -> CppBox<QStringMatcher>
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)
.
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]
other: impl CastInto<Ref<QStringMatcher>>
) -> CppBox<QStringMatcher>
Copies the other string matcher to this string matcher.
Calls C++ function: [constructor] void QStringMatcher::QStringMatcher(const QStringMatcher& other)
.
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
.
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)
.
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)
.
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]
Auto Trait Implementations
impl RefUnwindSafe for QStringMatcher
impl Send for QStringMatcher
impl Sync for QStringMatcher
impl Unpin for QStringMatcher
impl UnwindSafe for QStringMatcher
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,