5#ifndef QSTRINGMATCHER_H
6#define QSTRINGMATCHER_H
8#include <QtCore/qstring.h>
9#include <QtCore/qstringview.h>
14class QStringMatcherPrivate;
18 void updateSkipTable();
20 QStringMatcher() =
default;
21 explicit QStringMatcher(
const QString &pattern,
22 Qt::CaseSensitivity cs = Qt::CaseSensitive);
23 QStringMatcher(
const QChar *uc, qsizetype len,
24 Qt::CaseSensitivity cs = Qt::CaseSensitive)
25 : QStringMatcher(QStringView(uc, len), cs)
27 QStringMatcher(QStringView pattern,
28 Qt::CaseSensitivity cs = Qt::CaseSensitive);
29 QStringMatcher(
const QStringMatcher &other);
32 QStringMatcher &operator=(
const QStringMatcher &other);
34 void setPattern(
const QString &pattern);
35 void setCaseSensitivity(Qt::CaseSensitivity cs);
37 qsizetype indexIn(
const QString &str, qsizetype from = 0)
const
38 {
return indexIn(QStringView(str), from); }
39 qsizetype indexIn(
const QChar *str, qsizetype length, qsizetype from = 0)
const
40 {
return indexIn(QStringView(str, length), from); }
41 qsizetype indexIn(QStringView str, qsizetype from = 0)
const;
42 QString pattern()
const;
43 QStringView patternView()
const noexcept
46 inline Qt::CaseSensitivity caseSensitivity()
const {
return q_cs; }
49 QStringMatcherPrivate *d_ptr =
nullptr;
50 Qt::CaseSensitivity q_cs = Qt::CaseSensitive;
53 uchar q_skiptable[256] = {};
QString convertToQString(QAnyStringView string)
constexpr QSpanBase(It first, qsizetype count)
static constexpr qsizetype m_size
constexpr QSpanBase(It first, End last)
constexpr bool empty() const noexcept
constexpr pointer data() const noexcept
static constexpr std::size_t extent
constexpr reverse_iterator rbegin() const noexcept
constexpr reference front() const
constexpr QSpan< T > sliced(size_type pos, size_type n) const
constexpr QSpan< T > sliced(size_type pos) const
constexpr size_type size() const noexcept
constexpr iterator end() const noexcept
constexpr const_iterator cbegin() const noexcept
constexpr QSpan< T > subspan(size_type pos, size_type n) const
constexpr const_iterator cend() const noexcept
constexpr bool isEmpty() const noexcept
constexpr reverse_iterator rend() const noexcept
constexpr QSpan< T, Count > last() const noexcept(subspan_always_succeeds_v< Count >)
constexpr QSpan< T > last(size_type n) const
constexpr const_reverse_iterator crend() const noexcept
friend QSpan< const std::byte, E==q20::dynamic_extent ? q20::dynamic_extent :E *sizeof(T)> as_bytes(QSpan s) noexcept
constexpr size_type size_bytes() const noexcept
constexpr const_reverse_iterator crbegin() const noexcept
constexpr reference operator[](size_type idx) const
constexpr QSpan< T > first(size_type n) const
constexpr reference back() const
constexpr QSpan< T > subspan(size_type pos) const
constexpr auto subspan() const noexcept(subspan_always_succeeds_v< Offset+Count >)
constexpr QSpan< T, Count > first() const noexcept(subspan_always_succeeds_v< Count >)
constexpr QSpan< T > chopped(size_type n) const
friend QSpan< std::byte, E==q20::dynamic_extent ? q20::dynamic_extent :E *sizeof(T)> as_writable_bytes(QSpan s) noexcept
constexpr iterator begin() const noexcept
constexpr auto subspan() const noexcept(subspan_always_succeeds_v< Offset >)
char32_t next(char32_t invalidAs=QChar::ReplacementCharacter)
QList< uint > convertToUcs4(QStringView string)
QByteArray convertToUtf8(QStringView string)
QByteArray convertToLocal8Bit(QStringView string)
QByteArray convertToLatin1(QStringView string)
AdlTester::size_result< Range > adl_size(Range &&r)
std::conditional_t< std::is_const_v< From >, const To &, To & > const_propagated(To &in)
AdlTester::data_result< Range > adl_data(Range &&r)
AdlTester::begin_result< Range > adl_begin(Range &&r)
constexpr bool is_qualification_conversion_v
Combined button and popup list for selecting options.
@ NormalizationCorrectionsVersionMax
static QString convertCase(T &str, QUnicodeTables::Case which)
static constexpr NormalizationCorrection uc_normalization_corrections[]
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isLower(QStringView s) noexcept
const QString & asString(const QString &s)
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isValidUtf16(QStringView s) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool equalStrings(QStringView lhs, QStringView rhs) noexcept
qsizetype findString(QStringView str, qsizetype from, QChar needle, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isRightToLeft(QStringView string) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isAscii(QLatin1StringView s) noexcept
constexpr bool isLatin1(QLatin1StringView s) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION const char16_t * qustrcasechr(QStringView str, char16_t ch) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isUpper(QStringView s) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION const char16_t * qustrchr(QStringView str, char16_t ch) noexcept
constexpr auto dynamic_extent
void qt_to_latin1_unchecked(uchar *dst, const char16_t *uc, qsizetype len)
static char16_t foldCase(char16_t ch) noexcept
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP1LSB >(const uchar *src, int index)
bool comparesEqual(const QFileInfo &lhs, const QFileInfo &rhs)
#define MAKE_ADL_TEST(what)
QSpan(const std::array< T, N > &) -> QSpan< const T, N >
#define QT_ONLY_IF_DYNAMIC_SPAN(DECL)
QSpan(T(&)[N]) -> QSpan< T, N >
QSpan(std::array< T, N > &) -> QSpan< T, N >
static bool isAscii_helper(const char16_t *&ptr, const char16_t *end)
static Int toIntegral(QStringView string, bool *ok, int base)
void qt_to_latin1(uchar *dst, const char16_t *src, qsizetype length)
Qt::strong_ordering compareThreeWay(const QByteArray &lhs, const QChar &rhs) noexcept
static void append_utf8(QString &qs, const char *cs, qsizetype len)
#define ATTRIBUTE_NO_SANITIZE
bool qt_is_ascii(const char *&ptr, const char *end) noexcept
static void replace_in_place(QString &str, QSpan< size_t > indices, qsizetype blen, QStringView after)
static bool checkCase(QStringView s, QUnicodeTables::Case c) noexcept
static void replace_helper(QString &str, QSpan< size_t > indices, qsizetype blen, QStringView after)
Q_CORE_EXPORT void qt_from_latin1(char16_t *dst, const char *str, size_t size) noexcept
static int ucstrcmp(const char16_t *a, size_t alen, const Char2 *b, size_t blen)
bool comparesEqual(const QByteArray &lhs, char16_t rhs) noexcept
Q_DECLARE_TYPEINFO(Part, Q_PRIMITIVE_TYPE)
static void removeStringImpl(QString &s, const T &needle, Qt::CaseSensitivity cs)
static bool needsReallocate(const QString &str, qsizetype newSize)
static int qArgDigitValue(QChar ch) noexcept
bool comparesEqual(const QByteArray &lhs, const QChar &rhs) noexcept
static void replace_with_copy(QString &str, QSpan< size_t > indices, qsizetype blen, QStringView after)
bool comparesEqual(const QByteArrayView &lhs, char16_t rhs) noexcept
static int ucstrncmp(const char16_t *a, const char16_t *b, size_t l)
static Q_NEVER_INLINE int ucstricmp(qsizetype alen, const char16_t *a, qsizetype blen, const char *b)
static QByteArray qt_convert_to_latin1(QStringView string)
static bool ucstreq(const char16_t *a, size_t alen, const Char2 *b)
static QList< uint > qt_convert_to_ucs4(QStringView string)
qsizetype qFindStringBoyerMoore(QStringView haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs)
static QByteArray qt_convert_to_local_8bit(QStringView string)
static LengthMod parse_length_modifier(const char *&c) noexcept
static ArgEscapeData findArgEscapes(QStringView s)
static QByteArray qt_convert_to_utf8(QStringView str)
static void qt_to_latin1_internal(uchar *dst, const char16_t *src, qsizetype length)
static void insert_helper(QString &str, qsizetype i, const T &toInsert)
static int latin1nicmp(const char *lhsChar, qsizetype lSize, const char *rhsChar, qsizetype rSize)
Qt::strong_ordering compareThreeWay(const QByteArrayView &lhs, const QChar &rhs) noexcept
static char16_t to_unicode(const char c)
Qt::strong_ordering compareThreeWay(const QByteArray &lhs, char16_t rhs) noexcept
static QString replaceArgEscapes(QStringView s, const ArgEscapeData &d, qsizetype field_width, QStringView arg, QStringView larg, QChar fillChar)
static QVarLengthArray< char16_t > qt_from_latin1_to_qvla(QLatin1StringView str)
static Q_NEVER_INLINE int ucstricmp8(const char *utf8, const char *utf8end, const QChar *utf16, const QChar *utf16end)
void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar::UnicodeVersion version, qsizetype from)
static uint parse_flag_characters(const char *&c) noexcept
static Q_NEVER_INLINE int ucstricmp(qsizetype alen, const char16_t *a, qsizetype blen, const char16_t *b)
static char16_t to_unicode(const QChar c)
QDataStream & operator>>(QDataStream &in, QString &str)
static int getEscape(const Char *uc, qsizetype *pos, qsizetype len)
static int ucstrncmp(const char16_t *a, const char *b, size_t l)
static bool can_consume(const char *&c, char ch) noexcept
static int parse_field_width(const char *&c, qsizetype size)
Qt::strong_ordering compareThreeWay(const QByteArrayView &lhs, char16_t rhs) noexcept
#define qUtf16Printable(string)
qsizetype locale_occurrences
\inmodule QtCore \reentrant
constexpr char16_t unicode() const noexcept
Converts a Latin-1 character to an 16-bit-encoded Unicode representation of the character.
constexpr QLatin1Char(char c) noexcept
Constructs a Latin-1 character for c.
static auto matcher(char ch)
static int difference(char lhs, char rhs)