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
QMimeTypeParserBase Class Referenceabstract

\inmodule QtCore More...

#include <qmimetypeparser_p.h>

+ Inheritance diagram for QMimeTypeParserBase:
+ Collaboration diagram for QMimeTypeParserBase:

Public Member Functions

 QMimeTypeParserBase ()
 
virtual ~QMimeTypeParserBase ()
 
bool parse (QIODevice *dev, const QString &fileName, QString *errorMessage)
 

Static Public Member Functions

static bool parseNumber (QStringView n, int *target, QString *errorMessage)
 

Protected Member Functions

virtual bool process (const QMimeTypeXMLData &t, QString *errorMessage)=0
 
virtual bool process (const QMimeGlobPattern &t, QString *errorMessage)=0
 
virtual void processParent (const QString &child, const QString &parent)=0
 
virtual void processAlias (const QString &alias, const QString &name)=0
 
virtual void processMagicMatcher (const QMimeMagicRuleMatcher &matcher)=0
 

Detailed Description

\inmodule QtCore

The QMimeTypeParserBase class parses for a sequence of <mime-type> in a generic way.

Calls abstract handler function process for QMimeType it finds.

See also
QMimeDatabase, QMimeMagicRuleMatcher, MagicRule, MagicStringRule, MagicByteRule, GlobPattern
QMimeTypeParser

Definition at line 44 of file qmimetypeparser_p.h.

Constructor & Destructor Documentation

◆ QMimeTypeParserBase()

QMimeTypeParserBase::QMimeTypeParserBase ( )
inline

Definition at line 49 of file qmimetypeparser_p.h.

◆ ~QMimeTypeParserBase()

virtual QMimeTypeParserBase::~QMimeTypeParserBase ( )
inlinevirtual

Definition at line 50 of file qmimetypeparser_p.h.

Member Function Documentation

◆ parse()

bool QMimeTypeParserBase::parse ( QIODevice * dev,
const QString & fileName,
QString * errorMessage )

Definition at line 165 of file qmimetypeparser.cpp.

References QString::asprintf(), Qt::CaseInsensitive, Qt::CaseSensitive, caseSensitiveAttributeC, QMimeGlobPattern::DefaultWeight, errorMessage(), QImageReader::errorString(), fileName, QString::fromLatin1(), QString::isEmpty(), localeAttributeC, magicTagC, matchTagC, mimeTypeAttributeC, mimeTypeTagC, nameAttributeC, parseNumber(), patternAttributeC, priorityAttributeC, process(), processAlias(), processMagicMatcher(), processParent(), Q_ASSERT, Q_UNLIKELY, Q_UNUSED, QStringLiteral, qUtf16Printable, qWarning, QString::toInt(), toString(), and weightAttributeC.

Referenced by QMimeXMLProvider::load().

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

◆ parseNumber()

bool QMimeTypeParserBase::parseNumber ( QStringView n,
int * target,
QString * errorMessage )
static

Definition at line 130 of file qmimetypeparser.cpp.

References errorMessage(), ok, and Q_UNLIKELY.

Referenced by QMimeMagicRule::QMimeMagicRule(), and parse().

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

◆ process() [1/2]

virtual bool QMimeTypeParserBase::process ( const QMimeGlobPattern & t,
QString * errorMessage )
protectedpure virtual

Implemented in QMimeTypeParser.

◆ process() [2/2]

virtual bool QMimeTypeParserBase::process ( const QMimeTypeXMLData & t,
QString * errorMessage )
protectedpure virtual

Implemented in QMimeTypeParser.

Referenced by parse().

+ Here is the caller graph for this function:

◆ processAlias()

virtual void QMimeTypeParserBase::processAlias ( const QString & alias,
const QString & name )
protectedpure virtual

Implemented in QMimeTypeParser.

Referenced by parse().

+ Here is the caller graph for this function:

◆ processMagicMatcher()

virtual void QMimeTypeParserBase::processMagicMatcher ( const QMimeMagicRuleMatcher & matcher)
protectedpure virtual

Implemented in QMimeTypeParser.

Referenced by parse().

+ Here is the caller graph for this function:

◆ processParent()

virtual void QMimeTypeParserBase::processParent ( const QString & child,
const QString & parent )
protectedpure virtual

Implemented in QMimeTypeParser.

Referenced by parse().

+ Here is the caller graph for this function:

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