Lines Matching refs:item

36     cJSON *item = nullptr;
37 cJSON_ArrayForEach(item, object) {
38 if (item->type == cJSON_String) {
39 std::string strVal = DT_SetGetString(&g_Element[idx], strlen(item->valuestring) + 1, DEFAULT_LENGTH,
40 (char*)item->valuestring);
42 if (item->valuestring != nullptr) {
43 cJSON_free(item->valuestring); // 释放原字符串内存
45 item->valuestring = nullptr;
50 item->valuestring = reinterpret_cast<char*>(ptr);
52 errno_t ret1 = strcpy_s(item->valuestring, length, strVal.c_str()); // 复制字符串内容
56 } else if (item->type == cJSON_Number) {
57 int intVal = *(s32 *)DT_SetGetS32(&g_Element[idx], item->valueint);
59 item->valueint = intVal;
60 } else if (item->type == cJSON_True || item->type == cJSON_False) {
65 item->type = ret ? cJSON_True : cJSON_False;
66 } else if (item->type == cJSON_Object) {
68 cJSON_ArrayForEach(arrayItem, item) {
71 } else if (item->type == cJSON_Array) {
73 cJSON_ArrayForEach(objItem, item) {
85 cJSON *item = nullptr;
86 cJSON_ArrayForEach(item, object) {
87 if (item->type == cJSON_String) {
90 item->type = cJSON_Number;
91 item->valuedouble = static_cast<double>(intValue);
92 item->valueint = intValue;
93 if (item->valuestring != nullptr) {
94 cJSON_free(item->valuestring); // 释放原字符串内存
96 item->valuestring = nullptr;
97 } else if (item->type == cJSON_Number || item->type == cJSON_True || item->type == cJSON_False) {
101 item->type = cJSON_String;
105 item->valuestring = reinterpret_cast<char*>(ptr);
107 errno_t ret2 = strcpy_s(item->valuestring, length, strVal.c_str()); // 复制字符串内容
111 } else if (item->type == cJSON_Object) {
113 cJSON_ArrayForEach(arrayItem, item) {
116 } else if (item->type == cJSON_Array) {
118 cJSON_ArrayForEach(objItem, item) {