13 #ifndef mitkAbstractFileWriter_h
14 #define mitkAbstractFileWriter_h
32 struct PrototypeServiceFactory;
219 std::unique_ptr<Impl> d;
245 std::ostream *m_Stream;
377 std::unique_ptr<Impl> d;
A local file representation for writers that cannot use streams.
~LocalFile()
Destructor. Writes temporary file contents to the output stream (if any) and removes the temporary fi...
std::string GetFileName()
Get a local file name for writing.
LocalFile(IFileWriter *writer)
Construct a LocalFile for the given writer.
An output stream wrapper for writer implementations.
OutputStream(IFileWriter *writer, std::ios_base::openmode mode=std::ios_base::trunc|std::ios_base::out)
Construct an OutputStream from a writer's configured output.
Base class for writing mitk::BaseData objects to files or streams.
const BaseData * GetInput() const override
Get the input data.
void SetInput(const BaseData *data) override
Set the input data for writing.
AbstractFileWriter(const std::string &baseDataType, const CustomMimeType &mimeType, const std::string &description)
Construct a writer for the given BaseData type, MIME type, and description.
void SetDefaultOptions(const Options &defaultOptions)
Set the default options for this writer.
int GetRanking() const
Get the service ranking for this file writer.
Options GetOptions() const override
Get the current option values.
void SetOutputStream(const std::string &location, std::ostream *os) override
Set an output stream and associated location label.
~AbstractFileWriter() override
ConfidenceLevel GetConfidenceLevel() const override
Determine confidence for writing the current input data.
virtual us::ServiceProperties GetServiceProperties() const
Get the service properties for registration.
std::string GetOutputLocation() const override
Get the current output location.
void ValidateOutputLocation() const
Validate the output location or stream.
void AddProgressCallback(const ProgressCallback &callback) override
Register a progress callback.
void SetOutputLocation(const std::string &location) override
Set the output file-system path, clearing any output stream.
void SetOptions(const Options &options) override
Set multiple options at once.
std::string GetDescription() const
Get the human-readable description of this writer.
virtual std::string GetBaseDataType() const
Get the name of the mitk::BaseData sub-class this writer supports.
void SetDescription(const std::string &description)
Set a human-readable description of this writer.
void SetBaseDataType(const std::string &baseDataType)
Set the name of the mitk::BaseData sub-class this writer supports.
Options GetDefaultOptions() const
Get the default options for this writer.
void UnregisterService()
Unregister this writer from the CppMicroServices registry.
us::Any GetOption(const std::string &name) const override
Get the value of a specific option.
MimeType GetRegisteredMimeType() const
Get the MIME type that was registered for this writer.
std::string GetMimeTypePrefix() const
Get the current MIME type name prefix.
void SetMimeTypePrefix(const std::string &prefix)
Set the prefix used for auto-generated MIME type names.
void Write() override=0
Write the base data to the specified location or output stream.
virtual us::ServiceRegistration< CustomMimeType > RegisterMimeType(us::ModuleContext *context)
Register a new CustomMimeType service object.
us::ServiceRegistration< IFileWriter > RegisterService(us::ModuleContext *context=us::GetModuleContext())
Register this writer as a CppMicroServices service.
const CustomMimeType * GetMimeType() const
Get the MIME type this writer can handle.
void SetMimeType(const CustomMimeType &mimeType)
Set the MIME type this writer can handle.
void SetOption(const std::string &name, const us::Any &value) override
Set a single option value.
AbstractFileWriter(const std::string &baseDataType)
Construct a writer for the given BaseData type name.
void RemoveProgressCallback(const ProgressCallback &callback) override
Remove a previously registered progress callback.
void SetRanking(int ranking)
Set the service ranking for this file writer.
std::ostream * GetOutputStream() const override
Get the current output stream.
AbstractFileWriter(const AbstractFileWriter &other)
Copy constructor.
Base class of all data objects.
A custom mime-type that can be registered as a service object.
Abstract base class for message delegates with one parameter.
Immutable, value-type wrapper for a registered mime-type.
An Any class represents a general type and is capable of storing any type, supporting type-safe extra...
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
std::unordered_map< std::string, Any > ServiceProperties
Find image slices visible on a given plane.
ConfidenceLevel
A confidence level describing the reader's or writer's ability to handle the given data or file forma...
std::map< std::string, us::Any > Options
Options for reading or writing data.
The common interface of all MITK file writers.