MythTV
master
|
A wrapper around QMimeDatabase that supports additional mime types. More...
#include <libmythbase/http/mythmimedatabase.h>
Public Member Functions | |
MythMimeDatabase () | |
Static Public Member Functions | |
static MythMimeTypes | AllTypes () |
Return a vector containing all of the known types (both Qt and MythTV) More... | |
static MythMimeType | MimeTypeForName (const QString &Name) |
Return a mime type that matches the given name. More... | |
static QString | SuffixForFileName (const QString &FileName) |
Return the preferred suffix for the given filename. More... | |
static MythMimeTypes | MimeTypesForFileName (const QString &FileName) |
Return a vector of mime types that match the given filename. More... | |
static MythMimeType | MimeTypeForFileNameAndData (const QString &FileName, const QByteArray &Data) |
Return a mime type for the given FileName and data. More... | |
static MythMimeType | MimeTypeForFileNameAndData (const QString &FileName, QIODevice *Device) |
Private Attributes | |
MythMimeDatabasePriv * | m_priv |
A wrapper around QMimeDatabase that supports additional mime types.
QMimeDatabase by default uses a list of MIME types provided by Freedesktop.org. Unfortunately it does not include a few MIME types (most notably the Apple plist types) and we cannot inherit from either QMimeDatabase or QMimeType to add new types. Qt does have a mechanism for adding additional types by extending the search path it uses. So for example, on unix systems, we could add our custom types to /usr/local/share/mythtv/mime/packages and add that path to XDG_DATA_DIRS (and this does work). It is not clear however how this would work on other platforms. On Android, for example, the 'GenericDataLocation' in QStandardPaths defaults to the USER directory.
Definition at line 10 of file mythmimedatabase.h.
MythMimeDatabase::MythMimeDatabase | ( | ) |
Definition at line 158 of file mythmimedatabase.cpp.
|
static |
Return a vector containing all of the known types (both Qt and MythTV)
Definition at line 165 of file mythmimedatabase.cpp.
|
static |
Return a mime type that matches the given name.
Definition at line 201 of file mythmimedatabase.cpp.
Referenced by MythHTTPEncoding::GetContentType(), MythHTTPEncoding::GetMimeType(), MythWSDL::GetWSDL(), MythXSD::GetXSD(), and MythSerialiser::Serialise().
|
static |
Return the preferred suffix for the given filename.
Definition at line 187 of file mythmimedatabase.cpp.
Referenced by MythHTTPEncoding::GetMimeType().
|
static |
Return a vector of mime types that match the given filename.
Definition at line 175 of file mythmimedatabase.cpp.
Referenced by MythHTTPEncoding::GetMimeType().
|
static |
Return a mime type for the given FileName and data.
As for QMimeDatabase, this method will default to using the file name where it is unambiguous and only probe the given data when further help is needed.
MythTV types are probed first.
Definition at line 217 of file mythmimedatabase.cpp.
Referenced by MythHTTPEncoding::GetMimeType().
|
static |
Definition at line 225 of file mythmimedatabase.cpp.
|
private |
Definition at line 23 of file mythmimedatabase.h.