1#ifndef WREPORT_BUFR_INPUT_H
2#define WREPORT_BUFR_INPUT_H
6#include <wreport/bulletin.h>
8#include <wreport/var.h>
22 unsigned subset_count;
24 : out(out), subset_count(subset_count)
30 for (
unsigned i = 0; i < subset_count; ++i)
31 out.
subsets[i].store_variable_undef(info);
33 void add_same(
const Var& var)
35 for (
unsigned i = 0; i < subset_count; ++i)
38 void add_var(
unsigned subset,
Var&& var)
40 out.
subsets[subset].store_variable(var);
99 explicit Input(
const std::string& in);
135 return (
unsigned)
data[pos];
139 inline unsigned read_byte(
unsigned section,
unsigned pos)
const
141 return (
unsigned)
data[
sec[section] + pos];
148 for (
unsigned i = 0; i < byte_len; ++i)
151 res |=
data[pos + i];
161 unsigned byte_len)
const
176 "end of buffer while looking for %u bits of bit-packed data",
183 for (
unsigned i = 0; i < n; i++)
207 "end of buffer while looking for %u bits of bit-packed data",
210 for (
unsigned i = 0; i < n; i++)
224 const std::vector<unsigned>& groups = {})
const;
241 void parse_error(
unsigned section,
unsigned pos, const
char* fmt, ...) const
257 const
char* expected);
274 size_t datalen, const
char* expected);
291 size_t datalen, const
char* expected);
328 std::function<
void(
unsigned,
Var&&)> dest);
340 const bulletin::AssociatedField& afield,
342 std::function<
void(
unsigned,
Var&&)> dest);
373 bool decode_string(
unsigned bit_len,
char* str,
size_t& len);
386 void decode_string(
Var& dest);
399 void decode_string(
Var& dest,
unsigned subsets);
405 void decode_string(
Varinfo info,
unsigned subsets,
406 std::function<
void(
unsigned,
Var&&)> dest);
Storage for the decoded data of a BUFR or CREX message.
Definition bulletin.h:30
std::vector< Subset > subsets
Decoded variables.
Definition bulletin.h:124
A physical variable.
Definition var.h:25
#define WREPORT_THROWF_ATTRS(a, b)
Tell the compiler that a function always throws and expects printf-style arguments.
Definition error.h:56
String functions.
Definition benchmark.h:13
Information about a variable.
Definition varinfo.h:140
Definition associated_fields.h:13