bufr2synop 0.24.0
|
This file has the code which functions to print BUFR data in json format. More...
#include "bufrdeco.h"
Go to the source code of this file.
Functions | |
buf_t | bufrdeco_print_json_scape_string_cvals (FILE *out, char *source) |
prints a descriptor string value scaping the '"' for a json format More... | |
buf_t | bufrdeco_print_json_subset_data_prologue (FILE *out, struct bufrdeco *b) |
buf_t | bufrdeco_print_json_subset_data_epilogue (FILE *out) |
buf_t | bufrdeco_print_json_sequence_descriptor_header (FILE *out, struct bufr_sequence *seq) |
Print the header of a sequence descriptor (f == 3) More... | |
buf_t | bufrdeco_print_json_sequence_descriptor_final (FILE *out) |
buf_t | bufrdeco_print_json_object_atom_data (FILE *out, struct bufr_atom_data *a, char *add) |
Print an json object with a descriptor data. More... | |
buf_t | bufrdeco_print_json_object_operator_descriptor (FILE *out, struct bufr_descriptor *d, char *add) |
print an operator desciptor as a json object More... | |
buf_t | bufrdeco_print_json_object_replicator_descriptor (FILE *out, struct bufr_descriptor *d, char *add) |
print an operator desciptor as a json object More... | |
buf_t | bufrdeco_print_json_separator (FILE *out) |
Print the comma ',' separator in an output. More... | |
buf_t | bufrdeco_print_json_sec0 (FILE *out, struct bufrdeco *b) |
buf_t | bufrdeco_print_json_sec1 (FILE *out, struct bufrdeco *b) |
Print info form sec 1 in json format. More... | |
buf_t | bufrdeco_print_json_sec2 (FILE *out, struct bufrdeco *b) |
Print info form optional sec 2 in json format. More... | |
buf_t | bufrdeco_print_json_sec3 (FILE *out, struct bufrdeco *b) |
Print info form sec 3 in json format. More... | |
buf_t | bufrdeco_print_json_tree_recursive (FILE *out, struct bufrdeco *b, struct bufr_sequence *seq) |
Print a tree of descriptors to a file in a recursive way in json format. More... | |
buf_t | bufrdeco_print_json_tree (struct bufrdeco *b) |
This file has the code which functions to print BUFR data in json format.
Definition in file bufrdeco_json.c.
buf_t bufrdeco_print_json_object_atom_data | ( | FILE * | out, |
struct bufr_atom_data * | a, | ||
char * | add | ||
) |
Print an json object with a descriptor data.
out | output stream opened by caller |
a | pointer to target struct bufr_atom_data |
add | adtional optional info |
There are four cases of objects, depending of data type { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"name_of_unit", "value":"string_value"} { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"Code table", "value":"numeric_value", "meaning":"explanation_string} { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"Flag value", "value":"numeric_value", "meaning":"explanation_string} { "descriptor":"f xx yyy", "name":"name_of_descriptor" , "unit":"name_of_unit", "value":"numeric_value"}
Definition at line 134 of file bufrdeco_json.c.
References bufr_adjust_string(), bufrdeco_print_json_scape_string_cvals(), bufr_atom_data::ctable, bufr_atom_data::cval, bufr_atom_data::desc, DESCRIPTOR_HAVE_STRING_VALUE, DESCRIPTOR_IS_CODE_TABLE, DESCRIPTOR_IS_FLAG_TABLE, DESCRIPTOR_VALUE_MISSING, bufr_atom_data::escale, bufr_descriptor::f, get_formatted_value_from_escale2(), bufr_atom_data::mask, bufr_atom_data::name, bufr_atom_data::unit, bufr_atom_data::val, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), bufrdeco_decode_subset_data_recursive(), and bufrdeco_parse_f2_descriptor().
buf_t bufrdeco_print_json_object_operator_descriptor | ( | FILE * | out, |
struct bufr_descriptor * | d, | ||
char * | add | ||
) |
print an operator desciptor as a json object
out | output stream opened by caller |
d | pointer to operator descriptor |
add | adtional optional info |
Definition at line 203 of file bufrdeco_json.c.
References bufrdeco_get_f2_descriptor_explanation(), bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
buf_t bufrdeco_print_json_object_replicator_descriptor | ( | FILE * | out, |
struct bufr_descriptor * | d, | ||
char * | add | ||
) |
print an operator desciptor as a json object
out | string where to print |
d | pointer to operator descriptor |
add | additional info |
Definition at line 230 of file bufrdeco_json.c.
References bufr_descriptor::f, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
buf_t bufrdeco_print_json_scape_string_cvals | ( | FILE * | out, |
char * | source | ||
) |
prints a descriptor string value scaping the '"' for a json format
out | output stream |
source | source string |
Definition at line 33 of file bufrdeco_json.c.
Referenced by bufrdeco_print_json_object_atom_data().
Definition at line 280 of file bufrdeco_json.c.
References bufr_sec0::bufr_length, bufrdeco_assert, bufr_sec0::edition, and bufrdeco::sec0.
Referenced by bufrdeco_read_buffer().
Print info form sec 1 in json format.
out | string where to print |
b | actuve struct bufrdeco |
Definition at line 300 of file bufrdeco_json.c.
References bufr_tables::b, bufrdeco_assert, bufr_tables::c, bufr_sec1::category, bufr_sec1::centre, bufr_tables::d, bufr_sec1::day, bufr_sec0::edition, bufr_sec1::hour, bufr_sec1::length, bufr_sec1::master, bufr_sec1::master_local, bufr_sec1::master_version, bufr_sec1::minute, bufr_sec1::month, bufr_sec1::options, bufr_tableB::path, bufr_tableC::path, bufr_tableD::path, bufrdeco::sec0, bufrdeco::sec1, bufr_sec1::second, bufr_sec1::subcategory, bufr_sec1::subcategory_local, bufr_sec1::subcentre, bufrdeco::tables, bufr_sec1::update, and bufr_sec1::year.
Referenced by bufrdeco_read_buffer().
Print info form optional sec 2 in json format.
out | string where to print |
b | actuve struct bufrdeco |
Definition at line 350 of file bufrdeco_json.c.
References bufrdeco_assert, bufr_sec2::length, bufr_sec1::options, bufrdeco::sec1, and bufrdeco::sec2.
Referenced by bufrdeco_read_buffer().
Print info form sec 3 in json format.
out | string where to print |
b | actuve struct bufrdeco |
Definition at line 372 of file bufrdeco_json.c.
References bufrdeco_assert, bufr_sec3::compressed, bufr_descriptor::f, bufr_sec3::length, bufr_sec3::ndesc, bufr_sec3::observed, bufrdeco::sec3, bufr_sec3::subsets, bufr_sec3::unexpanded, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_read_buffer().
buf_t bufrdeco_print_json_separator | ( | FILE * | out | ) |
Print the comma ',' separator in an output.
out | string where to print |
Definition at line 267 of file bufrdeco_json.c.
Referenced by bufr_decode_subset_data_compressed(), bufrdeco_decode_replicated_subsequence(), bufrdeco_decode_subset_data_recursive(), and bufrdeco_parse_f2_descriptor().
buf_t bufrdeco_print_json_sequence_descriptor_final | ( | FILE * | out | ) |
Definition at line 110 of file bufrdeco_json.c.
Referenced by bufr_decode_subset_data_compressed(), and bufrdeco_decode_subset_data_recursive().
buf_t bufrdeco_print_json_sequence_descriptor_header | ( | FILE * | out, |
struct bufr_sequence * | seq | ||
) |
Print the header of a sequence descriptor (f == 3)
out | output stream opened by caller |
seq | pointer to a bufr_sequence bufr_sequence |
Definition at line 94 of file bufrdeco_json.c.
References bufr_sequence::key, and bufr_sequence::name.
Referenced by bufr_decode_subset_data_compressed(), and bufrdeco_decode_subset_data_recursive().
buf_t bufrdeco_print_json_subset_data_epilogue | ( | FILE * | out | ) |
Definition at line 77 of file bufrdeco_json.c.
Referenced by bufr_decode_subset_data_compressed(), and bufrdeco_decode_subset_data_recursive().
Definition at line 58 of file bufrdeco_json.c.
References bufrdeco_assert, gts_header::filename, bufrdeco::header, bufrdeco::seq, and bufrdeco_subset_sequence_data::ss.
Referenced by bufr_decode_subset_data_compressed(), and bufrdeco_decode_subset_data_recursive().
Definition at line 508 of file bufrdeco_json.c.
References bufrdeco_assert, BUFRDECO_OUTPUT_JSON_EXPANDED_TREE, bufrdeco_print_json_tree_recursive(), bufrdeco::mask, and bufrdeco::out.
Referenced by main().
buf_t bufrdeco_print_json_tree_recursive | ( | FILE * | out, |
struct bufrdeco * | b, | ||
struct bufr_sequence * | seq | ||
) |
Print a tree of descriptors to a file in a recursive way in json format.
out | stream opened by caller |
b | pointer to the basic container struct bufrdeco |
seq | pointer to the struct bufr_sequence to print |
Definition at line 405 of file bufrdeco_json.c.
References bufr_tables::b, bufr_adjust_string(), bufr_find_tableB_index(), bufrdeco_assert, bufrdeco_get_f2_descriptor_explanation(), bufrdeco_print_json_tree_recursive(), bufr_descriptor::c, bufr_descriptor::f, is_a_delayed_descriptor(), is_a_short_delayed_descriptor(), bufr_tableB::item, bufr_sequence::lseq, bufr_sequence::name, bufr_tableB_decoded_item::name, bufr_sequence::ndesc, bufr_sequence::replicated, bufrdeco_expanded_tree::seq, bufr_sequence::sons, bufrdeco::tables, bufrdeco::tree, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_print_json_tree(), and bufrdeco_print_json_tree_recursive().