vg
tools for working with variation graphs
|
#include <errno.h>
#include <jansson.h>
#include <google/protobuf/message.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/util/json_util.h>
#include <google/protobuf/struct.pb.h>
#include "vg/io/json2pb.h"
#include <stdexcept>
#include <cstdio>
#include "bin2ascii.h"
Classes | |
struct | json_autoptr |
class | j2pb_error |
Macros | |
#define | json_boolean(val) ((val) ? json_true() : json_false()) |
#define | _CONVERT(type, ctype, fmt, sfunc, afunc) |
#define | _CONVERT_AS_STRING(type, ctype, sfunc, afunc) |
#define | _SET_OR_ADD(sfunc, afunc, value) |
#define | _CONVERT_WITH_STRING(type, ctype, fmt, fromstringfunc, sfunc, afunc) |
Functions | |
void | json2pb (Message &msg, const char *buf, size_t size) |
void | json2pb (Message &msg, FILE *fp) |
void | json2pb (Message &msg, const std::string &data) |
std::string | pb2json (const Message &msg) |
#define _CONVERT | ( | type, | |
ctype, | |||
fmt, | |||
sfunc, | |||
afunc | |||
) |
#define _CONVERT_AS_STRING | ( | type, | |
ctype, | |||
sfunc, | |||
afunc | |||
) |
#define _CONVERT_WITH_STRING | ( | type, | |
ctype, | |||
fmt, | |||
fromstringfunc, | |||
sfunc, | |||
afunc | |||
) |
#define _SET_OR_ADD | ( | sfunc, | |
afunc, | |||
value | |||
) |
#define json_boolean | ( | val | ) | ((val) ? json_true() : json_false()) |
void json2pb | ( | Message & | msg, |
const char * | buf, | ||
size_t | size | ||
) |
void json2pb | ( | Message & | msg, |
const std::string & | data | ||
) |
void json2pb | ( | Message & | msg, |
FILE * | fp | ||
) |
std::string pb2json | ( | const Message & | msg | ) |