Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
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>
Public Member Functions | |
CustomMimeType () | |
CustomMimeType (const std::string &name) | |
CustomMimeType (const CustomMimeType &other) | |
CustomMimeType (const MimeType &other) | |
virtual | ~CustomMimeType () |
CustomMimeType & | operator= (const CustomMimeType &other) |
CustomMimeType & | operator= (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 etension 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 CustomMimeType * | Clone () const |
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 trough 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.
mitk::CustomMimeType::CustomMimeType | ( | ) |
Definition at line 51 of file mitkCustomMimeType.cpp.
Referenced by Clone().
mitk::CustomMimeType::CustomMimeType | ( | const std::string & | name | ) |
Definition at line 52 of file mitkCustomMimeType.cpp.
mitk::CustomMimeType::CustomMimeType | ( | const CustomMimeType & | other | ) |
Definition at line 53 of file mitkCustomMimeType.cpp.
|
explicit |
Definition at line 54 of file mitkCustomMimeType.cpp.
References mitk::MimeType::GetCategory(), mitk::MimeType::GetComment(), mitk::MimeType::GetExtensions(), and mitk::MimeType::GetName().
|
virtual |
Definition at line 50 of file mitkCustomMimeType.cpp.
void mitk::CustomMimeType::AddExtension | ( | const std::string & | extension | ) |
Definition at line 142 of file mitkCustomMimeType.cpp.
Referenced by mitk::ContourModelReader::ContourModelReader(), mitk::ContourModelSetReader::ContourModelSetReader(), mitk::ContourModelSetWriter::ContourModelSetWriter(), mitk::ContourModelWriter::ContourModelWriter(), mitk::IOMimeTypes::DicomMimeType::DicomMimeType(), mitk::DummyLsetFileReader::DummyLsetFileReader(), mitk::ExampleIOMimeTypes::EXAMPLE_TWO_MIMETYPE(), mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::ExampleDataStructureMimeType(), mitk::IOMimeTypes::GEOMETRY_DATA_MIMETYPE(), mitk::ItkImageIO::ItkImageIO(), mitk::LegacyFileReaderService::LegacyFileReaderService(), mitk::LegacyFileWriterService::LegacyFileWriterService(), mitk::MAPRegistrationWrapperIO::MAPRegistrationWrapperIO(), mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType::MitkCESTDicomMimeType(), mitk::MitkDICOMPMIOMimeTypes::MitkDICOMPMMimeType::MitkDICOMPMMimeType(), mitk::MitkDICOMSEGIOMimeTypes::MitkDICOMSEGMimeType::MitkDICOMSEGMimeType(), mitk::IGTMimeTypes::NAVIGATIONDATASETCSV_MIMETYPE(), mitk::IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(), mitk::IOMimeTypes::NIFTI_MIMETYPE(), mitk::IOMimeTypes::NRRD_MIMETYPE(), mitk::IOMimeTypes::POINTSET_MIMETYPE(), mitk::RandomForestFileIO::RandomForestFileIO(), mitk::IOMimeTypes::RAW_MIMETYPE(), mitk::DicomRTIOMimeTypes::RTDoseMimeType::RTDoseMimeType(), mitk::DicomRTIOMimeTypes::RTPlanMimeType::RTPlanMimeType(), mitk::DicomRTIOMimeTypes::RTStructMimeType::RTStructMimeType(), mitk::IOMimeTypes::STANFORD_PLY_MIMETYPE(), mitk::IOMimeTypes::STEREOLITHOGRAPHY_MIMETYPE(), mitk::TubeGraphIO::TUBEGRAPH_MIMETYPE(), mitk::IGTMimeTypes::USDEVICEINFORMATIONXML_MIMETYPE(), mitk::IOMimeTypes::VTK_IMAGE_LEGACY_MIMETYPE(), mitk::IOMimeTypes::VTK_IMAGE_MIMETYPE(), mitk::IOMimeTypes::VTK_PARALLEL_IMAGE_MIMETYPE(), mitk::IOMimeTypes::VTK_PARALLEL_POLYDATA_MIMETYPE(), mitk::IOMimeTypes::VTK_POLYDATA_LEGACY_MIMETYPE(), mitk::IOMimeTypes::VTK_POLYDATA_MIMETYPE(), and mitk::IOMimeTypes::WAVEFRONT_OBJ_MIMETYPE().
|
virtual |
Checks if the MimeType can handle file at the given location.
In its base implementation, this function exclusively looks a the given string. However, child classes can override this behaviour and peek into the file.
Reimplemented in mitk::DicomRTIOMimeTypes::RTPlanMimeType, mitk::DicomRTIOMimeTypes::RTStructMimeType, mitk::MitkDICOMPMIOMimeTypes::MitkDICOMPMMimeType, mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType, mitk::MitkDICOMSEGIOMimeTypes::MitkDICOMSEGMimeType, mitk::IOMimeTypes::DicomMimeType, mitk::DicomRTIOMimeTypes::RTDoseMimeType, and mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType.
Definition at line 90 of file mitkCustomMimeType.cpp.
References MatchesExtension().
Referenced by mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::AppliesTo(), mitk::DicomRTIOMimeTypes::RTDoseMimeType::AppliesTo(), mitk::MitkDICOMSEGIOMimeTypes::MitkDICOMSEGMimeType::AppliesTo(), mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType::AppliesTo(), mitk::MitkDICOMPMIOMimeTypes::MitkDICOMPMMimeType::AppliesTo(), mitk::DicomRTIOMimeTypes::RTStructMimeType::AppliesTo(), and mitk::DicomRTIOMimeTypes::RTPlanMimeType::AppliesTo().
|
virtual |
Reimplemented in mitk::DicomRTIOMimeTypes::RTPlanMimeType, mitk::DicomRTIOMimeTypes::RTStructMimeType, mitk::MitkDICOMPMIOMimeTypes::MitkDICOMPMMimeType, mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType, mitk::MitkDICOMSEGIOMimeTypes::MitkDICOMSEGMimeType, mitk::IOMimeTypes::DicomMimeType, mitk::DicomRTIOMimeTypes::RTDoseMimeType, and mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType.
Definition at line 159 of file mitkCustomMimeType.cpp.
References CustomMimeType().
Referenced by mitk::FileReaderWriterBase::SetMimeType().
std::string mitk::CustomMimeType::GetCategory | ( | ) | const |
Returns the human-readable Category of the mime-type. Allows grouping of similar mime-types (like Surfaces)
Definition at line 77 of file mitkCustomMimeType.cpp.
std::string mitk::CustomMimeType::GetComment | ( | ) | const |
Returns the Human readable comment of the MimeType, a string that describes its unique role.
Definition at line 79 of file mitkCustomMimeType.cpp.
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.
Definition at line 97 of file mitkCustomMimeType.cpp.
Referenced by mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::AppliesTo().
std::vector< std::string > mitk::CustomMimeType::GetExtensions | ( | ) | const |
Returns all extensions that this MimeType can handle.
Definition at line 78 of file mitkCustomMimeType.cpp.
Referenced by mitk::ItkImageIO::ItkImageIO(), and mitk::AbstractFileIO::RegisterService().
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.
Definition at line 104 of file mitkCustomMimeType.cpp.
std::string mitk::CustomMimeType::GetName | ( | ) | const |
Returns the unique name for the MimeType.
Definition at line 76 of file mitkCustomMimeType.cpp.
Referenced by mitk::AbstractFileIO::GetMimeType(), mitk::AbstractFileReader::GetServiceProperties(), mitk::AbstractFileWriter::GetServiceProperties(), mitk::ItkImageIO::Read(), mitk::AbstractFileIO::RegisterService(), and mitk::AbstractFileIO::SetMimeType().
bool mitk::CustomMimeType::MatchesExtension | ( | const std::string & | path | ) | const |
Checks if the MimeType can handle the etension of the given path.
This function exclusively looks a the given string
Definition at line 91 of file mitkCustomMimeType.cpp.
Referenced by AppliesTo().
CustomMimeType & mitk::CustomMimeType::operator= | ( | const CustomMimeType & | other | ) |
Definition at line 62 of file mitkCustomMimeType.cpp.
References Swap().
CustomMimeType & mitk::CustomMimeType::operator= | ( | const MimeType & | other | ) |
Definition at line 69 of file mitkCustomMimeType.cpp.
References Swap().
void mitk::CustomMimeType::SetCategory | ( | const std::string & | category | ) |
Definition at line 135 of file mitkCustomMimeType.cpp.
Referenced by mitk::ContourModelReader::ContourModelReader(), mitk::ContourModelSetReader::ContourModelSetReader(), mitk::ContourModelSetWriter::ContourModelSetWriter(), mitk::ContourModelWriter::ContourModelWriter(), mitk::IOMimeTypes::DicomMimeType::DicomMimeType(), mitk::DummyLsetFileReader::DummyLsetFileReader(), mitk::ExampleIOMimeTypes::EXAMPLE_TWO_MIMETYPE(), mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::ExampleDataStructureMimeType(), mitk::IOMimeTypes::GEOMETRY_DATA_MIMETYPE(), mitk::ItkImageIO::ItkImageIO(), mitk::LegacyFileReaderService::LegacyFileReaderService(), mitk::MAPRegistrationWrapperIO::MAPRegistrationWrapperIO(), mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType::MitkCESTDicomMimeType(), mitk::MitkDICOMPMIOMimeTypes::MitkDICOMPMMimeType::MitkDICOMPMMimeType(), mitk::MitkDICOMSEGIOMimeTypes::MitkDICOMSEGMimeType::MitkDICOMSEGMimeType(), mitk::IGTMimeTypes::NAVIGATIONDATASETCSV_MIMETYPE(), mitk::IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(), mitk::IOMimeTypes::NIFTI_MIMETYPE(), mitk::IOMimeTypes::NRRD_MIMETYPE(), mitk::IOMimeTypes::POINTSET_MIMETYPE(), mitk::RandomForestFileIO::RandomForestFileIO(), mitk::IOMimeTypes::RAW_MIMETYPE(), mitk::DicomRTIOMimeTypes::RTDoseMimeType::RTDoseMimeType(), mitk::DicomRTIOMimeTypes::RTPlanMimeType::RTPlanMimeType(), mitk::DicomRTIOMimeTypes::RTStructMimeType::RTStructMimeType(), mitk::IOMimeTypes::STANFORD_PLY_MIMETYPE(), mitk::IOMimeTypes::STEREOLITHOGRAPHY_MIMETYPE(), mitk::TubeGraphIO::TUBEGRAPH_MIMETYPE(), mitk::IGTMimeTypes::USDEVICEINFORMATIONXML_MIMETYPE(), mitk::IOMimeTypes::VTK_IMAGE_LEGACY_MIMETYPE(), mitk::IOMimeTypes::VTK_IMAGE_MIMETYPE(), mitk::IOMimeTypes::VTK_PARALLEL_IMAGE_MIMETYPE(), mitk::IOMimeTypes::VTK_PARALLEL_POLYDATA_MIMETYPE(), mitk::IOMimeTypes::VTK_POLYDATA_LEGACY_MIMETYPE(), mitk::IOMimeTypes::VTK_POLYDATA_MIMETYPE(), and mitk::IOMimeTypes::WAVEFRONT_OBJ_MIMETYPE().
void mitk::CustomMimeType::SetComment | ( | const std::string & | comment | ) |
Definition at line 151 of file mitkCustomMimeType.cpp.
Referenced by mitk::IOMimeTypes::DicomMimeType::DicomMimeType(), mitk::DummyLsetFileReader::DummyLsetFileReader(), mitk::ExampleIOMimeTypes::EXAMPLE_TWO_MIMETYPE(), mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::ExampleDataStructureMimeType(), mitk::IOMimeTypes::GEOMETRY_DATA_MIMETYPE(), mitk::MitkCESTIOMimeTypes::MitkCESTDicomMimeType::MitkCESTDicomMimeType(), mitk::MitkDICOMPMIOMimeTypes::MitkDICOMPMMimeType::MitkDICOMPMMimeType(), mitk::MitkDICOMSEGIOMimeTypes::MitkDICOMSEGMimeType::MitkDICOMSEGMimeType(), mitk::IGTMimeTypes::NAVIGATIONDATASETCSV_MIMETYPE(), mitk::IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(), mitk::IOMimeTypes::NIFTI_MIMETYPE(), mitk::IOMimeTypes::NRRD_MIMETYPE(), mitk::IOMimeTypes::POINTSET_MIMETYPE(), mitk::RandomForestFileIO::RandomForestFileIO(), mitk::IOMimeTypes::RAW_MIMETYPE(), mitk::DicomRTIOMimeTypes::RTDoseMimeType::RTDoseMimeType(), mitk::DicomRTIOMimeTypes::RTPlanMimeType::RTPlanMimeType(), mitk::DicomRTIOMimeTypes::RTStructMimeType::RTStructMimeType(), mitk::IOMimeTypes::STANFORD_PLY_MIMETYPE(), mitk::IOMimeTypes::STEREOLITHOGRAPHY_MIMETYPE(), mitk::TubeGraphIO::TUBEGRAPH_MIMETYPE(), mitk::IGTMimeTypes::USDEVICEINFORMATIONXML_MIMETYPE(), mitk::IOMimeTypes::VTK_IMAGE_LEGACY_MIMETYPE(), mitk::IOMimeTypes::VTK_IMAGE_MIMETYPE(), mitk::IOMimeTypes::VTK_PARALLEL_IMAGE_MIMETYPE(), mitk::IOMimeTypes::VTK_PARALLEL_POLYDATA_MIMETYPE(), mitk::IOMimeTypes::VTK_POLYDATA_LEGACY_MIMETYPE(), mitk::IOMimeTypes::VTK_POLYDATA_MIMETYPE(), and mitk::IOMimeTypes::WAVEFRONT_OBJ_MIMETYPE().
void mitk::CustomMimeType::SetExtension | ( | const std::string & | extension | ) |
Definition at line 136 of file mitkCustomMimeType.cpp.
void mitk::CustomMimeType::SetName | ( | const std::string & | name | ) |
Definition at line 134 of file mitkCustomMimeType.cpp.
Referenced by mitk::ItkImageIO::FixUpCustomMimeTypeName().
void mitk::CustomMimeType::Swap | ( | CustomMimeType & | r | ) |
Definition at line 152 of file mitkCustomMimeType.cpp.
Referenced by operator=(), and mitk::swap().