|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
A custom mime-type that can be registered as a service object. More...
#include <mitkCustomMimeType.h>

Public Member Functions | |
| CustomMimeType () | |
| Construct a default CustomMimeType with an empty name. More... | |
| CustomMimeType (const std::string &name) | |
| Construct a CustomMimeType with the given unique name. More... | |
| CustomMimeType (const CustomMimeType &other) | |
| Copy constructor. More... | |
| CustomMimeType (const MimeType &other) | |
| Construct from an immutable MimeType wrapper. More... | |
| virtual | ~CustomMimeType () |
| CustomMimeType & | operator= (const CustomMimeType &other) |
| Copy assignment operator. More... | |
| CustomMimeType & | operator= (const MimeType &other) |
| Assignment from an immutable MimeType wrapper. More... | |
| std::string | GetName () const |
| Get the unique name for this mime-type. More... | |
| std::string | GetCategory () const |
| Get the human-readable category of this mime-type. More... | |
| std::vector< std::string > | GetExtensions () const |
| Get all file extensions this mime-type can handle. More... | |
| std::string | GetComment () const |
| Get a human-readable description of this mime-type. More... | |
| virtual bool | AppliesTo (const std::string &path) const |
| Check whether this mime-type can handle the file at the given path. More... | |
| bool | MatchesExtension (const std::string &path) const |
| Check whether the file extension of the given path matches this mime-type. More... | |
| std::string | GetExtension (const std::string &path) const |
| Get the first matching extension found at the end of the given path. More... | |
| std::string | GetFilenameWithoutExtension (const std::string &path) const |
| Get the filename from the given path, without the matching extension. More... | |
| void | SetName (const std::string &name) |
| Set the unique name of this mime-type. More... | |
| void | SetCategory (const std::string &category) |
| Set the category for grouping this mime-type. More... | |
| void | SetExtension (const std::string &extension) |
| Set a single file extension, replacing all existing extensions. More... | |
| void | AddExtension (const std::string &extension) |
| Add a file extension to the list if not already present (case-insensitive). More... | |
| void | SetComment (const std::string &comment) |
| Set the human-readable comment for this mime-type. More... | |
| void | Swap (CustomMimeType &r) |
| Swap the contents of this CustomMimeType with another. More... | |
| virtual CustomMimeType * | Clone () const |
| Create a heap-allocated copy of this CustomMimeType. More... | |
A custom mime-type that can be registered as a service object.
Instances of this class are usually created and registered as a CppMicroServices service. They act as meta-data that links files to compatible IFileReader and IFileWriter instances by mapping file extensions to unique mime-type names.
CustomMimeType should only be used to define and register mime-types. For all other interaction (querying, matching), use IMimeTypeProvider to retrieve registered mime-types as mitk::MimeType objects, which provide a safe, memory-managed, immutable view.
Definition at line 49 of file mitkCustomMimeType.h.
| mitk::CustomMimeType::CustomMimeType | ( | ) |
Construct a default CustomMimeType with an empty name.
| mitk::CustomMimeType::CustomMimeType | ( | const std::string & | name | ) |
Construct a CustomMimeType with the given unique name.
| [in] | name | The unique identifier for this mime-type (e.g. "application/vnd.mitk.image.nrrd"). |
| mitk::CustomMimeType::CustomMimeType | ( | const CustomMimeType & | other | ) |
Copy constructor.
| [in] | other | The CustomMimeType to copy from. |
|
explicit |
|
virtual |
| void mitk::CustomMimeType::AddExtension | ( | const std::string & | extension | ) |
Add a file extension to the list if not already present (case-insensitive).
| [in] | extension | The file extension to add (without leading dot). |
|
virtual |
Check whether this mime-type can handle the file at the given path.
| [in] | path | The file path to check. |
true if this mime-type applies to the given file.The base implementation checks only the file extension. Subclasses may override this method to inspect file contents (e.g. DICOM magic bytes).
Reimplemented in mitk::MitkSegmentationIOMimeTypes::MitkSegmentationTaskListMimeType, mitk::DICOMRTMimeTypes::RTPlanMimeType, mitk::DICOMRTMimeTypes::RTStructMimeType, mitk::DICOMRTMimeTypes::RTDoseMimeType, mitk::MitkROIIOMimeTypes::MitkROIMimeType, mitk::MitkMultilabelIOMimeTypes::MultiLabelNiftiStackMimeType, mitk::MitkMultilabelIOMimeTypes::MultiLabelMetaMimeType, mitk::MitkMultilabelIOMimeTypes::MultiLabelSegmentationMimeType, mitk::MitkMultilabelIOMimeTypes::LegacyLabelSetMimeType, mitk::MitkDICOMSEGIOMimeTypes::MitkDICOMSEGMimeType, mitk::MitkDICOMPMIOMimeTypes::MitkDICOMPMMimeType, mitk::IOMimeTypes::BaseDicomMimeType, mitk::MitkCESTIOMimeTypes::MitkCESTDicomWOMetaFileMimeType, mitk::MitkCESTIOMimeTypes::MitkCESTDicomWithMetaFileMimeType, mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType, and mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType.
|
virtual |
Create a heap-allocated copy of this CustomMimeType.
Reimplemented in mitk::MitkSegmentationIOMimeTypes::MitkSegmentationTaskListMimeType, mitk::DICOMRTMimeTypes::RTPlanMimeType, mitk::DICOMRTMimeTypes::RTStructMimeType, mitk::DICOMRTMimeTypes::RTDoseMimeType, mitk::MitkROIIOMimeTypes::MitkROIMimeType, mitk::MitkMultilabelIOMimeTypes::MultiLabelNiftiStackMimeType, mitk::MitkMultilabelIOMimeTypes::MultiLabelMetaMimeType, mitk::MitkMultilabelIOMimeTypes::MultiLabelSegmentationMimeType, mitk::MitkMultilabelIOMimeTypes::LegacyLabelSetMimeType, mitk::MitkDICOMSEGIOMimeTypes::MitkDICOMSEGMimeType, mitk::MitkDICOMPMIOMimeTypes::MitkDICOMPMMimeType, mitk::IOMimeTypes::DicomMimeType, mitk::IOMimeTypes::BaseDicomMimeType, mitk::MitkCESTIOMimeTypes::MitkCESTDicomWOMetaFileMimeType, mitk::MitkCESTIOMimeTypes::MitkCESTDicomWithMetaFileMimeType, mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType, and mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType.
| std::string mitk::CustomMimeType::GetCategory | ( | ) | const |
Get the human-readable category of this mime-type.
| std::string mitk::CustomMimeType::GetComment | ( | ) | const |
Get a human-readable description of this mime-type.
| std::string mitk::CustomMimeType::GetExtension | ( | const std::string & | path | ) | const |
Get the first matching extension found at the end of the given path.
| [in] | path | The file path to inspect. |
| std::vector<std::string> mitk::CustomMimeType::GetExtensions | ( | ) | const |
Get all file extensions this mime-type can handle.
| std::string mitk::CustomMimeType::GetFilenameWithoutExtension | ( | const std::string & | path | ) | const |
Get the filename from the given path, without the matching extension.
| [in] | path | The file path to inspect. |
| std::string mitk::CustomMimeType::GetName | ( | ) | const |
Get the unique name for this mime-type.
| bool mitk::CustomMimeType::MatchesExtension | ( | const std::string & | path | ) | const |
Check whether the file extension of the given path matches this mime-type.
| [in] | path | The file path to check. |
true if the path ends with one of this mime-type's extensions.This method performs a case-insensitive extension comparison only; it does not inspect file contents.
| CustomMimeType& mitk::CustomMimeType::operator= | ( | const CustomMimeType & | other | ) |
Copy assignment operator.
| [in] | other | The CustomMimeType to assign from. |
| CustomMimeType& mitk::CustomMimeType::operator= | ( | const MimeType & | other | ) |
| void mitk::CustomMimeType::SetCategory | ( | const std::string & | category | ) |
Set the category for grouping this mime-type.
| [in] | category | The category string (e.g. "Images"). |
| void mitk::CustomMimeType::SetComment | ( | const std::string & | comment | ) |
Set the human-readable comment for this mime-type.
| [in] | comment | The comment string. |
| void mitk::CustomMimeType::SetExtension | ( | const std::string & | extension | ) |
Set a single file extension, replacing all existing extensions.
| [in] | extension | The file extension (without leading dot). |
| void mitk::CustomMimeType::SetName | ( | const std::string & | name | ) |
Set the unique name of this mime-type.
| [in] | name | The new mime-type name. |
| void mitk::CustomMimeType::Swap | ( | CustomMimeType & | r | ) |
Swap the contents of this CustomMimeType with another.
| [in,out] | r | The CustomMimeType to swap with. |