From 0c89dd260349352a8cabda29b45ce87fec335c8e Mon Sep 17 00:00:00 2001 From: liuxueli Date: Wed, 29 Jul 2020 18:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=94=AF=E6=8C=81=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=B5=8C=E5=A5=97json=EF=BC=8C=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E8=80=85=E9=9C=80=E4=BC=A0cJSON=20*object?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/tsg_send_log.h | 1 + src/tsg_send_log.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/tsg_send_log.h b/inc/tsg_send_log.h index a609503..711f45b 100644 --- a/inc/tsg_send_log.h +++ b/inc/tsg_send_log.h @@ -18,6 +18,7 @@ typedef enum _tld_type TLD_TYPE_STRING, TLD_TYPE_FILE, TLD_TYPE_TOPIC, + TLD_TYPE_CJSON, // cJSON *object TLD_TYPE_MAX }TLD_TYPE; diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index d62854b..9f03e05 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -19,7 +19,7 @@ #include "tsg_send_log.h" #include "tsg_send_log_internal.h" -char TSG_SEND_LOG_VERSION_20200724=0; +char TSG_SEND_LOG_VERSION_20200729=0; struct tsg_log_instance_t *g_tsg_log_instance; @@ -113,6 +113,9 @@ int TLD_append(struct TLD_handle_t *handle, char *key, void *value, TLD_TYPE typ case TLD_TYPE_STRING: cJSON_AddStringToObject(_handle->object, key, (char *)value); break; + case TLD_TYPE_CJSON: + cJSON_AddItemToObject(_handle->object, key, (cJSON *)value); + break; default: return -1; break;