From 3e45c5cfdffdac18b857d24fb39a4d81abdfb446 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 1 Jun 2020 09:01:46 +0000 Subject: [PATCH] added more json write macros --- mio/lib/mio-json.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mio/lib/mio-json.h b/mio/lib/mio-json.h index c58bec0..e1a9c88 100644 --- a/mio/lib/mio-json.h +++ b/mio/lib/mio-json.h @@ -293,12 +293,21 @@ MIO_EXPORT int mio_jsonwr_write ( #define mio_jsonwr_writekeywithuchars(jsonwr,dptr,dlen) mio_jsonwr_write(jsonwr, MIO_JSON_INST_KEY, 1, dptr, dlen) #define mio_jsonwr_writekeywithbchars(jsonwr,dptr,dlen) mio_jsonwr_write(jsonwr, MIO_JSON_INST_KEY, 0, dptr, dlen) +#define mio_jsonwr_writekeywithucstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_KEY, 1, dptr, mio_count_ucstr(dptr)) +#define mio_jsonwr_writekeywithbcstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_KEY, 0, dptr, mio_count_bcstr(dptr)) + #define mio_jsonwr_writenumberwithuchars(jsonwr,dptr,dlen) mio_jsonwr_write(jsonwr, MIO_JSON_INST_NUMBER, 1, dptr, dlen) #define mio_jsonwr_writenumberwithbchars(jsonwr,dptr,dlen) mio_jsonwr_write(jsonwr, MIO_JSON_INST_NUMBER, 0, dptr, dlen) +#define mio_jsonwr_writenumberwithucstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_NUMBER, 1, dptr, mio_count_ucstr(dptr)) +#define mio_jsonwr_writenumberwithbcstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_NUMBER, 0, dptr, mio_count_bcstr(dptr)) + #define mio_jsonwr_writestringwithuchars(jsonwr,dptr,dlen) mio_jsonwr_write(jsonwr, MIO_JSON_INST_STRING, 1, dptr, dlen) #define mio_jsonwr_writestringwithbchars(jsonwr,dptr,dlen) mio_jsonwr_write(jsonwr, MIO_JSON_INST_STRING, 0, dptr, dlen) +#define mio_jsonwr_writestringwithucstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_STRING, 1, dptr, mio_count_ucstr(dptr)) +#define mio_jsonwr_writestringwithbcstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_STRING, 0, dptr, mio_count_bcstr(dptr)) + #if defined(__cplusplus) }