1 #ifndef WREPORT_BUFR_INPUT_H 2 #define WREPORT_BUFR_INPUT_H 5 #include <wreport/var.h> 6 #include <wreport/bulletin.h> 22 unsigned subset_count;
27 for (
unsigned i = 0; i < subset_count; ++i)
28 out.
subsets[i].store_variable_undef(info);
30 void add_same(
const Var& var)
32 for (
unsigned i = 0; i < subset_count; ++i)
35 void add_var(
unsigned subset,
Var&& var)
37 out.
subsets[subset].store_variable(var);
98 explicit Input(
const std::string& in);
131 return (
unsigned)
data[pos];
135 inline unsigned read_byte(
unsigned section,
unsigned pos)
const 137 return (
unsigned)
data[
sec[section] + pos];
144 for (
unsigned i = 0; i < byte_len; ++i)
147 res |=
data[pos + i];
156 inline unsigned read_number(
unsigned section,
unsigned pos,
unsigned byte_len)
const 170 parse_error(
"end of buffer while looking for %u bits of bit-packed data", n);
176 for (
unsigned i = 0; i < n; i++)
199 parse_error(
"end of buffer while looking for %u bits of bit-packed data", n);
201 for (
unsigned i = 0; i < n; i++)
214 void debug_dump_next_bits(
const char* desc,
unsigned count,
const std::vector<unsigned>& groups={})
const;
312 void decode_string(
Varinfo info,
unsigned subsets, DispatchToSubsets& dest);
351 bool decode_string(
unsigned bit_len,
char* str,
size_t& len);
364 void decode_string(
Var& dest);
377 void decode_string(
Var& dest,
unsigned subsets);
383 void decode_string(
Varinfo info,
unsigned subsets,
std::function<
void(
unsigned,
Var&&)> dest);
A physical variable.
Definition: var.h:24
Storage for the decoded data of a BUFR or CREX message.
Definition: bulletin.h:29
std::vector< Subset > subsets
Decoded variables.
Definition: bulletin.h:122
Information about a variable.
Definition: varinfo.h:138
String functions.
Definition: benchmark.h:13
Definition: associated_fields.h:12
#define WREPORT_THROWF_ATTRS(a, b)
Tell the compiler that a function always throws and expects printf-style arguments.
Definition: error.h:56