Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::IMimeTypeProvider Struct Referenceabstract

Service interface for querying all registered mime-types. More...

#include <mitkIMimeTypeProvider.h>

Inheritance diagram for mitk::IMimeTypeProvider:

Public Member Functions

virtual ~IMimeTypeProvider ()
 
virtual std::vector< MimeType > GetMimeTypes () const =0
 Get all registered mime-types. More...
 
virtual std::vector< MimeType > GetMimeTypesForFile (const std::string &filePath) const =0
 Get all mime-types that apply to the given file path. More...
 
virtual std::vector< MimeType > GetMimeTypesForCategory (const std::string &category) const =0
 Get all mime-types in a specific category. More...
 
virtual MimeType GetMimeTypeForName (const std::string &name) const =0
 Get the mime-type registered under the given name. More...
 
virtual std::vector< std::string > GetCategories () const =0
 Get a sorted and unique list of all registered mime-type categories. More...
 

Detailed Description

Service interface for querying all registered mime-types.

Mime-types are added to the system by registering service objects of type CustomMimeType. The registered mime-types can be queried either through direct look-ups in the service registry or by calling the methods of this service interface.

This service interface also allows inferring the mime-type of a file on the file system. The heuristics for inferring the actual mime-type is implementation specific.

Note
This is a core service and can be obtained via CoreServices::GetMimeTypeProvider().
See also
CustomMimeType
MimeType
CoreServices::GetMimeTypeProvider()

Definition at line 49 of file mitkIMimeTypeProvider.h.

Constructor & Destructor Documentation

◆ ~IMimeTypeProvider()

virtual mitk::IMimeTypeProvider::~IMimeTypeProvider ( )
virtual

Member Function Documentation

◆ GetCategories()

virtual std::vector<std::string> mitk::IMimeTypeProvider::GetCategories ( ) const
pure virtual

Get a sorted and unique list of all registered mime-type categories.

Returns
A sorted, unique vector of category strings.

Implemented in mitk::MimeTypeProvider.

◆ GetMimeTypeForName()

virtual MimeType mitk::IMimeTypeProvider::GetMimeTypeForName ( const std::string &  name) const
pure virtual

Get the mime-type registered under the given name.

Parameters
[in]nameThe unique mime-type name (e.g. "application/vnd.mitk.image.nrrd").
Returns
The matching MimeType, or an invalid MimeType if not found.

Implemented in mitk::MimeTypeProvider.

◆ GetMimeTypes()

virtual std::vector<MimeType> mitk::IMimeTypeProvider::GetMimeTypes ( ) const
pure virtual

Get all registered mime-types.

Returns
A vector of all registered MimeType objects.

Implemented in mitk::MimeTypeProvider.

◆ GetMimeTypesForCategory()

virtual std::vector<MimeType> mitk::IMimeTypeProvider::GetMimeTypesForCategory ( const std::string &  category) const
pure virtual

Get all mime-types in a specific category.

Parameters
[in]categoryThe category string (e.g. "Images", "Surfaces").
Returns
A vector of MimeType objects belonging to the given category.

Implemented in mitk::MimeTypeProvider.

◆ GetMimeTypesForFile()

virtual std::vector<MimeType> mitk::IMimeTypeProvider::GetMimeTypesForFile ( const std::string &  filePath) const
pure virtual

Get all mime-types that apply to the given file path.

Parameters
[in]filePathThe absolute file path to match against.
Returns
A vector of matching MimeType objects, sorted by rank (highest first).

Implemented in mitk::MimeTypeProvider.


The documentation for this struct was generated from the following file: