IOFormat 1.12.0
Loading...
Searching...
No Matches
WriterPlugin.h
1#pragma once
2
3#include <memory>
4#include <string>
5
6#include <iolink/storage/StreamAccess.h>
7#include <iolink/view/View.h>
8#include <iolink/writer/Writer.h>
9
10#include <ioformat/OptionMap.h>
11#include <ioformat/plugin/FormatPlugin.h>
12
13namespace ioformat
14{
15
23{
24public:
28 static constexpr uint64_t PLUGIN_API_VERSION = 2;
29
36 inline uint64_t api() const final override { return PLUGIN_API_VERSION; }
37
52 virtual std::shared_ptr<iolink::Writer> open(std::shared_ptr<iolink::View> src,
53 const std::string& dst,
54 const std::string& format,
55 const OptionMap& options) = 0;
56
71 virtual std::shared_ptr<iolink::Writer> open(std::shared_ptr<iolink::View> src,
72 std::shared_ptr<iolink::StreamAccess> dst,
73 const std::string& format,
74 const OptionMap& options) = 0;
75};
76
82#define IOFORMAT_WRITER_PLUGIN_TOKEN ioformat_writer_plugin
83
91#define IOFORMAT_WRITER_PLUGIN_SYMBOL "ioformat_writer_plugin"
92
101#define IOFORMAT_DECLARE_WRITER_PLUGIN(PLUGIN_CLASS) IOFORMAT_DECLARE_PLUGIN(PLUGIN_CLASS, IOFORMAT_WRITER_PLUGIN_TOKEN)
102
103} // namespace ioformat
Plugin class for format encoding/decoding.
Definition FormatPlugin.h:15
A map of heterogeneous options.
Definition OptionMap.h:34
Writer plugin interface.
Definition WriterPlugin.h:23
uint64_t api() const final override
Get the API version of the plugin.
Definition WriterPlugin.h:36
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.
static constexpr uint64_t PLUGIN_API_VERSION
The actual API version of that plugin.
Definition WriterPlugin.h:28
Global namespace which contains all methods to encode/decode data from/into different resources (file...
Definition Error.h:6