From 6c910330c4eac6b4461f460bfabc4cbb62be810c Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Thu, 6 Sep 2018 05:00:42 +0000 Subject: Fix json parsing for Struct, ListValue and Value. --- upb/def.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'upb/def.c') diff --git a/upb/def.c b/upb/def.c index b3114cd..0c154e6 100644 --- a/upb/def.c +++ b/upb/def.c @@ -1339,6 +1339,9 @@ bool upb_fielddef_checkdescriptortype(int32_t type) { static const char *kDurationFullMessageName = "google.protobuf.Duration"; static const char *kTimestampFullMessageName = "google.protobuf.Timestamp"; +static const char *kValueFullMessageName = "google.protobuf.Value"; +static const char *kListValueFullMessageName = "google.protobuf.ListValue"; +static const char *kStructFullMessageName = "google.protobuf.Struct"; static void visitmsg(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure) { @@ -1604,6 +1607,18 @@ bool upb_msgdef_timestamp(const upb_msgdef *m) { return strcmp(upb_msgdef_fullname(m), kTimestampFullMessageName) == 0; } +bool upb_msgdef_value(const upb_msgdef *m) { + return strcmp(upb_msgdef_fullname(m), kValueFullMessageName) == 0; +} + +bool upb_msgdef_listvalue(const upb_msgdef *m) { + return strcmp(upb_msgdef_fullname(m), kListValueFullMessageName) == 0; +} + +bool upb_msgdef_structvalue(const upb_msgdef *m) { + return strcmp(upb_msgdef_fullname(m), kStructFullMessageName) == 0; +} + void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m) { upb_inttable_begin(iter, &m->itof); } -- cgit v1.2.3