Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QMimeMagicRule Class Reference

#include <qmimemagicrule_p.h>

+ Collaboration diagram for QMimeMagicRule:

Public Types

enum  Type {
  Invalid = 0 , String , Host16 , Host32 ,
  Big16 , Big32 , Little16 , Little32 ,
  Byte
}
 

Public Member Functions

 QMimeMagicRule (const QString &typeStr, const QByteArray &value, const QString &offsets, const QByteArray &mask, QString *errorString)
 
void swap (QMimeMagicRule &other) noexcept
 
bool operator== (const QMimeMagicRule &other) const
 
Type type () const
 
QByteArray value () const
 
int startPos () const
 
int endPos () const
 
QByteArray mask () const
 
bool isValid () const
 
bool matches (const QByteArray &data) const
 

Static Public Member Functions

static Type type (const QByteArray &type)
 
static QByteArray typeName (Type type)
 
static bool matchSubstring (const char *dataPtr, qsizetype dataSize, int rangeStart, int rangeLength, qsizetype valueLength, const char *valueData, const char *mask)
 

Public Attributes

QList< QMimeMagicRulem_subMatches
 

Detailed Description

Definition at line 28 of file qmimemagicrule_p.h.

Member Enumeration Documentation

◆ Type

Enumerator
Invalid 
String 
Host16 
Host32 
Big16 
Big32 
Little16 
Little32 
Byte 

Definition at line 31 of file qmimemagicrule_p.h.

Constructor & Destructor Documentation

◆ QMimeMagicRule()

QMimeMagicRule::QMimeMagicRule ( const QString typeStr,
const QByteArray value,
const QString offsets,
const QByteArray mask,
QString errorString 
)

Member Function Documentation

◆ endPos()

int QMimeMagicRule::endPos ( ) const
inline

Definition at line 54 of file qmimemagicrule_p.h.

◆ isValid()

bool QMimeMagicRule::isValid ( ) const
inline

Definition at line 57 of file qmimemagicrule_p.h.

◆ mask()

QByteArray QMimeMagicRule::mask ( ) const

Definition at line 296 of file qmimemagicrule.cpp.

References String, and QByteArray::toHex().

+ Here is the call graph for this function:

◆ matches()

bool QMimeMagicRule::matches ( const QByteArray data) const

Definition at line 306 of file qmimemagicrule.cpp.

References QList< T >::begin(), QList< T >::end(), QList< T >::isEmpty(), it, m_subMatches, and ok.

+ Here is the call graph for this function:

◆ matchSubstring()

bool QMimeMagicRule::matchSubstring ( const char *  dataPtr,
qsizetype  dataSize,
int  rangeStart,
int  rangeLength,
qsizetype  valueLength,
const char *  valueData,
const char *  mask 
)
static

Definition at line 64 of file qmimemagicrule.cpp.

References d, i, and qMin().

+ Here is the call graph for this function:

◆ operator==()

bool QMimeMagicRule::operator== ( const QMimeMagicRule other) const

Definition at line 50 of file qmimemagicrule.cpp.

References other().

+ Here is the call graph for this function:

◆ startPos()

int QMimeMagicRule::startPos ( ) const
inline

Definition at line 53 of file qmimemagicrule_p.h.

◆ swap()

void QMimeMagicRule::swap ( QMimeMagicRule other)
inlinenoexcept

Definition at line 36 of file qmimemagicrule_p.h.

References other(), and qSwap().

+ Here is the call graph for this function:

◆ type() [1/2]

Type QMimeMagicRule::type ( ) const
inline

Definition at line 51 of file qmimemagicrule_p.h.

◆ type() [2/2]

QMimeMagicRule::Type QMimeMagicRule::type ( const QByteArray type)
static

Definition at line 36 of file qmimemagicrule.cpp.

References Byte, i, Invalid, magicRuleTypes, and String.

◆ typeName()

QByteArray QMimeMagicRule::typeName ( Type  type)
static

Definition at line 45 of file qmimemagicrule.cpp.

References magicRuleTypes.

◆ value()

QByteArray QMimeMagicRule::value ( ) const
inline

Definition at line 52 of file qmimemagicrule_p.h.

Member Data Documentation

◆ m_subMatches

QList<QMimeMagicRule> QMimeMagicRule::m_subMatches

Definition at line 61 of file qmimemagicrule_p.h.

Referenced by matches().


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