[−][src]Struct qt_core::QByteArrayMatcher
The QByteArrayMatcher class holds a sequence of bytes that can be quickly matched in a byte array.
C++ class: QByteArrayMatcher
.
The QByteArrayMatcher class holds a sequence of bytes that can be quickly matched in a byte array.
This class is useful when you have a sequence of bytes that you want to repeatedly match against some byte arrays (perhaps in a loop), or when you want to search for the same sequence of bytes multiple times in the same byte array. Using a matcher object and indexIn() is faster than matching a plain QByteArray with QByteArray::indexOf() if repeated matching takes place. This class offers no benefit if you are doing one-off byte array matches.
Create the QByteArrayMatcher with the QByteArray you want to search for. Then call indexIn() on the QByteArray that you want to search.
Methods
impl QByteArrayMatcher
[src]
pub unsafe fn copy_from(
&mut self,
other: impl CastInto<Ref<QByteArrayMatcher>>
) -> MutRef<QByteArrayMatcher>
[src]
&mut self,
other: impl CastInto<Ref<QByteArrayMatcher>>
) -> MutRef<QByteArrayMatcher>
Assigns the other byte array matcher to this byte array matcher.
Calls C++ function: QByteArrayMatcher& QByteArrayMatcher::operator=(const QByteArrayMatcher& other)
.
Assigns the other byte array matcher to this byte array matcher.
pub unsafe fn index_in_q_byte_array_int(
&self,
ba: impl CastInto<Ref<QByteArray>>,
from: c_int
) -> c_int
[src]
&self,
ba: impl CastInto<Ref<QByteArray>>,
from: c_int
) -> c_int
Searches the byte array ba, from byte position from (default 0, i.e. from the first byte), for the byte array pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in ba, or -1 if no match was found.
Calls C++ function: int QByteArrayMatcher::indexIn(const QByteArray& ba, int from = …) const
.
Searches the byte array ba, from byte position from (default 0, i.e. from the first byte), for the byte array pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in ba, or -1 if no match was found.
pub unsafe fn index_in_char2_int(
&self,
str: impl CastInto<Ptr<c_char>>,
len: c_int,
from: c_int
) -> c_int
[src]
&self,
str: impl CastInto<Ptr<c_char>>,
len: c_int,
from: c_int
) -> c_int
Searches the char string str, which has length len, from byte position from (default 0, i.e. from the first byte), for the byte array 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 QByteArrayMatcher::indexIn(const char* str, int len, int from = …) const
.
Searches the char string str, which has length len, from byte position from (default 0, i.e. from the first byte), for the byte array 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.
pub unsafe fn index_in_q_byte_array(
&self,
ba: impl CastInto<Ref<QByteArray>>
) -> c_int
[src]
&self,
ba: impl CastInto<Ref<QByteArray>>
) -> c_int
Searches the byte array ba, from byte position from (default 0, i.e. from the first byte), for the byte array pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in ba, or -1 if no match was found.
Calls C++ function: int QByteArrayMatcher::indexIn(const QByteArray& ba) const
.
Searches the byte array ba, from byte position from (default 0, i.e. from the first byte), for the byte array pattern() that was set in the constructor or in the most recent call to setPattern(). Returns the position where the pattern() matched in ba, or -1 if no match was found.
pub unsafe fn index_in_char_int(
&self,
str: impl CastInto<Ptr<c_char>>,
len: c_int
) -> c_int
[src]
&self,
str: impl CastInto<Ptr<c_char>>,
len: c_int
) -> c_int
Searches the char string str, which has length len, from byte position from (default 0, i.e. from the first byte), for the byte array 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 QByteArrayMatcher::indexIn(const char* str, int len) const
.
Searches the char string str, which has length len, from byte position from (default 0, i.e. from the first byte), for the byte array 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.
pub unsafe fn new_0a() -> CppBox<QByteArrayMatcher>
[src]
Constructs an empty byte array matcher that won't match anything. Call setPattern() to give it a pattern to match.
Calls C++ function: [constructor] void QByteArrayMatcher::QByteArrayMatcher()
.
Constructs an empty byte array matcher that won't match anything. Call setPattern() to give it a pattern to match.
pub unsafe fn new_1a(
pattern: impl CastInto<Ref<QByteArray>>
) -> CppBox<QByteArrayMatcher>
[src]
pattern: impl CastInto<Ref<QByteArray>>
) -> CppBox<QByteArrayMatcher>
Constructs a byte array matcher that will search for pattern. Call indexIn() to perform a search.
Calls C++ function: [constructor] void QByteArrayMatcher::QByteArrayMatcher(const QByteArray& pattern)
.
Constructs a byte array matcher that will search for pattern. Call indexIn() to perform a search.
pub unsafe fn new_2a(
pattern: impl CastInto<Ptr<c_char>>,
length: c_int
) -> CppBox<QByteArrayMatcher>
[src]
pattern: impl CastInto<Ptr<c_char>>,
length: c_int
) -> CppBox<QByteArrayMatcher>
Constructs a byte array matcher from pattern. pattern has the given length. pattern must remain in scope, but the destructor does not delete pattern.
Calls C++ function: [constructor] void QByteArrayMatcher::QByteArrayMatcher(const char* pattern, int length)
.
Constructs a byte array matcher from pattern. pattern has the given length. pattern must remain in scope, but the destructor does not delete pattern.
pub unsafe fn new_copy(
other: impl CastInto<Ref<QByteArrayMatcher>>
) -> CppBox<QByteArrayMatcher>
[src]
other: impl CastInto<Ref<QByteArrayMatcher>>
) -> CppBox<QByteArrayMatcher>
Copies the other byte array matcher to this byte array matcher.
Calls C++ function: [constructor] void QByteArrayMatcher::QByteArrayMatcher(const QByteArrayMatcher& other)
.
Copies the other byte array matcher to this byte array matcher.
pub unsafe fn pattern(&self) -> CppBox<QByteArray>
[src]
Returns the byte array pattern that this byte array matcher will search for.
Calls C++ function: QByteArray QByteArrayMatcher::pattern() const
.
Returns the byte array pattern that this byte array matcher will search for.
See also setPattern().
pub unsafe fn set_pattern(&mut self, pattern: impl CastInto<Ref<QByteArray>>)
[src]
Sets the byte array that this byte array matcher will search for to pattern.
Calls C++ function: void QByteArrayMatcher::setPattern(const QByteArray& pattern)
.
Trait Implementations
impl CppDeletable for QByteArrayMatcher
[src]
Auto Trait Implementations
impl RefUnwindSafe for QByteArrayMatcher
impl Send for QByteArrayMatcher
impl Sync for QByteArrayMatcher
impl Unpin for QByteArrayMatcher
impl UnwindSafe for QByteArrayMatcher
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]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<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>,