forked from OSGeo/grass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v.info: add JSON support (OSGeo#3755)
Use parson to have JSON as an output format support. The module has various flags to control the fields being output in case of plain shell format controlled by flags. All (-get) of these are enabled when using format=shell. format=plain now allows use of flags. This may need special handling in the future to resolve the edge cases in a better way.
- Loading branch information
1 parent
04fd63c
commit f3204e7
Showing
8 changed files
with
491 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
#include <grass/vector.h> | ||
#include <grass/parson.h> | ||
|
||
#define SHELL_NO 0x00 | ||
#define SHELL_BASIC 0x02 | ||
#define SHELL_REGION 0x04 | ||
#define SHELL_TOPO 0x08 | ||
|
||
enum OutputFormat { PLAIN, SHELL, JSON }; | ||
|
||
/* level1.c */ | ||
int level_one_info(struct Map_info *); | ||
|
||
/* parse.c */ | ||
void parse_args(int, char **, char **, char **, int *, int *, int *); | ||
void parse_args(int, char **, char **, char **, int *, int *, int *, | ||
enum OutputFormat *); | ||
|
||
/* print.c */ | ||
void format_double(double, char *); | ||
void print_region(struct Map_info *); | ||
void print_topo(struct Map_info *); | ||
void print_region(struct Map_info *, enum OutputFormat, JSON_Object *); | ||
void print_topo(struct Map_info *, enum OutputFormat, JSON_Object *); | ||
void print_columns(struct Map_info *, const char *, const char *); | ||
void print_info(struct Map_info *); | ||
void print_shell(struct Map_info *, const char *); | ||
void print_shell(struct Map_info *, const char *, enum OutputFormat, | ||
JSON_Object *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.