Home
last modified time | relevance | path

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

12

/base/hiviewdfx/hiview/plugins/eventservice/
Dflat_json_parser.cpp70 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 …]
Devent_json_parser.cpp152 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/
Dhiappevent_base.cpp375 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/
Dflat_json_parser.h25 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/
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()
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()
Dhisysevent_record.cpp237 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/
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()
Devent_db_helper.cpp119 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/
Dhiappevent_base.h184 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/
Devent_logger_plugin_test.cpp118 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/
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/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/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()
Dpms_impl.c175 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/
Dsys_event_dao_test.cpp68 …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/
Djson_parser.cpp31 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/
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 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/
Djson_utils.h32 CJson *CreateJsonFromString(const char *jsonStr);
48 void FreeJsonString(char *jsonStr);
100 void ClearAndFreeJsonString(char *jsonStr);
/base/startup/init/test/unittest/init/
Dservice_unittest.cpp55 …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/
Dui_view_api_unittest.cpp61 string jsonStr = R"({"locale":{ variable
69 EXPECT_EQ(LanguageUI::GetInstance().LoadLangRes(JsonNode {jsonStr}), true);
/base/security/appverify/interfaces/innerkits/appverify/src/init/
Djson_parser_utils.cpp42 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/
Dhisyseventmanager_fuzzer.cpp89 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/
Dfaultlog_database.cpp42 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/
Ddeviceauth_standard_test.cpp334 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 …]

12