MythTV  master
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
MythMimeType Class Reference

#include <libmythbase/http/mythmimetype.h>

Collaboration diagram for MythMimeType:
[legend]

Public Member Functions

 MythMimeType ()=default
 
bool operator== (const MythMimeType &Other) const
 
bool IsValid () const
 
QString Name () const
 
QString Suffix () const
 Return the preferred filename suffix used by this type. More...
 
QStringList Aliases () const
 
bool Inherits (const QString &Name) const
 Does this type inherit from the given type. More...
 
void SetAlias (const QString &Name)
 

Protected Member Functions

 MythMimeType (const QMimeType &MimeType)
 
 MythMimeType (QString Name, QString Suffix, MimeMagic Magic, uint Weight, QStringList Inherits)
 

Protected Attributes

bool m_valid { false }
 
QString m_name
 
QString m_alias
 
QString m_suffix
 
MimeMagic m_magic { std::monostate() }
 
uint m_weight { 0 }
 
QStringList m_inherits
 
bool m_qtType { false }
 
QMimeType m_mime
 

Friends

class MythMimeDatabase
 
class MythMimeDatabasePriv
 

Detailed Description

Definition at line 16 of file mythmimetype.h.

Constructor & Destructor Documentation

◆ MythMimeType() [1/3]

MythMimeType::MythMimeType ( )
default

◆ MythMimeType() [2/3]

MythMimeType::MythMimeType ( const QMimeType &  MimeType)
protected

Definition at line 4 of file mythmimetype.cpp.

◆ MythMimeType() [3/3]

MythMimeType::MythMimeType ( QString  Name,
QString  Suffix,
MimeMagic  Magic,
uint  Weight,
QStringList  Inherits 
)
protected

Definition at line 10 of file mythmimetype.cpp.

Member Function Documentation

◆ operator==()

bool MythMimeType::operator== ( const MythMimeType Other) const

Definition at line 21 of file mythmimetype.cpp.

◆ IsValid()

bool MythMimeType::IsValid ( ) const

◆ Name()

QString MythMimeType::Name ( ) const

◆ Suffix()

QString MythMimeType::Suffix ( ) const

Return the preferred filename suffix used by this type.

Note
For consistency with QMimeType this returns the suffix alone (e.g. 'png') but internally it is is stored as '.png' to simplify matching.
We always use a lowercase suffix.

Definition at line 51 of file mythmimetype.cpp.

◆ Aliases()

QStringList MythMimeType::Aliases ( ) const

Definition at line 58 of file mythmimetype.cpp.

Referenced by MythSerialiser::Serialise().

◆ Inherits()

bool MythMimeType::Inherits ( const QString &  Name) const

Does this type inherit from the given type.

This is a simple string match (i.e. much simpler that the Qt version).

Definition at line 69 of file mythmimetype.cpp.

Referenced by MythHTTP::GetContentType().

◆ SetAlias()

void MythMimeType::SetAlias ( const QString &  Name)

Definition at line 40 of file mythmimetype.cpp.

Friends And Related Function Documentation

◆ MythMimeDatabase

friend class MythMimeDatabase
friend

Definition at line 18 of file mythmimetype.h.

◆ MythMimeDatabasePriv

friend class MythMimeDatabasePriv
friend

Definition at line 19 of file mythmimetype.h.

Member Data Documentation

◆ m_valid

bool MythMimeType::m_valid { false }
protected

Definition at line 37 of file mythmimetype.h.

Referenced by IsValid().

◆ m_name

QString MythMimeType::m_name
protected

Definition at line 38 of file mythmimetype.h.

Referenced by Aliases(), Name(), and operator==().

◆ m_alias

QString MythMimeType::m_alias
protected

Definition at line 39 of file mythmimetype.h.

Referenced by Name(), and SetAlias().

◆ m_suffix

QString MythMimeType::m_suffix
protected

Definition at line 40 of file mythmimetype.h.

Referenced by Suffix().

◆ m_magic

MimeMagic MythMimeType::m_magic { std::monostate() }
protected

Definition at line 41 of file mythmimetype.h.

◆ m_weight

uint MythMimeType::m_weight { 0 }
protected

Definition at line 42 of file mythmimetype.h.

Referenced by MythMimeDatabasePriv::MagicSearch().

◆ m_inherits

QStringList MythMimeType::m_inherits
protected

Definition at line 43 of file mythmimetype.h.

Referenced by Inherits().

◆ m_qtType

bool MythMimeType::m_qtType { false }
protected

Definition at line 44 of file mythmimetype.h.

Referenced by Aliases(), Inherits(), Name(), and Suffix().

◆ m_mime

QMimeType MythMimeType::m_mime
protected

Definition at line 45 of file mythmimetype.h.

Referenced by Aliases(), Inherits(), Name(), and Suffix().


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