Writer plugin interface.
More...
#include <ioformat/plugin/WriterPlugin.h>
Inherits ioformat::FormatPlugin.
|
| uint64_t | api () const final override |
| | Get the API version of the plugin.
|
| |
| virtual std::shared_ptr< iolink::Writer > | open (std::shared_ptr< iolink::View > src, const std::string &dst, const std::string &format, const OptionMap &options)=0 |
| | Open a file for writing.
|
| |
| virtual std::shared_ptr< iolink::Writer > | open (std::shared_ptr< iolink::View > src, std::shared_ptr< iolink::StreamAccess > dst, const std::string &format, const OptionMap &options)=0 |
| | Open a stream for writing.
|
| |
|
virtual const StringSet & | supportedFormats () const =0 |
| | Get the formats supported by the plugin.
|
| |
|
virtual const StringMap & | extensionMap () const =0 |
| | Retrieve a mapping that associates file extensions with formats.
|
| |
|
virtual const std::string & | name () const =0 |
| | Get the name of the plugin.
|
| |
|
virtual const PluginVersion & | version () const =0 |
| | Get the version of the plugin.
|
| |
|
virtual void | initLog (iolink::LogLevel level)=0 |
| | Initialize the plugin's logger.
|
| |
|
|
static constexpr uint64_t | PLUGIN_API_VERSION = 2 |
| | The actual API version of that plugin.
|
| |
|
|
using | StringSet = std::unordered_set< std::string > |
| |
|
using | StringMap = std::unordered_map< std::string, std::string > |
| |
Writer plugin interface.
To create a writer plugin used by ioformat to write formats, the plugin must implement this interface.
◆ api()
| uint64_t ioformat::WriterPlugin::api |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
Get the API version of the plugin.
This is used internally to check compatibility between the plugin and the ioformat plugin loader.
Implements ioformat::Plugin.
◆ open() [1/2]
| virtual std::shared_ptr< iolink::Writer > ioformat::WriterPlugin::open |
( |
std::shared_ptr< iolink::View > |
src, |
|
|
const std::string & |
dst, |
|
|
const std::string & |
format, |
|
|
const OptionMap & |
options |
|
) |
| |
|
pure virtual |
Open a file for writing.
- Parameters
-
| src | The source view to write. |
| dst | The destination file path. |
| format | The format to write. |
| options | The options to use. |
- Returns
- A writer instance.
- Exceptions
-
| InvalidArgument | If the source view is not valid. |
| InvalidArgument | If the destination is not supported. |
| UnsupportedFormat | If the format is not supported. |
| Error | if an internal error occurs. |
◆ open() [2/2]
| virtual std::shared_ptr< iolink::Writer > ioformat::WriterPlugin::open |
( |
std::shared_ptr< iolink::View > |
src, |
|
|
std::shared_ptr< iolink::StreamAccess > |
dst, |
|
|
const std::string & |
format, |
|
|
const OptionMap & |
options |
|
) |
| |
|
pure virtual |
Open a stream for writing.
- Parameters
-
| src | The source view to write. |
| dst | The destination stream. |
| format | The format to write. |
| options | The options to use. |
- Returns
- A writer instance.
- Exceptions
-
| InvalidArgument | If the source view is not valid. |
| InvalidArgument | If the destination is not supported. |
| UnsupportedFormat | If the format is not supported. |
| Error | if an internal error occurs. |
The documentation for this class was generated from the following file: