4#include <dballe/file.h>
56 Encoding
encoding()
const override {
return Encoding::BUFR; }
58 void write(
const std::string& msg)
override;
67 Encoding
encoding()
const override {
return Encoding::CREX; }
69 void write(
const std::string& msg)
override;
78 Encoding
encoding()
const override {
return Encoding::JSON; }
80 void write(
const std::string& msg)
override;
Binary message.
Definition: file.h:131
File object for doing I/O on binary message streams.
Definition: file.h:18
Definition: core/file.h:51
BinaryMessage read() override
Read a message from the file.
Encoding encoding() const override
Get the file encoding.
Definition: core/file.h:56
void write(const std::string &msg) override
Append the binary message to the file.
Definition: core/file.h:62
BinaryMessage read() override
Read a message from the file.
void write(const std::string &msg) override
Append the binary message to the file.
Encoding encoding() const override
Get the file encoding.
Definition: core/file.h:67
Base for dballe::File implementations.
Definition: core/file.h:16
static std::unique_ptr< dballe::File > open_test_data_file(Encoding type, const std::string &name)
Open a test data file.
FILE * fd
FILE structure used to read or write to the file.
Definition: core/file.h:21
std::string pathname() const override
Get the file pathname.
Definition: core/file.h:31
std::string m_name
Name of the file.
Definition: core/file.h:19
int idx
Index of the last message read from the file or written to the file.
Definition: core/file.h:25
static std::string resolve_test_data_file(const std::string &name)
Resolve the location of a test data file.
bool close_on_exit
True if fd should be closed on destruction.
Definition: core/file.h:23
void close() override
Close the underlying file.
Definition: core/file.h:73
void write(const std::string &msg) override
Append the binary message to the file.
BinaryMessage read() override
Read a message from the file.
Encoding encoding() const override
Get the file encoding.
Definition: core/file.h:78