Torc  0.1
Static Public Member Functions | List of all members
TorcMime Class Reference

A wrapper around QMimeDatabase(). More...

#include <torcmime.h>

Static Public Member Functions

static QString MimeTypeForData (const QByteArray &Data)
 Return a MIME type for the media described by Data. More...
 
static QString MimeTypeForData (QIODevice *Device)
 Return a MIME type for the media accessed via Device. More...
 
static QString MimeTypeForFileNameAndData (const QString &FileName, QIODevice *Device)
 Return a MIME type for the media described by FileName and Device. More...
 
static QString MimeTypeForFileNameAndData (const QString &FileName, const QByteArray &Data)
 Return a MIME type for the media described by FileName and Data. More...
 
static QString MimeTypeForName (const QString &Name)
 Return a MIME type for the file named Name. More...
 
static QString MimeTypeForUrl (const QUrl &Url)
 Return a MIME type for the media pointed to by Url. More...
 
static QStringList MimeTypeForFileName (const QString &FileName)
 Return a list of possible MIME types for the file named Name. More...
 
static QStringList ExtensionsForType (const QString &Type)
 Returns a list of known file extensions for a given top level MIME type. More...
 

Detailed Description

A wrapper around QMimeDatabase().

TorcMime provides a static interface to the database of MIME types provided by QMimeDatabase().

Note
QMimeDatabase is only available with Qt 5.0 and greater. For Qt 4.8 support, a backport of the QMimeDatabase code is included. This will be removed when Qt 5.0 becomes the minimum requirement.

Definition at line 9 of file torcmime.h.

Member Function Documentation

QStringList TorcMime::ExtensionsForType ( const QString &  Type)
static

Returns a list of known file extensions for a given top level MIME type.

For example, passing "audio" as the type will return mp3, aac, ogg, wav etc.

Definition at line 101 of file torcmime.cpp.

QString TorcMime::MimeTypeForData ( const QByteArray &  Data)
static

Return a MIME type for the media described by Data.

Definition at line 41 of file torcmime.cpp.

QString TorcMime::MimeTypeForData ( QIODevice *  Device)
static

Return a MIME type for the media accessed via Device.

Definition at line 47 of file torcmime.cpp.

QStringList TorcMime::MimeTypeForFileName ( const QString &  FileName)
static

Return a list of possible MIME types for the file named Name.

Definition at line 85 of file torcmime.cpp.

QString TorcMime::MimeTypeForFileNameAndData ( const QString &  FileName,
QIODevice *  Device 
)
static

Return a MIME type for the media described by FileName and Device.

Definition at line 55 of file torcmime.cpp.

QString TorcMime::MimeTypeForFileNameAndData ( const QString &  FileName,
const QByteArray &  Data 
)
static

Return a MIME type for the media described by FileName and Data.

Definition at line 64 of file torcmime.cpp.

QString TorcMime::MimeTypeForName ( const QString &  Name)
static

Return a MIME type for the file named Name.

Definition at line 73 of file torcmime.cpp.

QString TorcMime::MimeTypeForUrl ( const QUrl &  Url)
static

Return a MIME type for the media pointed to by Url.

Definition at line 79 of file torcmime.cpp.


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