1#ifndef DBALLE_IMPORTER_H
2#define DBALLE_IMPORTER_H
27 bool simplified =
true;
29 enum class DomainErrors
35 } domain_errors = DomainErrors::THROW;
48 static std::unique_ptr<ImporterOptions>
create();
51 static std::unique_ptr<ImporterOptions>
create(
const std::string& s);
138 static std::unique_ptr<Importer>
create(Encoding type,
const std::string& opts);
145 using Importer::Importer;
Binary message.
Definition: file.h:131
Definition: importer.h:143
std::vector< std::shared_ptr< Message > > from_bulletin(const wreport::Bulletin &msg) const override=0
Import a decoded BUFR/CREX message.
Options to control message import.
Definition: importer.h:25
static std::unique_ptr< ImporterOptions > create()
Create with default values.
void print(FILE *out)
Print a summary of the options to out.
static std::unique_ptr< ImporterOptions > create(const std::string &s)
Opposite of to_string: create an Options from a string.
static const ImporterOptions defaults
Default importer options.
Definition: importer.h:54
std::string to_string() const
Generate a string summary of import options.
Message importer interface.
Definition: importer.h:72
std::vector< std::shared_ptr< Message > > from_binary(const BinaryMessage &msg) const
Decode a message from its raw encoded representation.
static std::unique_ptr< Importer > create(Encoding type, const ImporterOptions &opts=ImporterOptions::defaults)
Instantiate an importer.
static std::unique_ptr< Importer > create(Encoding type, const std::string &opts)
Instantiate an importer.
virtual std::vector< std::shared_ptr< Message > > from_bulletin(const wreport::Bulletin &msg) const
Import a decoded BUFR/CREX message.
virtual bool foreach_decoded(const BinaryMessage &msg, std::function< bool(std::shared_ptr< Message >)> dest) const =0
Decode a message from its raw encoded representation, calling dest on each resulting Message.
virtual Encoding encoding() const =0
Return the encoding for this importer.