json_buf_inspect: wip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
diff --git a/json/json.c b/json/json.c
index 165f45f..2d5de5f 100644
--- a/json/json.c
+++ b/json/json.c
@@ -13,7 +13,41 @@
#include <libkc3/kc3.h>
#include "json.h"
-
+s_tag * json_buf_inspect (s_buf *buf, s_tag *tag)
+{
+ sw r;
+ assert(buf);
+ assert(dest);
+ switch (tag->type) {
+ case TAG_MAP:
+ return json_buf_inspect_map(buf, dest);
+ case TAG_STR:
+ return json_buf_inspect_str(buf, dest);
+ case TAG_F32:
+ case TAG_F64:
+ case TAG_F128:
+ case TAG_INTEGER:
+ case TAG_S8:
+ case TAG_S16:
+ case TAG_S32:
+ case TAG_S64:
+ case TAG_SW;
+ case TAG_U8:
+ case TAG_U16:
+ case TAG_U32:
+ case TAG_U64:
+ case TAG_UW:
+ return json_buf_inspect_number(buf, dest);
+ break;
+ case 't':
+ case 'f':
+ return json_buf_parse_bool(buf, dest);
+ break;
+ default:
+ return NULL;
+ }
+ return NULL;
+}
s_tag * json_buf_parse (s_buf *buf, s_tag *dest)
{