4#ifndef QMIMEGLOBPATTERN_P_H
5#define QMIMEGLOBPATTERN_P_H
18#include <QtCore/private/qglobal_p.h>
22#include <QtCore/qstringlist.h>
23#include <QtCore/qhash.h>
47 m_pattern(
s ==
Qt::CaseInsensitive ? thePattern.toLower() : thePattern),
48 m_mimeType(theMimeType),
51 m_patternType(detectPatternType(m_pattern))
60 qSwap(m_caseSensitivity,
other.m_caseSensitivity);
67 inline unsigned weight()
const {
return m_weight; }
86 PatternType m_patternType;
96 const const_iterator myend =
end();
97 for (;
it != myend; ++
it)
111 removeIf(isMimeTypeEqual);
Result of the globs parsing, as data structures ready for efficient MIME type matching.
void addGlob(const QMimeGlobPattern &glob)
PatternsMap m_fastPatterns
void removeMimeType(const QString &mimeType)
void matchingGlobs(const QString &fileName, QMimeGlobMatchResult &result) const
QHash< QString, QStringList > PatternsMap
QMimeGlobPatternList m_highWeightGlobs
QMimeGlobPatternList m_lowWeightGlobs
void removeMimeType(const QString &mimeType)
"noglobs" is very rare occurrence, so it's ok if it's slow
bool hasPattern(const QString &mimeType, const QString &pattern) const
The QMimeGlobPattern class contains the glob pattern for file names for MIME type matching.
static const unsigned MinWeight
QMimeGlobPattern(const QString &thePattern, const QString &theMimeType, unsigned theWeight=DefaultWeight, Qt::CaseSensitivity s=Qt::CaseInsensitive)
static const unsigned DefaultWeight
void swap(QMimeGlobPattern &other) noexcept
const QString & mimeType() const
static const unsigned MaxWeight
const QString & pattern() const
bool matchFileName(const QString &inputFileName) const
bool isCaseSensitive() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
QSet< QString >::iterator it
Combined button and popup list for selecting options.
GLuint GLuint GLfloat weight
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
#define QT_REQUIRE_CONFIG(feature)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
The QMimeGlobMatchResult class accumulates results from glob matching.
void addMatch(const QString &mimeType, int weight, const QString &pattern, qsizetype knownSuffixLength=0)
qsizetype m_matchingPatternLength
QStringList m_allMatchingMimeTypes
qsizetype m_knownSuffixLength
QStringList m_matchingMimeTypes