Extractor plugin interface.
More...
#include <ioformat/plugin/ExtractorPlugin.h>
Inherits ioformat::FormatPlugin.
|
| uint64_t | api () const final override |
| | Get the API version of the plugin.
|
| |
| virtual std::shared_ptr< iolink::View > | open (const std::string &src, const std::string &format, const OptionMap &options)=0 |
| | Open a file for reading.
|
| |
| virtual std::shared_ptr< iolink::View > | open (std::shared_ptr< iolink::StreamAccess > src, const std::string &format, const OptionMap &options)=0 |
| | Open a stream for reading.
|
| |
| virtual std::shared_ptr< iolink::View > | open (std::shared_ptr< iolink::RandomAccess > src, const std::string &format, const OptionMap &options)=0 |
| | Open a random access for reading.
|
| |
|
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 > |
| |
Extractor plugin interface.
In order to create an extractor plugin, that will be used by ioformat to read formats, the plugin must implement this interface.
◆ api()
| uint64_t ioformat::ExtractorPlugin::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/3]
| virtual std::shared_ptr< iolink::View > ioformat::ExtractorPlugin::open |
( |
const std::string & |
src, |
|
|
const std::string & |
format, |
|
|
const OptionMap & |
options |
|
) |
| |
|
pure virtual |
Open a file for reading.
- Parameters
-
| src | The source file path. |
| format | The format to read. |
| options | The options to use. |
- Returns
- A view instance.
- Exceptions
-
| InvalidArgument | If the source is not supported. |
| UnsupportedFormat | If the format is not supported. |
| Error | if an internal error occurs. |
◆ open() [2/3]
| virtual std::shared_ptr< iolink::View > ioformat::ExtractorPlugin::open |
( |
std::shared_ptr< iolink::RandomAccess > |
src, |
|
|
const std::string & |
format, |
|
|
const OptionMap & |
options |
|
) |
| |
|
pure virtual |
Open a random access for reading.
- Parameters
-
| src | The source random access. |
| format | The format to read. |
| options | The options to use. |
- Returns
- A view instance.
- Exceptions
-
| InvalidArgument | If the source is not supported. |
| UnsupportedFormat | If the format is not supported. |
| Error | if an internal error occurs. |
◆ open() [3/3]
| virtual std::shared_ptr< iolink::View > ioformat::ExtractorPlugin::open |
( |
std::shared_ptr< iolink::StreamAccess > |
src, |
|
|
const std::string & |
format, |
|
|
const OptionMap & |
options |
|
) |
| |
|
pure virtual |
Open a stream for reading.
- Parameters
-
| src | The source stream. |
| format | The format to read. |
| options | The options to use. |
- Returns
- A view instance.
- Exceptions
-
| InvalidArgument | If the source 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: