/base/hiviewdfx/hiview/plugins/eventservice/ |
D | flat_json_parser.cpp | 70 FlatJsonParser::FlatJsonParser(const std::string& jsonStr) in FlatJsonParser() argument 73 Parse(jsonStr); in FlatJsonParser() 76 void FlatJsonParser::Parse(const std::string& jsonStr) in Parse() argument 80 while (index_ < jsonStr.length()) { in Parse() 81 if (charFilter_[static_cast<uint8_t>(jsonStr[index_])] != STRING_FLAG) { in Parse() 85 std::string key = ParseKey(jsonStr); in Parse() 86 std::string val = ParseValue(jsonStr); in Parse() 93 std::string jsonStr = "{"; in Print() local 96 jsonStr += "\"" + kvList_[i].first + "\":" + kvList_[i].second + ","; in Print() 98 jsonStr += "\"" + kvList_.back().first + "\":" + kvList_.back().second; in Print() [all …]
|
D | event_json_parser.cpp | 152 std::string jsonStr = event->jsonExtraInfo_; in EventJsonParser() local 158 if (!reader->parse(jsonStr.data(), jsonStr.data() + jsonStr.size(), &eventJson, &errs)) { in EventJsonParser() 161 if (!reader.parse(jsonStr, eventJson)) { in EventJsonParser() 163 …_LOGE("parse json file failed, please check the style of json file: %{public}s.", jsonStr.c_str()); in EventJsonParser() 183 auto curSysEventId = GenerateHash(jsonStr); in EventJsonParser() 188 AppendExtensiveInfo(eventJson, jsonStr, curSysEventId); in EventJsonParser() 190 event->jsonExtraInfo_ = jsonStr; in EventJsonParser() 194 void EventJsonParser::AppendExtensiveInfo(const Json::Value& eventJson, std::string& jsonStr, in EventJsonParser() argument 198 FlatJsonParser parser(jsonStr); in EventJsonParser() 220 jsonStr = parser.Print(); in EventJsonParser()
|
/base/hiviewdfx/hiappevent/frameworks/native/libhiappevent/ |
D | hiappevent_base.cpp | 375 void AppEventPack::AddBaseInfoToJsonString(std::stringstream& jsonStr) const in AddBaseInfoToJsonString() 377 jsonStr << "\"" << "domain_" << "\":" << "\"" << domain_ << "\","; in AddBaseInfoToJsonString() 378 jsonStr << "\"" << "name_" << "\":" << "\"" << name_ << "\","; in AddBaseInfoToJsonString() 379 jsonStr << "\"" << "type_" << "\":" << type_ << ","; in AddBaseInfoToJsonString() 380 jsonStr << GetTimeInfo(); in AddBaseInfoToJsonString() 381 jsonStr << "\"" << "pid_" << "\":" << getpid() << ","; in AddBaseInfoToJsonString() 382 jsonStr << "\"" << "tid_" << "\":" << gettid() << ","; in AddBaseInfoToJsonString() 385 void AppEventPack::AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<bool>& bs) c… in AddVectorToJsonString() argument 387 jsonStr << "["; in AddVectorToJsonString() 390 jsonStr << "],"; in AddVectorToJsonString() [all …]
|
/base/hiviewdfx/hiview/plugins/eventservice/include/ |
D | flat_json_parser.h | 25 FlatJsonParser(const std::string& jsonStr); 33 void Parse(const std::string& jsonStr); 43 std::string ParseKey(const std::string& jsonStr); 44 std::string ParseValue(const std::string& jsonStr); 45 std::string ParseNumer(const std::string& jsonStr); 46 std::string ParseString(const std::string& jsonStr); 47 std::string ParseBrackets(const std::string& jsonStr, char leftBracket);
|
/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/ |
D | hisysevent_record_c.cpp | 28 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() 73 if (record.jsonStr == nullptr || name == nullptr) { in GetParamValues() 76 HiSysEventRecordCls recordObj(record.jsonStr); in GetParamValues() 89 if (record.jsonStr == nullptr) { in GetParamNames() 92 HiSysEventRecordCls recordObj(record.jsonStr); in GetParamNames()
|
D | hisysevent_record.cpp | 237 void HiSysEventRecord::ParseJsonStr(const std::string jsonStr) in ParseJsonStr() argument 239 jsonVal_ = std::make_shared<HiSysEventValue>(jsonStr); in ParseJsonStr() 240 jsonStr_ = jsonStr; in ParseJsonStr() 296 void HiSysEventValue::ParseJsonStr(const std::string jsonStr) in ParseJsonStr() argument 303 if (!reader->parse(jsonStr.data(), jsonStr.data() + jsonStr.size(), &jsonVal_, &errs)) { in ParseJsonStr() 306 if (!reader.parse(jsonStr, jsonVal_)) { in ParseJsonStr() 309 jsonStr.c_str()); in ParseJsonStr()
|
/base/hiviewdfx/hiview/plugins/usage_event_report/cache/ |
D | json_parser.cpp | 40 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()
|
D | event_db_helper.cpp | 119 int EventDbHelper::InsertDb(const std::string& jsonStr, const std::string& coll) in InsertDb() argument 121 … HIVIEW_LOGD("insert db file %{public}s with %{public}s", this->dbPath_.c_str(), jsonStr.c_str()); in InsertDb() 125 entry.value = jsonStr; in InsertDb() 127 …HIVIEW_LOGE("failed to insert collection %{public}s for %{public}s", coll.c_str(), jsonStr.c_str()… in InsertDb()
|
/base/hiviewdfx/hiappevent/frameworks/native/libhiappevent/include/ |
D | hiappevent_base.h | 184 void AddBaseInfoToJsonString(std::stringstream& jsonStr) const; 185 void AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<bool>& bs) const; 186 void AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<char>& cs) const; 187 void AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<int16_t>& shs) const; 188 void AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<int>& is) const; 189 void AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<int64_t>& lls) const; 190 void AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<float>& fs) const; 191 void AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<double>& ds) const; 192 …void AddVectorToJsonString(std::stringstream& jsonStr, const std::vector<std::string>& strs) const; 193 void AddOthersToJsonString(std::stringstream& jsonStr, const AppEventParam param) const;
|
/base/hiviewdfx/hiview/plugins/eventlogger/test/unittest/common/ |
D | event_logger_plugin_test.cpp | 118 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable 119 … std::shared_ptr<SysEvent> event = std::make_shared<SysEvent>("Eventlogger004", nullptr, jsonStr); 137 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable 138 … std::shared_ptr<SysEvent> event = std::make_shared<SysEvent>("Eventlogger005", nullptr, jsonStr); 169 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable 170 … std::shared_ptr<SysEvent> event = std::make_shared<SysEvent>("Eventlogger007", nullptr, jsonStr); 195 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable 196 … std::shared_ptr<SysEvent> event = std::make_shared<SysEvent>("Eventlogger008", nullptr, jsonStr); 221 auto jsonStr = "{\"domain_\":\"RELIABILITY\"}"; variable 222 … std::shared_ptr<SysEvent> event = std::make_shared<SysEvent>("Eventlogger009", nullptr, jsonStr); [all …]
|
/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/include/ |
D | hisysevent_value.h | 27 HiSysEventValue(std::string jsonStr) in HiSysEventValue() argument 29 ParseJsonStr(jsonStr); in HiSysEventValue() 56 void ParseJsonStr(const std::string jsonStr);
|
D | hisysevent_record.h | 35 HiSysEventRecord(std::string jsonStr) in HiSysEventRecord() argument 37 ParseJsonStr(jsonStr); in HiSysEventRecord() 84 void ParseJsonStr(const std::string jsonStr);
|
/base/hiviewdfx/hiview/plugins/usage_event_report/cache/include/ |
D | json_parser.h | 30 …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/security/permission_lite/services/pms/src/ |
D | pms_server.c | 132 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()
|
D | pms_impl.c | 175 static int ParsePermissions(const char *jsonStr, PermissionSaved **perms, int *permNum) in ParsePermissions() argument 177 cJSON *root = cJSON_Parse(jsonStr); in ParsePermissions() 221 const char *jsonStr = cJSON_PrintUnformatted(root); in WritePermissions() local 222 if (jsonStr == NULL) { in WritePermissions() 226 int ret = WriteString(path, jsonStr); in WritePermissions() 228 cJSON_free((void *)jsonStr); in WritePermissions() 297 char *jsonStr = NULL; in QueryPermissionString() local 311 jsonStr = ReadString(path, errCode); in QueryPermissionString() 313 return jsonStr; in QueryPermissionString() 319 const char *jsonStr = QueryPermissionString(identifier, &errCode); in QueryPermission() local [all …]
|
/base/hiviewdfx/hiview/base/event_store/test/unittest/common/ |
D | sys_event_dao_test.cpp | 68 …std::string jsonStr = R"~({"domain_":"demo","name_":"SysEventDaoTest_001","type_":1,"tz_":8,"time_… variable 78 auto sysEvent = std::make_shared<SysEvent>("SysEventSource", nullptr, jsonStr); 156 …std::string jsonStr = R"~({"domain_":"demo","name_":"SysEventDaoTest_003","type_":2,"tz_":8,"time_… variable 159 auto sysEvent = std::make_shared<SysEvent>("SysEventSource", nullptr, jsonStr); 275 …std::string jsonStr = R"~({"domain_":"demo","name_":"SysEventDaoTest_006","type_":3,"tz_":8,"time_… variable 278 auto sysEvent = std::make_shared<SysEvent>("SysEventSource", nullptr, jsonStr); 321 std::string jsonStr; variable 322 jsonStr = R"~({"domain_":"demo","name_":"DuringQuery","type_":4,"tz_":8,"time_":162027129100, 325 auto sysEvent = std::make_shared<SysEvent>("SysEventSource", nullptr, jsonStr); 331 jsonStr = R"~({"domain_":"demo","name_":"DuringQuery","type_":4,"tz_":8,"time_":162027129200, [all …]
|
/base/sensors/miscdevice/utils/src/ |
D | json_parser.cpp | 31 std::string jsonStr = ReadJsonFile(filePath); in JsonParser() local 32 if (jsonStr.empty()) { in JsonParser() 36 cJson_ = cJSON_Parse(jsonStr.c_str()); in JsonParser()
|
/base/security/device_auth/common_lib/impl/src/ |
D | json_utils.c | 26 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 cJSON_free(jsonStr); in FreeJsonString() 519 void ClearAndFreeJsonString(char *jsonStr) in ClearAndFreeJsonString() argument 521 if (jsonStr == NULL) { in ClearAndFreeJsonString() 524 (void)memset_s(jsonStr, strlen(jsonStr), 0, strlen(jsonStr)); in ClearAndFreeJsonString() 525 FreeJsonString(jsonStr); in ClearAndFreeJsonString()
|
/base/security/device_auth/common_lib/interfaces/ |
D | json_utils.h | 32 CJson *CreateJsonFromString(const char *jsonStr); 48 void FreeJsonString(char *jsonStr); 100 void ClearAndFreeJsonString(char *jsonStr);
|
/base/startup/init/test/unittest/init/ |
D | service_unittest.cpp | 55 …const char *jsonStr = "{\"services\":{\"name\":\"test_service\",\"path\":[\"/data/init_ut/test_ser… variable 58 cJSON* jobItem = cJSON_Parse(jsonStr); 77 …const char *jsonStr = "{\"services\":{\"name\":\"test_service8\",\"path\":[\"/data/init_ut/test_se… variable 80 cJSON* jobItem = cJSON_Parse(jsonStr); 120 …const char *jsonStr = "{\"services\":{\"name\":\"test_service1\",\"path\":[\"/data/init_ut/test_se… variable 123 cJSON* jobItem = cJSON_Parse(jsonStr); 250 …const char *jsonStr = "{\"services\":{\"name\":\"test_service2\",\"path\":[\"/data/init_ut/test_se… variable 253 cJSON* jobItem = cJSON_Parse(jsonStr);
|
/base/update/updater/test/unittest/updater_ui_test/view/ |
D | ui_view_api_unittest.cpp | 61 string jsonStr = R"({"locale":{ variable 69 EXPECT_EQ(LanguageUI::GetInstance().LoadLangRes(JsonNode {jsonStr}), true);
|
/base/security/appverify/interfaces/innerkits/appverify/src/init/ |
D | json_parser_utils.cpp | 42 std::string jsonStr = buf.str(); in ReadTrustedRootCAFromJson() local 43 jsonObj = nlohmann::json::parse(jsonStr, nullptr, false); in ReadTrustedRootCAFromJson()
|
/base/hiviewdfx/hisysevent/test/fuzztest/common/hisyseventmanager_fuzzer/ |
D | hisyseventmanager_fuzzer.cpp | 89 const std::string jsonStr = R"~({"domain_":"test_domain","name_":"test_name"})~"; in HiSysEventRecordFuzzTest() local 90 HiSysEventRecord record(jsonStr); in HiSysEventRecordFuzzTest()
|
/base/hiviewdfx/hiview/plugins/faultlogger/service/ |
D | faultlog_database.cpp | 42 bool ParseFaultLogInfoFromJson(const std::string& jsonStr, FaultLogInfo& info) in ParseFaultLogInfoFromJson() argument 44 auto sysEvent = std::make_unique<SysEvent>("FaultLogDatabase", nullptr, jsonStr); in ParseFaultLogInfoFromJson() 45 HIVIEW_LOGI("parse FaultLogInfo from %{public}s. 0", jsonStr.c_str()); in ParseFaultLogInfoFromJson()
|
/base/security/device_auth/test/unittest/deviceauth/source/ |
D | deviceauth_standard_test.cpp | 334 char *jsonStr = PackJsonToString(json); in CreateDemoIdenticalAccountGroup() local 338 if (jsonStr == nullptr) { in CreateDemoIdenticalAccountGroup() 341 cout << "jsonstr: " << jsonStr << endl; in CreateDemoIdenticalAccountGroup() 343 ret = gm->createGroup(DEFAULT_OS_ACCOUNT, TEST_REQ_ID, TEST_APP_ID, jsonStr); in CreateDemoIdenticalAccountGroup() 344 FreeJsonString(jsonStr); in CreateDemoIdenticalAccountGroup() 365 char *jsonStr = PackJsonToString(json); in CreateDemoSymClientIdenticalAccountGroup() local 368 if (jsonStr == nullptr) { in CreateDemoSymClientIdenticalAccountGroup() 371 cout << "jsonstr: " << jsonStr << endl; in CreateDemoSymClientIdenticalAccountGroup() 372 int32_t ret = gm->createGroup(DEFAULT_OS_ACCOUNT, TEST_REQ_ID, TEST_APP_ID, jsonStr); in CreateDemoSymClientIdenticalAccountGroup() 373 FreeJsonString(jsonStr); in CreateDemoSymClientIdenticalAccountGroup() [all …]
|