IOFormat 1.12.0
Loading...
Searching...
No Matches
ioformat::ExtractorPlugin Class Referenceabstract

Extractor plugin interface. More...

#include <ioformat/plugin/ExtractorPlugin.h>

Inherits ioformat::FormatPlugin.

Public Member Functions

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.
 
- Public Member Functions inherited from ioformat::FormatPlugin
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.
 
- Public Member Functions inherited from ioformat::Plugin
virtual const std::string & name () const =0
 Get the name of the plugin.
 
virtual const PluginVersionversion () const =0
 Get the version of the plugin.
 
virtual void initLog (iolink::LogLevel level)=0
 Initialize the plugin's logger.
 

Static Public Attributes

static constexpr uint64_t PLUGIN_API_VERSION = 2
 The actual API version of that plugin.
 

Additional Inherited Members

- Public Types inherited from ioformat::Plugin
using StringSet = std::unordered_set< std::string >
 
using StringMap = std::unordered_map< std::string, std::string >
 

Detailed Description

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.

Member Function Documentation

◆ 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
srcThe source file path.
formatThe format to read.
optionsThe options to use.
Returns
A view instance.
Exceptions
InvalidArgumentIf the source is not supported.
UnsupportedFormatIf the format is not supported.
Errorif 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
srcThe source random access.
formatThe format to read.
optionsThe options to use.
Returns
A view instance.
Exceptions
InvalidArgumentIf the source is not supported.
UnsupportedFormatIf the format is not supported.
Errorif 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
srcThe source stream.
formatThe format to read.
optionsThe options to use.
Returns
A view instance.
Exceptions
InvalidArgumentIf the source is not supported.
UnsupportedFormatIf the format is not supported.
Errorif an internal error occurs.

The documentation for this class was generated from the following file: