All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Radiant::MimeManager Class Reference

This class keeps track of matching file extensions to mime types. More...

#include <Radiant/Mime.hpp>

Inheritance diagram for Radiant::MimeManager:
MultiWidgets::Mime

Public Member Functions

QStringList extensionsByMimeRegexp (const QString &mime) const
 Get a list of file extensions that match the given mime type. More...
 
void insertExtension (const QString &extension, const MimeType &type)
 Add or replace a shared mapping from file extension to mime type. More...
 
const MimeTypemimeTypeByExtension (const QString &ext) const
 Get the mime type by filename extension. More...
 

Static Public Member Functions

static void insertSharedExtension (const QString &extension, const MimeType &type)
 Add or replace a shared mapping from file extension to mime type. More...
 

Protected Types

typedef std::map< QString,
MimeType
ExtensionMap
 Map from file extensions to mime types.
 

Protected Attributes

ExtensionMap m_extensions
 Extension map specific for this instance.
 

Static Protected Attributes

static ExtensionMap s_sharedExtensions
 Global extension map shared by all instances.
 

Detailed Description

This class keeps track of matching file extensions to mime types.

Member Function Documentation

QStringList Radiant::MimeManager::extensionsByMimeRegexp ( const QString &  mime) const

Get a list of file extensions that match the given mime type.

Parameters
mimemime type to query
Returns
list of file extensions
void Radiant::MimeManager::insertExtension ( const QString &  extension,
const MimeType type 
)

Add or replace a shared mapping from file extension to mime type.

Parameters
extensionfilename extension
typemime type
static void Radiant::MimeManager::insertSharedExtension ( const QString &  extension,
const MimeType type 
)
static

Add or replace a shared mapping from file extension to mime type.

Parameters
extensionfile extension
typemime type
const MimeType* Radiant::MimeManager::mimeTypeByExtension ( const QString &  ext) const

Get the mime type by filename extension.

Parameters
extfilename extension
Returns
The matching MimeType, or NULL if not found