64 for (
const auto &option : options)
66 this->
SetOption(option.first, option.second);
74 MITK_WARN <<
"Ignoring unknown IFileReader option '" << name <<
"'";
120 if (!rankProp.
Empty())
150 if (context ==
nullptr)
151 throw std::invalid_argument(
"The context argument must not be nullptr.");
155 const std::vector<std::string> extensions =
m_CustomMimeType->GetExtensions();
162 if (!mimeTypeProvider->GetMimeTypeForName(
m_CustomMimeType->GetName()).IsValid())
172 MITK_WARN <<
"Trying to register a MITK reader or writer with an empty mime type name and empty extension list.";
202 catch (
const std::logic_error &)
std::string GetDescription() const
us::ServiceRegistration< CustomMimeType > RegisterMimeType(us::ModuleContext *context)
void SetDefaultOptions(const Options &defaultOptions)
static IMimeTypeProvider * GetMimeTypeProvider(us::ModuleContext *context=us::GetModuleContext())
Get an IMimeTypeProvider instance.
US_Core_EXPORT const std::string & SERVICE_RANKING()
std::string GetMimeTypePrefix() const
void RemoveProgressCallback(const ProgressCallback &callback)
Options GetOptions() const
void SetRanking(int ranking)
Set the service ranking for this file reader.
DataCollection - Class to facilitate loading/accessing structured data.
ValueType * any_cast(Any *operand)
std::string m_MimeTypePrefix
void UnregisterMimeType()
us::Any GetOption(const std::string &name) const
us::ServiceRegistration< CustomMimeType > m_MimeTypeReg
void SetMimeTypePrefix(const std::string &prefix)
const char * what() const override
void SetDescription(const std::string &description)
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
void SetOptions(const Options &options)
virtual ~FileReaderWriterBase()
const CustomMimeType * GetMimeType() const
Options GetDefaultOptions() const
void SetOption(const std::string &name, const us::Any &value)
virtual CustomMimeType * Clone() const
Message1< float > m_ProgressMessage
The MimeType class represens a registered mime-type. It is an immutable wrapper for mitk::CustomMimeT...
MimeType GetRegisteredMimeType() const
std::map< std::string, us::Any > Options
Options m_Options
Options supported by this reader. Set sensible default values!
A RAII helper class for core service objects.
std::string m_Description
US_Core_EXPORT const std::string & SERVICE_ID()
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
void SetMimeType(const CustomMimeType &mimeType)
std::unique_ptr< CustomMimeType > m_CustomMimeType
void AddProgressCallback(const ProgressCallback &callback)