Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitk::CustomMimeType Class Reference

The CustomMimeType class represents a custom mime-type which may be registered as a service object. It should only be used for mime-type registration, see also mitk::MimeType. More...

#include <mitkCustomMimeType.h>

Inheritance diagram for mitk::CustomMimeType:

Public Member Functions

 CustomMimeType ()
 
 CustomMimeType (const std::string &name)
 
 CustomMimeType (const CustomMimeType &other)
 
 CustomMimeType (const MimeType &other)
 
virtual ~CustomMimeType ()
 
CustomMimeTypeoperator= (const CustomMimeType &other)
 
CustomMimeTypeoperator= (const MimeType &other)
 
std::string GetName () const
 Returns the unique name for the MimeType. More...
 
std::string GetCategory () const
 Returns the human-readable Category of the mime-type. Allows grouping of similar mime-types (like Surfaces) More...
 
std::vector< std::string > GetExtensions () const
 Returns all extensions that this MimeType can handle. More...
 
std::string GetComment () const
 Returns the Human readable comment of the MimeType, a string that describes its unique role. More...
 
virtual bool AppliesTo (const std::string &path) const
 Checks if the MimeType can handle file at the given location. More...
 
bool MatchesExtension (const std::string &path) const
 Checks if the MimeType can handle the extension of the given path. More...
 
std::string GetExtension (const std::string &path) const
 Provides the first matching extension. More...
 
std::string GetFilenameWithoutExtension (const std::string &path) const
 Provides the filename minus the extension. More...
 
void SetName (const std::string &name)
 
void SetCategory (const std::string &category)
 
void SetExtension (const std::string &extension)
 
void AddExtension (const std::string &extension)
 
void SetComment (const std::string &comment)
 
void Swap (CustomMimeType &r)
 
virtual CustomMimeTypeClone () const
 

Detailed Description

The CustomMimeType class represents a custom mime-type which may be registered as a service object. It should only be used for mime-type registration, see also mitk::MimeType.

Instances of this class are usually created and registered as a service. They act as meta data information to allow the linking of files to reader and writer. They write files to specific IFileReader instances and provide data format meta-data for selecting compatible IFileWriter instances. mirk::CustomMimetype should only be used to register mime-types. All other interaction should happen through mitk::MimeTypeProvider, from which registered mimetypes can be pulled. mitk::MimeType provides a safe and memory-managed way of interacting with Mimetypes.

Definition at line 44 of file mitkCustomMimeType.h.

Constructor & Destructor Documentation

◆ CustomMimeType() [1/4]

mitk::CustomMimeType::CustomMimeType ( )

◆ CustomMimeType() [2/4]

mitk::CustomMimeType::CustomMimeType ( const std::string &  name)

◆ CustomMimeType() [3/4]

mitk::CustomMimeType::CustomMimeType ( const CustomMimeType other)

◆ CustomMimeType() [4/4]

mitk::CustomMimeType::CustomMimeType ( const MimeType other)
explicit

◆ ~CustomMimeType()

virtual mitk::CustomMimeType::~CustomMimeType ( )
virtual

Member Function Documentation

◆ AddExtension()

void mitk::CustomMimeType::AddExtension ( const std::string &  extension)

◆ AppliesTo()

◆ Clone()

◆ GetCategory()

std::string mitk::CustomMimeType::GetCategory ( ) const

Returns the human-readable Category of the mime-type. Allows grouping of similar mime-types (like Surfaces)

◆ GetComment()

std::string mitk::CustomMimeType::GetComment ( ) const

Returns the Human readable comment of the MimeType, a string that describes its unique role.

◆ GetExtension()

std::string mitk::CustomMimeType::GetExtension ( const std::string &  path) const

Provides the first matching extension.

Checks whether any of its extensions are present at the end of the provided path. Returns the first found one.

◆ GetExtensions()

std::vector<std::string> mitk::CustomMimeType::GetExtensions ( ) const

Returns all extensions that this MimeType can handle.

◆ GetFilenameWithoutExtension()

std::string mitk::CustomMimeType::GetFilenameWithoutExtension ( const std::string &  path) const

Provides the filename minus the extension.

Checks whether any of its extensions are present at the end of the provided path. Returns the filename without that extension and without the directory.

◆ GetName()

std::string mitk::CustomMimeType::GetName ( ) const

Returns the unique name for the MimeType.

◆ MatchesExtension()

bool mitk::CustomMimeType::MatchesExtension ( const std::string &  path) const

Checks if the MimeType can handle the extension of the given path.

This function exclusively looks a the given string

◆ operator=() [1/2]

CustomMimeType& mitk::CustomMimeType::operator= ( const CustomMimeType other)

◆ operator=() [2/2]

CustomMimeType& mitk::CustomMimeType::operator= ( const MimeType other)

◆ SetCategory()

void mitk::CustomMimeType::SetCategory ( const std::string &  category)

◆ SetComment()

void mitk::CustomMimeType::SetComment ( const std::string &  comment)

◆ SetExtension()

void mitk::CustomMimeType::SetExtension ( const std::string &  extension)

◆ SetName()

void mitk::CustomMimeType::SetName ( const std::string &  name)

◆ Swap()

void mitk::CustomMimeType::Swap ( CustomMimeType r)

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