Home
last modified time | relevance | path

Searched refs:jsonStr (Results 1 – 25 of 71) sorted by relevance

123

/base/hiviewdfx/hiview/base/event_publish/
Dapp_event_handler.cpp44 …ddVectorToJsonString(const std::string& key, const std::vector<T>& vec, std::stringstream& jsonStr, in AddVectorToJsonString() argument
47 jsonStr << "\"" << key << "\":"; in AddVectorToJsonString()
49 jsonStr << "[]" << (isLastValue ? "}" : ","); in AddVectorToJsonString()
52 jsonStr << "["; in AddVectorToJsonString()
53 std::copy(vec.begin(), vec.end() - 1, std::ostream_iterator<T>(jsonStr, ",")); in AddVectorToJsonString()
54 jsonStr << vec.back() << "]" << (isLastValue ? "}" : ","); in AddVectorToJsonString()
58 void AddValueToJsonString(const std::string& key, const T& value, std::stringstream& jsonStr, bool … in AddValueToJsonString() argument
60 jsonStr << "\"" << key << "\":"; in AddValueToJsonString()
62 jsonStr << "\"" << value << "\""; in AddValueToJsonString()
64 jsonStr << (value ? "true" : "false"); in AddValueToJsonString()
[all …]
/base/hiviewdfx/hiview/base/test/unittest/common/
Dsys_event_test.cpp40 std::string jsonStr = "["; in TransNumberVecToStr() local
42 jsonStr.append("]"); in TransNumberVecToStr()
43 return jsonStr; in TransNumberVecToStr()
46 jsonStr.append(std::to_string(num)); in TransNumberVecToStr()
47 jsonStr.append(","); in TransNumberVecToStr()
49 jsonStr.erase(jsonStr.length() - 1); in TransNumberVecToStr()
50 jsonStr.append("]"); in TransNumberVecToStr()
51 return jsonStr; in TransNumberVecToStr()
56 …std::string jsonStr = R"~({"domain_":"DEMO","name_":"NAME1","type_":1,"tz_":"+0800","time_":162027… in GetOriginTestString() local
58 jsonStr.append(R"~("EMPTY_ARRAY":[],"INT_ARRAY1":[)~"); in GetOriginTestString()
[all …]
/base/customization/enterprise_device_management/interfaces/inner_api/plugin_kits/src/utils/
Dstring_serializer.cpp24 std::string jsonStr = jsonString; in Deserialize() local
25 jsonStr.erase(remove(jsonStr.begin(), jsonStr.end(), '\"'), jsonStr.end()); in Deserialize()
26 dataObj = jsonStr; in Deserialize()
/base/msdp/device_status/services/interaction/coordination/src/
Dcoordination_softbus_adapter.cpp352 cJSON *jsonStr = cJSON_CreateObject(); in StartRemoteCoordination() local
353 CHKPR(jsonStr, RET_ERR); in StartRemoteCoordination()
354 …cJSON_AddItemToObject(jsonStr, FI_SOFTBUS_KEY_CMD_TYPE, cJSON_CreateNumber(REMOTE_COORDINATION_STA… in StartRemoteCoordination()
355 …cJSON_AddItemToObject(jsonStr, FI_SOFTBUS_KEY_LOCAL_DEVICE_ID, cJSON_CreateString(localNetworkId.c… in StartRemoteCoordination()
356 cJSON_AddItemToObject(jsonStr, FI_SOFTBUS_KEY_SESSION_ID, cJSON_CreateNumber(sessionId)); in StartRemoteCoordination()
357 …cJSON_AddItemToObject(jsonStr, FI_SOFTBUS_POINTER_BUTTON_IS_PRESS, cJSON_CreateBool(isPointerButto… in StartRemoteCoordination()
358 char *sendMsg = cJSON_Print(jsonStr); in StartRemoteCoordination()
359 cJSON_Delete(jsonStr); in StartRemoteCoordination()
391 cJSON *jsonStr = cJSON_CreateObject(); in StartRemoteCoordinationResult() local
392 CHKPR(jsonStr, RET_ERR); in StartRemoteCoordinationResult()
[all …]
/base/hiviewdfx/hiappevent/frameworks/native/libhiappevent/
Dhiappevent_base.cpp564 std::stringstream jsonStr; in AddCustomParams() local
566 jsonStr << ","; in AddCustomParams()
569 jsonStr << "\"" << it->first << "\":" << it->second << ","; in AddCustomParams()
571 std::string customParamStr = jsonStr.str(); in AddCustomParams()
580 std::stringstream jsonStr; in GetEventStr() local
581 jsonStr << "{"; in GetEventStr()
582 AddBaseInfoToJsonString(jsonStr); in GetEventStr()
583 AddParamsInfoToJsonString(jsonStr); in GetEventStr()
584 jsonStr << "}" << std::endl; in GetEventStr()
585 return jsonStr.str(); in GetEventStr()
[all …]
/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/
Dhisysevent_record_c.cpp28 if (record.jsonStr == nullptr || name == nullptr) { in GetParamValue()
31 HiSysEventRecordCls recordObj(record.jsonStr); in GetParamValue()
37 if (record.jsonStr == nullptr || name == nullptr) { in GetParamValue()
40 HiSysEventRecordCls recordObj(record.jsonStr); in GetParamValue()
51 if (record.jsonStr == nullptr || name == nullptr) { in GetParamValues()
54 HiSysEventRecordCls recordObj(record.jsonStr); in GetParamValues()
76 if (record.jsonStr == nullptr || name == nullptr) { in GetParamValues()
79 HiSysEventRecordCls recordObj(record.jsonStr); in GetParamValues()
92 if (record.jsonStr == nullptr) { in GetParamNames()
95 HiSysEventRecordCls recordObj(record.jsonStr); in GetParamNames()
/base/hiviewdfx/hiview/plugins/usage_event_report/cache/
Djson_parser.cpp40 bool JsonParser::ParseJsonString(Json::Value& eventJson, const std::string& jsonStr) in ParseJsonString() argument
46 return reader->parse(jsonStr.data(), jsonStr.data() + jsonStr.size(), &eventJson, &err); in ParseJsonString()
94 … JsonParser::ParsePluginStatsEvent(std::shared_ptr<LoggerEvent>& event, const std::string& jsonStr) in ParsePluginStatsEvent() argument
98 if (!ParseJsonString(root, jsonStr) || !CheckJsonValue(root, PLUGIN_STATS_FIELDS)) { in ParsePluginStatsEvent()
118 bool JsonParser::ParseSysUsageEvent(std::shared_ptr<LoggerEvent>& event, const std::string& jsonStr) in ParseSysUsageEvent() argument
122 if (!ParseJsonString(root, jsonStr) || !CheckJsonValue(root, SYS_USAGE_FIELDS)) { in ParseSysUsageEvent()
/base/sensors/miscdevice/utils/common/src/
Djson_parser.cpp32 std::string jsonStr = ReadJsonFile(filePath); in JsonParser() local
33 if (jsonStr.empty()) { in JsonParser()
37 cJson_ = cJSON_Parse(jsonStr.c_str()); in JsonParser()
42 std::string jsonStr = ReadFd(rawFd); in JsonParser() local
43 if (jsonStr.empty()) { in JsonParser()
47 cJson_ = cJSON_Parse(jsonStr.c_str()); in JsonParser()
/base/hiviewdfx/hiview/plugins/usage_event_report/cache/include/
Djson_parser.h30 …static bool ParsePluginStatsEvent(std::shared_ptr<LoggerEvent>& event, const std::string& jsonStr);
31 static bool ParseSysUsageEvent(std::shared_ptr<LoggerEvent>& event, const std::string& jsonStr);
33 static bool ParseJsonString(Json::Value& root, const std::string& jsonStr);
/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/include/
Dhisysevent_value.h27 HiSysEventValue(std::string jsonStr) in HiSysEventValue() argument
29 ParseJsonStr(jsonStr); in HiSysEventValue()
56 void ParseJsonStr(const std::string jsonStr);
Dhisysevent_record.h35 HiSysEventRecord(std::string jsonStr) in HiSysEventRecord() argument
37 ParseJsonStr(jsonStr); in HiSysEventRecord()
84 void ParseJsonStr(const std::string jsonStr);
/base/security/permission_lite/services/pms/src/
Dpms_server.c132 char *jsonStr = QueryPermissionString(identifier, &ret); in ReplyQueryPermission() local
133 if (jsonStr == NULL) { in ReplyQueryPermission()
139 free(jsonStr); in ReplyQueryPermission()
142 WriteString(reply, jsonStr); in ReplyQueryPermission()
143 free(jsonStr); in ReplyQueryPermission()
/base/update/updateservice/foundations/ability/utils/include/
Ddupdate_json_utils.h52 static bool ParseAndGetJsonObject(const std::string &jsonStr, nlohmann::json &root) in ParseAndGetJsonObject() argument
54 root = nlohmann::json::parse(jsonStr, nullptr, false); in ParseAndGetJsonObject()
61 static bool ParseAndGetJsonArray(const std::string &jsonStr, nlohmann::json &root) in ParseAndGetJsonArray() argument
63 root = nlohmann::json::parse(jsonStr, nullptr, false); in ParseAndGetJsonArray()
119 template <typename T> static int32_t JsonStrToStruct(const std::string &jsonStr, T &value) in JsonStrToStruct() argument
121 if (jsonStr.empty()) { in JsonStrToStruct()
124 nlohmann::json jsonObj = nlohmann::json::parse(jsonStr, nullptr, false); in JsonStrToStruct()
/base/security/dlp_permission_service/services/dlp_permission/sa/test/unittest/src/
Ddlp_permission_service_test.cpp671 std::string jsonStr = "{\"test\":[]}"; variable
672 Json callbackInfoJson = Json::parse(jsonStr, nullptr, false);
675jsonStr = "{\"recordList\":[{\"bundleName\":\"\",\"docUri\":\"file://media/file/12\",\"userId\":10…
676 callbackInfoJson = Json::parse(jsonStr, nullptr, false);
679jsonStr = "{\"recordList\":[{\"bundleName\":\"com.example.ohnotes\",\"docUri\":\"\",\"userId\":100…
680 callbackInfoJson = Json::parse(jsonStr, nullptr, false);
683 jsonStr =
685 callbackInfoJson = Json::parse(jsonStr, nullptr, false);
688jsonStr = "{\"recordList\":[{\"bundleName\":\"com.example.ohnotes\",\"docUri\":\"file://media/file…
690 callbackInfoJson = Json::parse(jsonStr, nullptr, false);
[all …]
/base/security/device_auth/common_lib/impl/src/
Djson_utils.c26 CJson *CreateJsonFromString(const char *jsonStr) in CreateJsonFromString() argument
28 if (jsonStr == NULL) { in CreateJsonFromString()
31 return cJSON_Parse(jsonStr); in CreateJsonFromString()
114 void FreeJsonString(char *jsonStr) in FreeJsonString() argument
116 if (jsonStr != NULL) { in FreeJsonString()
117 cJSON_free(jsonStr); in FreeJsonString()
535 void ClearAndFreeJsonString(char *jsonStr) in ClearAndFreeJsonString() argument
537 if (jsonStr == NULL) { in ClearAndFreeJsonString()
540 (void)memset_s(jsonStr, strlen(jsonStr), 0, strlen(jsonStr)); in ClearAndFreeJsonString()
541 FreeJsonString(jsonStr); in ClearAndFreeJsonString()
/base/hiviewdfx/hiview/plugins/eventlogger/test/unittest/common/
Devent_logger_test.cpp55 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable
57 nullptr, jsonStr);
77 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable
80 nullptr, jsonStr);
108 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable
110 nullptr, jsonStr);
Devent_logger_plugin_test.cpp119 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable
120 … std::shared_ptr<SysEvent> event = std::make_shared<SysEvent>("Eventlogger004", nullptr, jsonStr);
138 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable
139 … std::shared_ptr<SysEvent> event = std::make_shared<SysEvent>("Eventlogger005", nullptr, jsonStr);
/base/powermgr/power_manager/utils/vibrator/src/
Dvibrator_source_parser.cpp71 std::vector<VibratorSource> VibratorSourceParser::ParseSources(const std::string& jsonStr) in ParseSources() argument
76 if (!reader.parse(jsonStr.data(), jsonStr.data() + jsonStr.size(), root)) { in ParseSources()
/base/powermgr/power_manager/test/unittest/src/
Dpower_parsesources_mock_test.cpp75 static const std::string jsonStr = "{\"powerkey\":"; variable
76 std::shared_ptr<SuspendSources> sources3 = SuspendSourceParser::ParseSources(jsonStr);
79 std::shared_ptr<WakeupSources> sources4 = WakeupSourceParser::ParseSources(jsonStr);
/base/powermgr/power_manager/services/native/src/wakeup_action/
Dwakeup_action_source_parser.cpp79 …:shared_ptr<WakeupActionSources> WakeupActionSourceParser::ParseSources(const std::string& jsonStr) in ParseSources() argument
84 if (!reader.parse(jsonStr.data(), jsonStr.data() + jsonStr.size(), root)) { in ParseSources()
/base/security/device_auth/test/unittest/deviceauth/source/
Djson_utils_mock.c71 CJson *CreateJsonFromString(const char *jsonStr) in CreateJsonFromString() argument
73 if (jsonStr == NULL) { in CreateJsonFromString()
79 return cJSON_Parse(jsonStr); in CreateJsonFromString()
174 void FreeJsonString(char *jsonStr) in FreeJsonString() argument
176 cJSON_free(jsonStr); in FreeJsonString()
593 void ClearAndFreeJsonString(char *jsonStr) in ClearAndFreeJsonString() argument
595 if (jsonStr == NULL) { in ClearAndFreeJsonString()
598 (void)memset_s(jsonStr, strlen(jsonStr), 0, strlen(jsonStr)); in ClearAndFreeJsonString()
599 FreeJsonString(jsonStr); in ClearAndFreeJsonString()
/base/security/device_auth/common_lib/interfaces/
Djson_utils.h32 CJson *CreateJsonFromString(const char *jsonStr);
48 void FreeJsonString(char *jsonStr);
101 void ClearAndFreeJsonString(char *jsonStr);
/base/powermgr/power_manager/services/native/src/wakeup/
Dwakeup_source_parser.cpp90 std::shared_ptr<WakeupSources> WakeupSourceParser::ParseSources(const std::string& jsonStr) in ParseSources() argument
96 if (!reader.parse(jsonStr.data(), jsonStr.data() + jsonStr.size(), root)) { in ParseSources()
/base/powermgr/power_manager/services/native/src/suspend/
Dsuspend_source_parser.cpp89 std::shared_ptr<SuspendSources> SuspendSourceParser::ParseSources(const std::string& jsonStr) in ParseSources() argument
95 if (!reader.parse(jsonStr.data(), jsonStr.data() + jsonStr.size(), root)) { in ParseSources()
/base/customization/enterprise_device_management/services/edm_plugin/src/
Dget_device_info_plugin.cpp98 char *jsonStr = cJSON_PrintUnformatted(json); in GetSimInfo() local
99 if (jsonStr == nullptr) { in GetSimInfo()
103 info = std::string(jsonStr); in GetSimInfo()
105 cJSON_free(jsonStr); in GetSimInfo()

123