summaryrefslogtreecommitdiff
path: root/upb/def.c
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2018-08-24 16:10:07 -0700
committerGitHub <noreply@github.com>2018-08-24 16:10:07 -0700
commit38d674e86f4d5b368e37e20d31a44c2924de6998 (patch)
tree64d3333d0c39240bfb2a67fe6b8bef7c48753be9 /upb/def.c
parentd1738d4dec31bc803b0db5c59cd5b40e929b01c0 (diff)
Fix json parsing for timestamp (#115)
* Fix json parsing for timestamp * Fix json encoding for timestamp * Implement timestamp_machine to parse timestamp * Remove comparision for size_t and 0 * Increase defined printer size * Increase size * Increase parser size * Mark json_en_timestamp_machine unused
Diffstat (limited to 'upb/def.c')
-rw-r--r--upb/def.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/upb/def.c b/upb/def.c
index 60bbb84..4423053 100644
--- a/upb/def.c
+++ b/upb/def.c
@@ -1337,6 +1337,8 @@ bool upb_fielddef_checkdescriptortype(int32_t type) {
/* upb_msgdef *****************************************************************/
+static const char *kTimestampFullMessageName = "google.protobuf.Timestamp";
+
static void visitmsg(const upb_refcounted *r, upb_refcounted_visit *visit,
void *closure) {
upb_msg_oneof_iter o;
@@ -1593,6 +1595,10 @@ bool upb_msgdef_mapentry(const upb_msgdef *m) {
return m->map_entry;
}
+bool upb_msgdef_timestamp(const upb_msgdef *m) {
+ return strcmp(upb_msgdef_fullname(m), kTimestampFullMessageName) == 0;
+}
+
void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m) {
upb_inttable_begin(iter, &m->itof);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback