Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 Types

enum  PatternType {
  SuffixPattern , PrefixPattern , LiteralPattern , VdrPattern ,
  AnimPattern , OtherPattern
}

Public Member Functions

 QMimeGlobPattern (const QString &thePattern, const QString &theMimeType, unsigned theWeight=DefaultWeight, Qt::CaseSensitivity ss=Qt::CaseInsensitive)
void swap (QMimeGlobPattern &other) noexcept
bool matchFileName (const QString &fileName) const
const QString & pattern () const
unsigned weight () const
const QString & mimeType () const
bool isCaseSensitive () const

Static Public Member Functions

static PatternType detectPatternType (QLatin1StringView patternpattern)
template<typename Pattern>
static bool matchWithoutRegularExpression (PatternType patternType, Pattern patternpattern, QStringView fileName, Qt::CaseSensitivity cs)

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 46 of file qmimeglobpattern_p.h.

Member Enumeration Documentation

◆ PatternType

Enumerator
SuffixPattern 
PrefixPattern 
LiteralPattern 
VdrPattern 
AnimPattern 
OtherPattern 

Definition at line 87 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 53 of file qmimeglobpattern_p.h.

References QMimeGlobPattern().

Referenced by QMimeGlobPattern().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ detectPatternType()

QMimeGlobPattern::PatternType QMimeGlobPattern::detectPatternType ( QLatin1StringView pattern)
static

Definition at line 98 of file qmimeglobpattern.cpp.

◆ isCaseSensitive()

bool QMimeGlobPattern::isCaseSensitive ( ) const
inline

Definition at line 85 of file qmimeglobpattern_p.h.

◆ matchFileName()

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

Definition at line 159 of file qmimeglobpattern.cpp.

◆ matchWithoutRegularExpression()

template<typename Pattern>
template bool QMimeGlobPattern::matchWithoutRegularExpression< QLatin1StringView > ( PatternType patternType,
Pattern pattern,
QStringView fileName,
Qt::CaseSensitivity cs )
static

◆ mimeType()

const QString & QMimeGlobPattern::mimeType ( ) const
inline

Definition at line 84 of file qmimeglobpattern_p.h.

◆ pattern()

const QString & QMimeGlobPattern::pattern ( ) const
inline

Definition at line 82 of file qmimeglobpattern_p.h.

◆ swap()

void QMimeGlobPattern::swap ( QMimeGlobPattern & other)
inlinenoexcept

Definition at line 68 of file qmimeglobpattern_p.h.

◆ weight()

unsigned QMimeGlobPattern::weight ( ) const
inline

Definition at line 83 of file qmimeglobpattern_p.h.

Referenced by QMimeAllGlobPatterns::addGlob().

Here is the caller graph for this function:

Member Data Documentation

◆ DefaultWeight

const unsigned QMimeGlobPattern::DefaultWeight = 50
static

Definition at line 50 of file qmimeglobpattern_p.h.

◆ MaxWeight

const unsigned QMimeGlobPattern::MaxWeight = 100
static

Definition at line 49 of file qmimeglobpattern_p.h.

◆ MinWeight

const unsigned QMimeGlobPattern::MinWeight = 1
static

Definition at line 51 of file qmimeglobpattern_p.h.


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