Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QMimeGlobPattern Class Reference

The QMimeGlobPattern class contains the glob pattern for file names for MIME type matching. More...

#include <qmimeglobpattern_p.h>

+ Collaboration diagram for QMimeGlobPattern:

Public Member Functions

 QMimeGlobPattern (const QString &thePattern, const QString &theMimeType, unsigned theWeight=DefaultWeight, Qt::CaseSensitivity s=Qt::CaseInsensitive)
 
void swap (QMimeGlobPattern &other) noexcept
 
bool matchFileName (const QString &inputFileName) const
 
const QStringpattern () const
 
unsigned weight () const
 
const QStringmimeType () const
 
bool isCaseSensitive () const
 

Static Public Attributes

static const unsigned MaxWeight = 100
 
static const unsigned DefaultWeight = 50
 
static const unsigned MinWeight = 1
 

Detailed Description

The QMimeGlobPattern class contains the glob pattern for file names for MIME type matching.

\inmodule QtCore

See also
QMimeType, QMimeDatabase, QMimeMagicRuleMatcher, QMimeMagicRule

Definition at line 41 of file qmimeglobpattern_p.h.

Constructor & Destructor Documentation

◆ QMimeGlobPattern()

QMimeGlobPattern::QMimeGlobPattern ( const QString & thePattern,
const QString & theMimeType,
unsigned theWeight = DefaultWeight,
Qt::CaseSensitivity s = Qt::CaseInsensitive )
inlineexplicit

Definition at line 48 of file qmimeglobpattern_p.h.

Member Function Documentation

◆ isCaseSensitive()

bool QMimeGlobPattern::isCaseSensitive ( ) const
inline

Definition at line 71 of file qmimeglobpattern_p.h.

References Qt::CaseSensitive.

◆ matchFileName()

bool QMimeGlobPattern::matchFileName ( const QString & inputFileName) const

Definition at line 104 of file qmimeglobpattern.cpp.

References c2, Qt::CaseInsensitive, fileName, QRegularExpression::fromWildcard(), QStringView::mid(), rx(), QString::size(), QString::toLower(), and QString::unicode().

+ Here is the call graph for this function:

◆ mimeType()

const QString & QMimeGlobPattern::mimeType ( ) const
inline

Definition at line 70 of file qmimeglobpattern_p.h.

◆ pattern()

const QString & QMimeGlobPattern::pattern ( ) const
inline

Definition at line 68 of file qmimeglobpattern_p.h.

◆ swap()

void QMimeGlobPattern::swap ( QMimeGlobPattern & other)
inlinenoexcept

Definition at line 57 of file qmimeglobpattern_p.h.

References other(), and qSwap().

+ Here is the call graph for this function:

◆ weight()

unsigned QMimeGlobPattern::weight ( ) const
inline

Definition at line 69 of file qmimeglobpattern_p.h.

Member Data Documentation

◆ DefaultWeight

const unsigned QMimeGlobPattern::DefaultWeight = 50
static

Definition at line 45 of file qmimeglobpattern_p.h.

Referenced by QMimeTypeParserBase::parse().

◆ MaxWeight

const unsigned QMimeGlobPattern::MaxWeight = 100
static

Definition at line 44 of file qmimeglobpattern_p.h.

◆ MinWeight

const unsigned QMimeGlobPattern::MinWeight = 1
static

Definition at line 46 of file qmimeglobpattern_p.h.


The documentation for this class was generated from the following files: