Skip to content

Commit

Permalink
add measurement units and more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kritibirda26 committed Aug 20, 2024
1 parent d50b2bf commit 3988f26
Show file tree
Hide file tree
Showing 4 changed files with 470 additions and 16 deletions.
1 change: 1 addition & 0 deletions vector/v.to.db/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ int print_stat(void);

/* units.c */
int conv_units(void);
void get_unit_name(char *);

/* update.c */
int update(struct Map_info *);
5 changes: 5 additions & 0 deletions vector/v.to.db/report.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ int report(enum OutputFormat format)
JSON_Value *records_value, *record_value, *root_value;
JSON_Array *records_array;
JSON_Object *record, *root_object;
// todo: add measurement unit

if (format == JSON) {
root_value = json_value_init_object();
root_object = json_object(root_value);
records_value = json_value_init_array();
records_array = json_array(records_value);

char unit_name[20];
get_unit_name(unit_name);
json_object_set_string(root_object, "unit", unit_name);
}

int i, print_header = G_verbose() > G_verbose_min() || options.print_header;
Expand Down
Loading

0 comments on commit 3988f26

Please sign in to comment.