Immutable, value-type wrapper for a registered mime-type.
More...
#include <mitkMimeType.h>
Immutable, value-type wrapper for a registered mime-type.
MimeType wraps a mitk::CustomMimeType with copy-on-write semantics, providing a stack-friendly, memory-safe handle for consumers that need to query mime-type information without managing raw pointers.
To register a new mime-type, use the CustomMimeType class instead. Wrapping into a MimeType is performed automatically by the framework. In all other cases you should use mitk::MimeType when working with mime-types.
- See also
- CustomMimeType
-
IMimeTypeProvider
-
IOMimeTypes
Definition at line 44 of file mitkMimeType.h.
◆ MimeType() [1/3]
| mitk::MimeType::MimeType |
( |
| ) |
|
◆ MimeType() [2/3]
| mitk::MimeType::MimeType |
( |
const MimeType & |
other | ) |
|
Copy constructor.
- Parameters
-
◆ MimeType() [3/3]
| mitk::MimeType::MimeType |
( |
const CustomMimeType & |
x, |
|
|
int |
rank, |
|
|
long |
id |
|
) |
| |
Construct a MimeType from a CustomMimeType with a service rank and id.
- Parameters
-
| [in] | x | The CustomMimeType to wrap. |
| [in] | rank | The service ranking of this mime-type. |
| [in] | id | The service id of this mime-type. |
◆ ~MimeType()
| mitk::MimeType::~MimeType |
( |
| ) |
|
◆ AppliesTo()
| bool mitk::MimeType::AppliesTo |
( |
const std::string & |
path | ) |
const |
Check whether this mime-type can handle the given file path.
- Parameters
-
| [in] | path | The file path to check. |
- Returns
true if this mime-type applies to the given path.
- See also
- CustomMimeType::AppliesTo()
◆ GetCategory()
| std::string mitk::MimeType::GetCategory |
( |
| ) |
const |
◆ GetComment()
| std::string mitk::MimeType::GetComment |
( |
| ) |
const |
◆ GetExtensions()
| std::vector<std::string> mitk::MimeType::GetExtensions |
( |
| ) |
const |
◆ GetFilenameWithoutExtension()
| std::string mitk::MimeType::GetFilenameWithoutExtension |
( |
const std::string & |
path | ) |
const |
Extract the filename without the matching extension from a path.
- Parameters
-
| [in] | path | The file path to process. |
- Returns
- The filename without the extension matched by this mime-type.
- See also
- CustomMimeType::GetFilenameWithoutExtension()
◆ GetName()
| std::string mitk::MimeType::GetName |
( |
| ) |
const |
Get the unique name of this mime-type.
- Returns
- The mime-type name (e.g. "application/vnd.mitk.image.nrrd").
- See also
- CustomMimeType::GetName()
◆ IsValid()
| bool mitk::MimeType::IsValid |
( |
| ) |
const |
◆ MatchesExtension()
| bool mitk::MimeType::MatchesExtension |
( |
const std::string & |
path | ) |
const |
Check whether the extension of the given path matches this mime-type.
- Parameters
-
| [in] | path | The file path to check. |
- Returns
true if the path's extension matches one of this mime-type's extensions.
- See also
- CustomMimeType::MatchesExtension()
◆ operator<()
| bool mitk::MimeType::operator< |
( |
const MimeType & |
other | ) |
const |
Less-than comparison based on rank and service id.
- Parameters
-
- Returns
true if this MimeType is ranked lower than other.
◆ operator=()
Copy assignment operator.
- Parameters
-
- Returns
- Reference to this object.
◆ operator==()
| bool mitk::MimeType::operator== |
( |
const MimeType & |
other | ) |
const |
Equality comparison based on the mime-type name.
- Parameters
-
- Returns
true if both MimeType objects have the same name.
◆ Swap()
| void mitk::MimeType::Swap |
( |
MimeType & |
m | ) |
|
Swap the contents of this MimeType with another.
- Parameters
-
The documentation for this class was generated from the following file: