| /base/notification/distributed_notification_service/interfaces/inner_api/ |
| D | notification_json_convert.h | 33 virtual bool ToJson(nlohmann::json &jsonObject) const = 0; 45 …ool ConvertToJson(const NotificationJsonConvertionBase *convertionBase, nlohmann::json &jsonObject) in ConvertToJson() argument 52 return convertionBase->ToJson(jsonObject); in ConvertToJson() 69 nlohmann::json jsonObject; in ConvertToJsonString() local 70 if (!convertionBase->ToJson(jsonObject)) { in ConvertToJsonString() 74 jsonString = jsonObject.dump(); in ConvertToJsonString() 86 static T *ConvertFromJson(const nlohmann::json &jsonObject) in ConvertFromJson() argument 88 if (jsonObject.is_null() or !jsonObject.is_object()) { in ConvertFromJson() 93 return T::FromJson(jsonObject); in ConvertFromJson() 110 auto jsonObject = nlohmann::json::parse(jsonString); in ConvertFromJsonString() local [all …]
|
| /base/notification/distributed_notification_service/frameworks/ans/src/ |
| D | notification_basic_content.cpp | 59 bool NotificationBasicContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 61 jsonObject["text"] = text_; in ToJson() 62 jsonObject["title"] = title_; in ToJson() 63 jsonObject["additionalText"] = additionalText_; in ToJson() 68 void NotificationBasicContent::ReadFromJson(const nlohmann::json &jsonObject) in ReadFromJson() argument 70 if (jsonObject.is_null() or !jsonObject.is_object()) { in ReadFromJson() 75 const auto &jsonEnd = jsonObject.cend(); in ReadFromJson() 76 if (jsonObject.find("text") != jsonEnd && jsonObject.at("text").is_string()) { in ReadFromJson() 77 text_ = jsonObject.at("text").get<std::string>(); in ReadFromJson() 80 if (jsonObject.find("title") != jsonEnd && jsonObject.at("title").is_string()) { in ReadFromJson() [all …]
|
| D | message_user.cpp | 109 bool MessageUser::ToJson(nlohmann::json &jsonObject) const in ToJson() 111 jsonObject["key"] = key_; in ToJson() 112 jsonObject["name"] = name_; in ToJson() 113 jsonObject["pixelMap"] = AnsImageUtil::PackImage(pixelMap_); in ToJson() 114 jsonObject["uri"] = uri_.ToString(); in ToJson() 115 jsonObject["isMachine"] = isMachine_; in ToJson() 116 jsonObject["isUserImportant"] = isUserImportant_; in ToJson() 121 MessageUser *MessageUser::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 123 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 134 const auto &jsonEnd = jsonObject.cend(); in FromJson() [all …]
|
| D | notification_long_text_content.cpp | 80 bool NotificationLongTextContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 82 if (!NotificationBasicContent::ToJson(jsonObject)) { in ToJson() 87 jsonObject["longText"] = longText_; in ToJson() 88 jsonObject["expandedTitle"] = expandedTitle_; in ToJson() 89 jsonObject["briefText"] = briefText_; in ToJson() 94 NotificationLongTextContent *NotificationLongTextContent::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 96 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 107 pContent->ReadFromJson(jsonObject); in FromJson() 109 const auto &jsonEnd = jsonObject.cend(); in FromJson() 110 if (jsonObject.find("longText") != jsonEnd && jsonObject.at("longText").is_string()) { in FromJson() [all …]
|
| D | notification_conversational_message.cpp | 74 bool NotificationConversationalMessage::ToJson(nlohmann::json &jsonObject) const in ToJson() 76 jsonObject["arrivedTime"] = arrivedTime_; in ToJson() 77 jsonObject["text"] = text_; in ToJson() 84 jsonObject["sender"] = userObj; in ToJson() 86 jsonObject["uri"] = uri_ ? uri_->ToString() : ""; in ToJson() 87 jsonObject["mimeType"] = mimeType_; in ToJson() 92 …onversationalMessage *NotificationConversationalMessage::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 94 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 105 const auto &jsonEnd = jsonObject.cend(); in FromJson() 106 …if (jsonObject.find("arrivedTime") != jsonEnd && jsonObject.at("arrivedTime").is_number_integer())… in FromJson() [all …]
|
| D | notification_request.cpp | 713 bool NotificationRequest::ToJson(nlohmann::json &jsonObject) const in ToJson() 715 jsonObject["version"] = 1; in ToJson() 717 jsonObject["id"] = notificationId_; in ToJson() 718 jsonObject["color"] = color_; in ToJson() 719 jsonObject["deliveryTime"] = deliveryTime_; in ToJson() 720 jsonObject["autoDeletedTime"] = autoDeletedTime_; in ToJson() 722 jsonObject["creatorBundleName"] = creatorBundleName_; in ToJson() 723 jsonObject["ownerBundleName"] = ownerBundleName_; in ToJson() 724 jsonObject["groupName"] = groupName_; in ToJson() 725 jsonObject["label"] = label_; in ToJson() [all …]
|
| D | notification_multiline_content.cpp | 75 bool NotificationMultiLineContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 77 if (!NotificationBasicContent::ToJson(jsonObject)) { in ToJson() 82 jsonObject["expandedTitle"] = expandedTitle_; in ToJson() 83 jsonObject["briefText"] = briefText_; in ToJson() 84 jsonObject["allLines"] = nlohmann::json(allLines_); in ToJson() 89 …ificationMultiLineContent *NotificationMultiLineContent::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 91 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 102 pContent->ReadFromJson(jsonObject); in FromJson() 104 const auto &jsonEnd = jsonObject.cend(); in FromJson() 105 if (jsonObject.find("expandedTitle") != jsonEnd && jsonObject.at("expandedTitle").is_string()) { in FromJson() [all …]
|
| D | notification_picture_content.cpp | 61 bool NotificationPictureContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 63 if (!NotificationBasicContent::ToJson(jsonObject)) { in ToJson() 68 jsonObject["expandedTitle"] = expandedTitle_; in ToJson() 69 jsonObject["briefText"] = briefText_; in ToJson() 70 jsonObject["bigPicture"] = AnsImageUtil::PackImage(bigPicture_); in ToJson() 75 NotificationPictureContent *NotificationPictureContent::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 77 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 88 pContent->ReadFromJson(jsonObject); in FromJson() 90 const auto &jsonEnd = jsonObject.cend(); in FromJson() 91 if (jsonObject.find("expandedTitle") != jsonEnd && jsonObject.at("expandedTitle").is_string()) { in FromJson() [all …]
|
| D | notification_distributed_options.cpp | 77 bool NotificationDistributedOptions::ToJson(nlohmann::json &jsonObject) const in ToJson() 79 jsonObject["isDistributed"] = isDistributed_; in ToJson() 80 jsonObject["devicesSupportDisplay"] = nlohmann::json(devicesSupportDisplay_); in ToJson() 81 jsonObject["devicesSupportOperate"] = nlohmann::json(devicesSupportOperate_); in ToJson() 86 …ationDistributedOptions *NotificationDistributedOptions::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 88 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 99 const auto &jsonEnd = jsonObject.cend(); in FromJson() 100 … if (jsonObject.find("isDistributed") != jsonEnd && jsonObject.at("isDistributed").is_boolean()) { in FromJson() 101 pOpt->isDistributed_ = jsonObject.at("isDistributed").get<bool>(); in FromJson() 104 …if (jsonObject.find("devicesSupportDisplay") != jsonEnd && jsonObject.at("devicesSupportDisplay").… in FromJson() [all …]
|
| D | notification_flags.cpp | 53 bool NotificationFlags::ToJson(nlohmann::json &jsonObject) const in ToJson() 55 jsonObject["soundEnabled"] = soundEnabled_; in ToJson() 56 jsonObject["vibrationEnabled"] = vibrationEnabled_; in ToJson() 61 NotificationFlags *NotificationFlags::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 63 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 74 const auto &jsonEnd = jsonObject.cend(); in FromJson() 75 …if (jsonObject.find("soundEnabled") != jsonEnd && jsonObject.at("soundEnabled").is_number_integer(… in FromJson() 76 auto soundEnabled = jsonObject.at("soundEnabled").get<uint8_t>(); in FromJson() 80 …if (jsonObject.find("vibrationEnabled") != jsonEnd && jsonObject.at("vibrationEnabled").is_number_… in FromJson() 81 auto vibrationEnabled = jsonObject.at("vibrationEnabled").get<uint8_t>(); in FromJson()
|
| D | notification_media_content.cpp | 55 bool NotificationMediaContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 57 if (!NotificationBasicContent::ToJson(jsonObject)) { in ToJson() 62 jsonObject["sequenceNumbers"] = nlohmann::json(sequenceNumbers_); in ToJson() 67 NotificationMediaContent *NotificationMediaContent::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 69 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 80 pContent->ReadFromJson(jsonObject); in FromJson() 82 const auto& jsonEnd = jsonObject.cend(); in FromJson() 83 …if (jsonObject.find("sequenceNumbers") != jsonEnd && jsonObject.at("sequenceNumbers").is_array()) { in FromJson() 84 pContent->sequenceNumbers_ = jsonObject.at("sequenceNumbers").get<std::vector<uint32_t>>(); in FromJson()
|
| D | notification_user_input.cpp | 232 bool NotificationUserInput::ToJson(nlohmann::json &jsonObject) const in ToJson() 234 jsonObject["inputKey"] = inputKey_; in ToJson() 235 jsonObject["tag"] = tag_; in ToJson() 236 jsonObject["options"] = nlohmann::json(options_); in ToJson() 237 jsonObject["permitFreeFormInput"] = permitFreeFormInput_; in ToJson() 238 jsonObject["permitMimeTypes"] = nlohmann::json(permitMimeTypes_); in ToJson() 239 jsonObject["editType"] = static_cast<int32_t>(editType_); in ToJson() 245 jsonObject["additionalData"] = additionalDataStr; in ToJson() 250 NotificationUserInput *NotificationUserInput::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 252 if (jsonObject.is_null() || !jsonObject.is_object()) { in FromJson() [all …]
|
| D | notification_normal_content.cpp | 31 bool NotificationNormalContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 33 return NotificationBasicContent::ToJson(jsonObject); in ToJson() 36 NotificationNormalContent *NotificationNormalContent::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 38 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 49 pContent->ReadFromJson(jsonObject); in FromJson()
|
| D | notification_conversational_content.cpp | 98 bool NotificationConversationalContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 100 if (!NotificationBasicContent::ToJson(jsonObject)) { in ToJson() 110 jsonObject["messageUser"] = userObj; in ToJson() 112 jsonObject["conversationTitle"] = conversationTitle_; in ToJson() 113 jsonObject["isGroup"] = isGroup_; in ToJson() 128 jsonObject["messages"] = msgsArr; in ToJson() 133 …onversationalContent *NotificationConversationalContent::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 135 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 146 pContent->ReadFromJson(jsonObject); in FromJson() 148 const auto &jsonEnd = jsonObject.cend(); in FromJson() [all …]
|
| /base/update/updateservice/services/core/ability/utils/include/ |
| D | json_utils.h | 41 …static int32_t GetValueAndSetTo(const nlohmann::json &jsonObject, const std::string &key, T &value) in GetValueAndSetTo() argument 43 if (jsonObject.find(key) == jsonObject.end()) { in GetValueAndSetTo() 47 if (!CheckType(jsonObject, key, value)) { in GetValueAndSetTo() 51 jsonObject.at(key).get_to(value); in GetValueAndSetTo() 73 …static bool CheckType(const nlohmann::json &jsonObject, const std::string &key, std::string &value) in CheckType() argument 75 return jsonObject.at(key).is_string(); in CheckType() 77 static bool CheckType(const nlohmann::json &jsonObject, const std::string &key, int32_t &value) in CheckType() argument 79 return jsonObject.at(key).is_number(); in CheckType() 81 static bool CheckType(const nlohmann::json &jsonObject, const std::string &key, uint32_t &value) in CheckType() argument 83 return jsonObject.at(key).is_number(); in CheckType() [all …]
|
| /base/account/os_account/frameworks/common/database/include/ |
| D | iaccount_info.h | 29 virtual void FromJson(const Json &jsonObject) = 0; 44 void GetDataByType(const Json &jsonObject, const nlohmann::detail::iter_impl<const Json> &end, cons… in GetDataByType() argument 47 if (jsonObject.find(key) != end) { in GetDataByType() 50 if (!jsonObject.at(key).is_boolean()) { in GetDataByType() 53 data = jsonObject.at(key).get<T>(); in GetDataByType() 56 if (!jsonObject.at(key).is_number()) { in GetDataByType() 59 data = jsonObject.at(key).get<T>(); in GetDataByType() 62 if (!jsonObject.at(key).is_object()) { in GetDataByType() 65 data = jsonObject.at(key).get<T>(); in GetDataByType() 68 if (!jsonObject.at(key).is_array()) { in GetDataByType() [all …]
|
| /base/account/os_account/services/accountmgr/src/bundle_manager_adapter/ |
| D | bundle_manager_adapter_proxy.cpp | 55 nlohmann::json jsonObject = nlohmann::json::parse(infoStr.c_str(), nullptr, false); in ParseExtensionInfo() local 56 if (jsonObject.is_discarded()) { in ParseExtensionInfo() 60 …if ((jsonObject.find(EXTENSION_NAME) != jsonObject.end()) && jsonObject.at(EXTENSION_NAME).is_stri… in ParseExtensionInfo() 61 extensionInfo.name = jsonObject.at(EXTENSION_NAME).get<std::string>(); in ParseExtensionInfo() 63 …if ((jsonObject.find(EXTENSION_LABEL) != jsonObject.end()) && jsonObject.at(EXTENSION_LABEL).is_st… in ParseExtensionInfo() 64 extensionInfo.label = jsonObject.at(EXTENSION_LABEL).get<std::string>(); in ParseExtensionInfo() 66 if ((jsonObject.find(EXTENSION_DESCRIPTION) != jsonObject.end()) && in ParseExtensionInfo() 67 jsonObject.at(EXTENSION_DESCRIPTION).is_string()) { in ParseExtensionInfo() 68 extensionInfo.description = jsonObject.at(EXTENSION_DESCRIPTION).get<std::string>(); in ParseExtensionInfo() 70 if ((jsonObject.find(EXTENSION_TYPE) != jsonObject.end()) && in ParseExtensionInfo() [all …]
|
| /base/notification/distributed_notification_service/frameworks/ans/test/unittest/ |
| D | message_user_test.cpp | 44 nlohmann::json jsonObject; variable 45 EXPECT_EQ(messageUser ->FromJson(jsonObject), nullptr); 57 nlohmann::json jsonObject = nlohmann::json{"processName", "process6", "name", "arrivedTime1"}; 58 messageUser.FromJson(jsonObject); 59 EXPECT_EQ(jsonObject.is_object(), false); 60 EXPECT_EQ(messageUser.FromJson(jsonObject), nullptr); 72 nlohmann::json jsonObject = nlohmann::json{ 77 messageUser.FromJson(jsonObject); 78 EXPECT_EQ(jsonObject.is_object(), true); 140 nlohmann::json jsonObject = nlohmann::json{ [all …]
|
| D | notification_long_text_content_test.cpp | 57 nlohmann::json jsonObject; variable 59 rrc->FromJson(jsonObject); 60 EXPECT_EQ(rrc->ToJson(jsonObject), true); 72 nlohmann::json jsonObject = nlohmann::json{"processName", "longText", "name", "arrivedTime1"}; 73 rrc->FromJson(jsonObject); 74 EXPECT_EQ(jsonObject.is_object(), false); 75 EXPECT_EQ(rrc->FromJson(jsonObject), nullptr); 87 nlohmann::json jsonObject = nlohmann::json{ 92 rrc->FromJson(jsonObject); 93 EXPECT_EQ(jsonObject.is_object(), true); [all …]
|
| D | notification_conversational_message_test.cpp | 102 nlohmann::json jsonObject; variable 104 rrc->FromJson(jsonObject); 105 EXPECT_EQ(rrc->ToJson(jsonObject), true); 177 …nlohmann::json jsonObject = nlohmann::json{"processName", "process6", "arrivedTime", "arrivedTime1… 178 rrc->FromJson(jsonObject); 179 EXPECT_EQ(rrc->FromJson(jsonObject), nullptr); 180 EXPECT_EQ(jsonObject.is_object(), false); 196 nlohmann::json jsonObject = nlohmann::json{ 201 rrc->FromJson(jsonObject); 202 EXPECT_EQ(jsonObject.is_object(), true); [all …]
|
| D | notification_flags_test.cpp | 84 nlohmann::json jsonObject; variable 86 rrc->FromJson(jsonObject); 87 EXPECT_EQ(rrc->ToJson(jsonObject), true); 99 … nlohmann::json jsonObject = nlohmann::json{"processName", "soundEnabled", "name", "arrivedTime1"}; 100 rrc->FromJson(jsonObject); 101 EXPECT_EQ(jsonObject.is_object(), false); 102 EXPECT_EQ(rrc->FromJson(jsonObject), nullptr); 114 nlohmann::json jsonObject = nlohmann::json{ 119 rrc->FromJson(jsonObject); 120 EXPECT_EQ(jsonObject.is_object(), true);
|
| D | notification_conversational_content_test.cpp | 44 nlohmann::json jsonObject; variable 46 rrc->FromJson(jsonObject); 47 EXPECT_EQ(rrc->ToJson(jsonObject), true); 61 …nlohmann::json jsonObject = nlohmann::json{"processName", "process6", "messageUser", "arrivedTime1… 62 rrc->FromJson(jsonObject); 63 EXPECT_EQ(jsonObject.is_object(), false); 64 EXPECT_EQ(rrc->FromJson(jsonObject), nullptr); 78 nlohmann::json jsonObject = nlohmann::json{ 83 messageUser.FromJson(jsonObject); 84 EXPECT_EQ(jsonObject.is_object(), true); [all …]
|
| /base/account/os_account/services/accountmgr/src/appaccount/ |
| D | app_account_data_storage.cpp | 36 auto jsonObject = Json::parse(authorizedAccounts, nullptr, false); in GetAccessibleAccountsFromAuthorizedAccounts() local 37 if (jsonObject.is_discarded()) { in GetAccessibleAccountsFromAuthorizedAccounts() 38 jsonObject = Json::object(); in GetAccessibleAccountsFromAuthorizedAccounts() 40 auto value = jsonObject.find(authorizedApp); in GetAccessibleAccountsFromAuthorizedAccounts() 41 if (value == jsonObject.end()) { in GetAccessibleAccountsFromAuthorizedAccounts() 42 jsonObject.emplace(authorizedApp, Json::array()); in GetAccessibleAccountsFromAuthorizedAccounts() 44 accessibleAccounts = jsonObject[authorizedApp].get<std::vector<std::string>>(); in GetAccessibleAccountsFromAuthorizedAccounts() 48 return jsonObject; in GetAccessibleAccountsFromAuthorizedAccounts() 111 Json jsonObject = Json::parse(item.value.ToString(), nullptr, false); in SaveEntries() local 112 if (jsonObject.is_discarded()) { in SaveEntries() [all …]
|
| /base/account/os_account/frameworks/appaccount/native/src/ |
| D | app_account_info.cpp | 170 Json jsonObject = data; in InitCustomData() local 172 associatedData_ = jsonObject.dump(); in InitCustomData() 182 auto jsonObject = Json::parse(associatedData_, nullptr, false); in GetAllAssociatedData() local 183 if (!jsonObject.is_object()) { in GetAllAssociatedData() 188 data = jsonObject.get<std::map<std::string, std::string>>(); in GetAllAssociatedData() 198 auto jsonObject = Json::parse(associatedData_, nullptr, false); in GetAssociatedData() local 199 if (jsonObject.is_discarded()) { in GetAssociatedData() 201 jsonObject = Json::object(); in GetAssociatedData() 204 if (jsonObject.find(key) == jsonObject.end()) { in GetAssociatedData() 209 value = jsonObject.at(key); in GetAssociatedData() [all …]
|
| /base/notification/distributed_notification_service/test/fuzztest/notificationflags_fuzzer/ |
| D | notificationflags_fuzzer.cpp | 34 nlohmann::json jsonObject; in DoSomethingInterestingWithMyAPI() local 35 if (jsonObject.is_null() or !jsonObject.is_object()) { in DoSomethingInterestingWithMyAPI() 38 notificationFlags.ToJson(jsonObject); in DoSomethingInterestingWithMyAPI() 39 notificationFlags.FromJson(jsonObject); in DoSomethingInterestingWithMyAPI()
|