Medical Imaging Interaction Toolkit
2016.11.0
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 48 of file mitkCustomMimeType.h.
mitk::CustomMimeType::CustomMimeType | ( | ) |
Definition at line 55 of file mitkCustomMimeType.cpp.
Referenced by Clone().
mitk::CustomMimeType::CustomMimeType | ( | const std::string & | name | ) |
Definition at line 56 of file mitkCustomMimeType.cpp.
mitk::CustomMimeType::CustomMimeType | ( | const CustomMimeType & | other | ) |
Definition at line 57 of file mitkCustomMimeType.cpp.
|
explicit |
Definition at line 58 of file mitkCustomMimeType.cpp.
References mitk::MimeType::GetCategory(), mitk::MimeType::GetComment(), mitk::MimeType::GetExtensions(), and mitk::MimeType::GetName().
|
virtual |
Definition at line 54 of file mitkCustomMimeType.cpp.
void mitk::CustomMimeType::AddExtension | ( | const std::string & | extension | ) |
Definition at line 146 of file mitkCustomMimeType.cpp.
Referenced by mitk::DiffusionIOMimeTypes::CONNECTOMICS_LIST_MIMETYPE(), mitk::DiffusionIOMimeTypes::CONNECTOMICS_MATRIX_MIMETYPE(), mitk::DiffusionIOMimeTypes::CONNECTOMICS_MIMETYPE(), mitk::ContourModelReader::ContourModelReader(), mitk::ContourModelSetReader::ContourModelSetReader(), mitk::ContourModelSetWriter::ContourModelSetWriter(), mitk::ContourModelWriter::ContourModelWriter(), CreateSimulationMimeType(), mitk::IOMimeTypes::DicomMimeType::DicomMimeType(), mitk::DiffusionCoreIOMimeTypes::DiffusionImageNiftiMimeType::DiffusionImageNiftiMimeType(), mitk::DiffusionCoreIOMimeTypes::DiffusionImageNrrdMimeType::DiffusionImageNrrdMimeType(), mitk::DiffusionCoreIOMimeTypes::DTI_MIMETYPE(), mitk::DummyLsetFileReader::DummyLsetFileReader(), mitk::ExampleIOMimeTypes::EXAMPLE_TWO_MIMETYPE(), mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::ExampleDataStructureMimeType(), mitk::DiffusionIOMimeTypes::FIBERBUNDLE_TRK_MIMETYPE(), mitk::DiffusionIOMimeTypes::FIBERBUNDLE_VTK_MIMETYPE(), mitk::IOMimeTypes::GEOMETRY_DATA_MIMETYPE(), mitk::ItkImageIO::ItkImageIO(), mitk::LegacyFileReaderService::LegacyFileReaderService(), mitk::LegacyFileWriterService::LegacyFileWriterService(), mitk::MAPRegistrationWrapperIO::MAPRegistrationWrapperIO(), mitk::IGTMimeTypes::NAVIGATIONDATASETCSV_MIMETYPE(), mitk::IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(), mitk::IOMimeTypes::NIFTI_MIMETYPE(), mitk::IOMimeTypes::NRRD_MIMETYPE(), mitk::DiffusionIOMimeTypes::PLANARFIGURECOMPOSITE_MIMETYPE(), mitk::IOMimeTypes::POINTSET_MIMETYPE(), mitk::DiffusionCoreIOMimeTypes::QBI_MIMETYPE(), mitk::RandomForestFileIO::RandomForestFileIO(), mitk::IOMimeTypes::RAW_MIMETYPE(), mitk::IOMimeTypes::STANFORD_PLY_MIMETYPE(), mitk::IOMimeTypes::STEREOLITHOGRAPHY_MIMETYPE(), mitk::TubeGraphIO::TUBEGRAPH_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::DiffusionCoreIOMimeTypes::DiffusionImageNiftiMimeType, mitk::DiffusionIOMimeTypes::DiffusionImageNiftiMimeType, mitk::IOMimeTypes::DicomMimeType, mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType, mitk::DiffusionCoreIOMimeTypes::DiffusionImageNrrdMimeType, and mitk::DiffusionIOMimeTypes::DiffusionImageNrrdMimeType.
Definition at line 94 of file mitkCustomMimeType.cpp.
References MatchesExtension().
Referenced by mitk::DiffusionCoreIOMimeTypes::DiffusionImageNrrdMimeType::AppliesTo(), mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::AppliesTo(), mitk::IOMimeTypes::DicomMimeType::AppliesTo(), and mitk::DiffusionCoreIOMimeTypes::DiffusionImageNiftiMimeType::AppliesTo().
|
virtual |
Reimplemented in mitk::DiffusionCoreIOMimeTypes::DiffusionImageNiftiMimeType, mitk::DiffusionIOMimeTypes::DiffusionImageNiftiMimeType, mitk::IOMimeTypes::DicomMimeType, mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType, mitk::DiffusionCoreIOMimeTypes::DiffusionImageNrrdMimeType, and mitk::DiffusionIOMimeTypes::DiffusionImageNrrdMimeType.
Definition at line 163 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 81 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 83 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 101 of file mitkCustomMimeType.cpp.
References filename.
Referenced by mitk::DiffusionImageNiftiReaderService::InternalRead(), and mitk::DiffusionImageNrrdReaderService::InternalRead().
std::vector< std::string > mitk::CustomMimeType::GetExtensions | ( | ) | const |
Returns all extensions that this MimeType can handle.
Definition at line 82 of file mitkCustomMimeType.cpp.
Referenced by 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 108 of file mitkCustomMimeType.cpp.
References filename.
Referenced by mitk::DiffusionImageNiftiReaderService::InternalRead().
std::string mitk::CustomMimeType::GetName | ( | ) | const |
Returns the unique name for the MimeType.
Definition at line 80 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 95 of file mitkCustomMimeType.cpp.
References filename.
Referenced by AppliesTo().
CustomMimeType & mitk::CustomMimeType::operator= | ( | const CustomMimeType & | other | ) |
Definition at line 66 of file mitkCustomMimeType.cpp.
References Swap().
CustomMimeType & mitk::CustomMimeType::operator= | ( | const MimeType & | other | ) |
Definition at line 73 of file mitkCustomMimeType.cpp.
References Swap().
void mitk::CustomMimeType::SetCategory | ( | const std::string & | category | ) |
Definition at line 139 of file mitkCustomMimeType.cpp.
Referenced by mitk::DiffusionIOMimeTypes::CONNECTOMICS_LIST_MIMETYPE(), mitk::DiffusionIOMimeTypes::CONNECTOMICS_MATRIX_MIMETYPE(), mitk::DiffusionIOMimeTypes::CONNECTOMICS_MIMETYPE(), mitk::ContourModelReader::ContourModelReader(), mitk::ContourModelSetReader::ContourModelSetReader(), mitk::ContourModelSetWriter::ContourModelSetWriter(), mitk::ContourModelWriter::ContourModelWriter(), CreateSimulationMimeType(), mitk::IOMimeTypes::DicomMimeType::DicomMimeType(), mitk::DiffusionCoreIOMimeTypes::DiffusionImageNiftiMimeType::DiffusionImageNiftiMimeType(), mitk::DiffusionCoreIOMimeTypes::DiffusionImageNrrdMimeType::DiffusionImageNrrdMimeType(), mitk::DiffusionCoreIOMimeTypes::DTI_MIMETYPE(), mitk::DummyLsetFileReader::DummyLsetFileReader(), mitk::ExampleIOMimeTypes::EXAMPLE_TWO_MIMETYPE(), mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::ExampleDataStructureMimeType(), mitk::DiffusionIOMimeTypes::FIBERBUNDLE_TRK_MIMETYPE(), mitk::DiffusionIOMimeTypes::FIBERBUNDLE_VTK_MIMETYPE(), mitk::IOMimeTypes::GEOMETRY_DATA_MIMETYPE(), mitk::ItkImageIO::ItkImageIO(), mitk::LegacyFileReaderService::LegacyFileReaderService(), mitk::MAPRegistrationWrapperIO::MAPRegistrationWrapperIO(), mitk::IGTMimeTypes::NAVIGATIONDATASETCSV_MIMETYPE(), mitk::IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(), mitk::IOMimeTypes::NIFTI_MIMETYPE(), mitk::IOMimeTypes::NRRD_MIMETYPE(), mitk::DiffusionIOMimeTypes::PLANARFIGURECOMPOSITE_MIMETYPE(), mitk::IOMimeTypes::POINTSET_MIMETYPE(), mitk::DiffusionCoreIOMimeTypes::QBI_MIMETYPE(), mitk::RandomForestFileIO::RandomForestFileIO(), mitk::IOMimeTypes::RAW_MIMETYPE(), mitk::IOMimeTypes::STANFORD_PLY_MIMETYPE(), mitk::IOMimeTypes::STEREOLITHOGRAPHY_MIMETYPE(), mitk::TubeGraphIO::TUBEGRAPH_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 155 of file mitkCustomMimeType.cpp.
Referenced by mitk::DiffusionIOMimeTypes::CONNECTOMICS_LIST_MIMETYPE(), mitk::DiffusionIOMimeTypes::CONNECTOMICS_MATRIX_MIMETYPE(), mitk::DiffusionIOMimeTypes::CONNECTOMICS_MIMETYPE(), CreateSimulationMimeType(), mitk::IOMimeTypes::DicomMimeType::DicomMimeType(), mitk::DiffusionCoreIOMimeTypes::DiffusionImageNiftiMimeType::DiffusionImageNiftiMimeType(), mitk::DiffusionCoreIOMimeTypes::DiffusionImageNrrdMimeType::DiffusionImageNrrdMimeType(), mitk::DiffusionCoreIOMimeTypes::DTI_MIMETYPE(), mitk::DummyLsetFileReader::DummyLsetFileReader(), mitk::ExampleIOMimeTypes::EXAMPLE_TWO_MIMETYPE(), mitk::ExampleIOMimeTypes::ExampleDataStructureMimeType::ExampleDataStructureMimeType(), mitk::DiffusionIOMimeTypes::FIBERBUNDLE_TRK_MIMETYPE(), mitk::DiffusionIOMimeTypes::FIBERBUNDLE_VTK_MIMETYPE(), mitk::IOMimeTypes::GEOMETRY_DATA_MIMETYPE(), mitk::IGTMimeTypes::NAVIGATIONDATASETCSV_MIMETYPE(), mitk::IGTMimeTypes::NAVIGATIONDATASETXML_MIMETYPE(), mitk::IOMimeTypes::NIFTI_MIMETYPE(), mitk::IOMimeTypes::NRRD_MIMETYPE(), mitk::DiffusionIOMimeTypes::PLANARFIGURECOMPOSITE_MIMETYPE(), mitk::IOMimeTypes::POINTSET_MIMETYPE(), mitk::DiffusionCoreIOMimeTypes::QBI_MIMETYPE(), mitk::RandomForestFileIO::RandomForestFileIO(), mitk::IOMimeTypes::RAW_MIMETYPE(), mitk::IOMimeTypes::STANFORD_PLY_MIMETYPE(), mitk::IOMimeTypes::STEREOLITHOGRAPHY_MIMETYPE(), mitk::TubeGraphIO::TUBEGRAPH_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 140 of file mitkCustomMimeType.cpp.
void mitk::CustomMimeType::SetName | ( | const std::string & | name | ) |
Definition at line 138 of file mitkCustomMimeType.cpp.
void mitk::CustomMimeType::Swap | ( | CustomMimeType & | r | ) |
Definition at line 156 of file mitkCustomMimeType.cpp.
Referenced by operator=(), and mitk::swap().