IOFormat 1.12.0
Loading...
Searching...
No Matches
ExtractorPlugin.h
1#pragma once
2
3#include <memory>
4
5#include <iolink/storage/RandomAccess.h>
6#include <iolink/storage/StreamAccess.h>
7#include <iolink/view/View.h>
8
9#include <ioformat/OptionMap.h>
10#include <ioformat/plugin/FormatPlugin.h>
11
12namespace ioformat
13{
14
22{
23public:
27 static constexpr uint64_t PLUGIN_API_VERSION = 2;
28
35 inline uint64_t api() const final override { return PLUGIN_API_VERSION; }
36
49 virtual std::shared_ptr<iolink::View> open(const std::string& src,
50 const std::string& format,
51 const OptionMap& options) = 0;
52
65 virtual std::shared_ptr<iolink::View> open(std::shared_ptr<iolink::StreamAccess> src,
66 const std::string& format,
67 const OptionMap& options) = 0;
68
81 virtual std::shared_ptr<iolink::View> open(std::shared_ptr<iolink::RandomAccess> src,
82 const std::string& format,
83 const OptionMap& options) = 0;
84};
85
91#define IOFORMAT_EXTRACTOR_PLUGIN_TOKEN ioformat_extractor_plugin
92
100#define IOFORMAT_EXTRACTOR_PLUGIN_SYMBOL "ioformat_extractor_plugin"
101
110#define IOFORMAT_DECLARE_EXTRACTOR_PLUGIN(PLUGIN_CLASS) \
111 IOFORMAT_DECLARE_PLUGIN(PLUGIN_CLASS, IOFORMAT_EXTRACTOR_PLUGIN_TOKEN)
112
113} // namespace ioformat
Extractor plugin interface.
Definition ExtractorPlugin.h:22
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(const std::string &src, const std::string &format, const OptionMap &options)=0
Open a file for reading.
static constexpr uint64_t PLUGIN_API_VERSION
The actual API version of that plugin.
Definition ExtractorPlugin.h:27
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.
uint64_t api() const final override
Get the API version of the plugin.
Definition ExtractorPlugin.h:35
Plugin class for format encoding/decoding.
Definition FormatPlugin.h:15
A map of heterogeneous options.
Definition OptionMap.h:34
Global namespace which contains all methods to encode/decode data from/into different resources (file...
Definition Error.h:6