| /base/update/updateservice/services/core/ability/utils/include/ |
| D | json_utils.h | 40 …static int32_t GetValueAndSetTo(const nlohmann::json &jsonObject, const std::string &key, T &value) in GetValueAndSetTo() argument 42 if (jsonObject.find(key) == jsonObject.end()) { in GetValueAndSetTo() 45 if (!CheckType(jsonObject.at(key), value)) { in GetValueAndSetTo() 48 GetValue(jsonObject, key, value); in GetValueAndSetTo() 70 static int32_t GetValueAndSetToArray(const nlohmann::json &jsonObject, const std::string &key, in GetValueAndSetToArray() argument 73 if (jsonObject.find(key) == jsonObject.end()) { in GetValueAndSetToArray() 76 if (!jsonObject.at(key).is_array()) { in GetValueAndSetToArray() 79 jsonObject.at(key).get_to(value); in GetValueAndSetToArray() 83 static void SetJsonToVector(nlohmann::json &jsonObject, std::vector<std::string> &vector) in SetJsonToVector() argument 85 if (jsonObject.is_array()) { in SetJsonToVector() [all …]
|
| /base/notification/distributed_notification_service/frameworks/ans/src/ |
| D | notification_time.cpp | 80 bool NotificationTime::ToJson(nlohmann::json &jsonObject) const in ToJson() 82 jsonObject["initialTime"] = initialTime_; in ToJson() 83 jsonObject["isCountDown"] = isCountDown_; in ToJson() 84 jsonObject["isPaused"] = isPaused_; in ToJson() 85 jsonObject["isInTitle"] = isInTitle_; in ToJson() 90 NotificationTime *NotificationTime::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 92 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 103 const auto &jsonEnd = jsonObject.cend(); in FromJson() 104 …if (jsonObject.find("initialTime") != jsonEnd && jsonObject.at("initialTime").is_number_integer())… in FromJson() 105 time->initialTime_ = jsonObject.at("initialTime").get<int32_t>(); in FromJson() [all …]
|
| 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_progress.cpp | 70 bool NotificationProgress::ToJson(nlohmann::json &jsonObject) const in ToJson() 72 jsonObject["maxValue"] = maxValue_; in ToJson() 73 jsonObject["currentValue"] = currentValue_; in ToJson() 74 jsonObject["isPercentage"] = isPercentage_; in ToJson() 79 NotificationProgress *NotificationProgress::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 81 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 92 const auto &jsonEnd = jsonObject.cend(); in FromJson() 93 if (jsonObject.find("maxValue") != jsonEnd && jsonObject.at("maxValue").is_number_integer()) { in FromJson() 94 progress->maxValue_ = jsonObject.at("maxValue").get<int32_t>(); in FromJson() 97 …if (jsonObject.find("currentValue") != jsonEnd && jsonObject.at("currentValue").is_number_integer(… 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_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_request.cpp | 757 bool NotificationRequest::ToJson(nlohmann::json &jsonObject) const in ToJson() 759 jsonObject["version"] = 1; in ToJson() 761 jsonObject["id"] = notificationId_; in ToJson() 762 jsonObject["color"] = color_; in ToJson() 763 jsonObject["deliveryTime"] = deliveryTime_; in ToJson() 764 jsonObject["autoDeletedTime"] = autoDeletedTime_; in ToJson() 766 jsonObject["creatorBundleName"] = creatorBundleName_; in ToJson() 767 jsonObject["ownerBundleName"] = ownerBundleName_; in ToJson() 768 jsonObject["groupName"] = groupName_; in ToJson() 769 jsonObject["label"] = label_; in ToJson() [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_multiline_content.cpp | 77 bool NotificationMultiLineContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 79 if (!NotificationBasicContent::ToJson(jsonObject)) { in ToJson() 84 jsonObject["expandedTitle"] = expandedTitle_; in ToJson() 85 jsonObject["briefText"] = briefText_; in ToJson() 86 jsonObject["allLines"] = nlohmann::json(allLines_); in ToJson() 91 …ificationMultiLineContent *NotificationMultiLineContent::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 93 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 104 pContent->ReadFromJson(jsonObject); in FromJson() 106 const auto &jsonEnd = jsonObject.cend(); in FromJson() 107 if (jsonObject.find("expandedTitle") != jsonEnd && jsonObject.at("expandedTitle").is_string()) { in FromJson() [all …]
|
| D | notification_capsule.cpp | 70 bool NotificationCapsule::ToJson(nlohmann::json &jsonObject) const in ToJson() 72 jsonObject["title"] = title_; in ToJson() 73 jsonObject["backgroundColor"] = backgroundColor_; in ToJson() 74 jsonObject["icon"] = AnsImageUtil::PackImage(icon_); in ToJson() 79 NotificationCapsule *NotificationCapsule::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 81 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 92 const auto &jsonEnd = jsonObject.cend(); in FromJson() 93 if (jsonObject.find("title") != jsonEnd && jsonObject.at("title").is_string()) { in FromJson() 94 capsule->title_ = jsonObject.at("title").get<std::string>(); in FromJson() 97 …if (jsonObject.find("backgroundColor") != jsonEnd && jsonObject.at("backgroundColor").is_string())… in FromJson() [all …]
|
| D | notification_local_live_view_content.cpp | 113 bool NotificationLocalLiveViewContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 115 if (!NotificationBasicContent::ToJson(jsonObject)) { in ToJson() 144 jsonObject["type"] = type_; in ToJson() 145 jsonObject["capsule"] = capsuleObj; in ToJson() 146 jsonObject["button"] = buttonObj; in ToJson() 147 jsonObject["progress"] = progressObj; in ToJson() 148 jsonObject["time"] = timeObj; in ToJson() 149 jsonObject["flags"] = nlohmann::json(flags_); in ToJson() 154 …nLocalLiveViewContent *NotificationLocalLiveViewContent::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 156 if (jsonObject.is_null() or !jsonObject.is_object()) { 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_bundle_option.cpp | 98 bool NotificationBundleOption::ToJson(nlohmann::json &jsonObject) const in ToJson() 100 jsonObject["uid"] = uid_; in ToJson() 101 jsonObject["bundleName"] = bundleName_; in ToJson() 105 NotificationBundleOption *NotificationBundleOption::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 107 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 118 const auto &jsonEnd = jsonObject.cend(); in FromJson() 119 if (jsonObject.find("uid") != jsonEnd && jsonObject.at("uid").is_number_integer()) { in FromJson() 120 pBundle->uid_ = jsonObject.at("uid").get<int32_t>(); in FromJson() 123 if (jsonObject.find("bundleName") != jsonEnd && jsonObject.at("bundleName").is_string()) { in FromJson() 124 pBundle->bundleName_ = jsonObject.at("bundleName").get<std::string>(); in FromJson()
|
| 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_live_view_content.cpp | 88 bool NotificationLiveViewContent::PictureToJson(nlohmann::json &jsonObject) const in PictureToJson() 102 jsonObject["pictureMap"] = pixelMap; in PictureToJson() 106 bool NotificationLiveViewContent::ToJson(nlohmann::json &jsonObject) const in ToJson() 108 if (!NotificationBasicContent::ToJson(jsonObject)) { in ToJson() 113 jsonObject["status"] = static_cast<int32_t>(liveViewStatus_); in ToJson() 114 jsonObject["version"] = version_; in ToJson() 118 jsonObject["extraInfo"] = wWrapper.ToString(); in ToJson() 121 return PictureToJson(jsonObject); in ToJson() 124 void NotificationLiveViewContent::ConvertPictureFromJson(const nlohmann::json &jsonObject) in ConvertPictureFromJson() argument 126 const auto &jsonEnd = jsonObject.cend(); in ConvertPictureFromJson() [all …]
|
| D | notification_button_option.cpp | 47 bool NotificationButtonOption::ToJson(nlohmann::json &jsonObject) const in ToJson() 49 jsonObject["buttonName"] = buttonName_; in ToJson() 53 NotificationButtonOption *NotificationButtonOption::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 55 if (jsonObject.is_null() or !jsonObject.is_object()) { in FromJson() 66 const auto &jsonEnd = jsonObject.cend(); in FromJson() 67 if (jsonObject.find("buttonName") != jsonEnd && jsonObject.at("buttonName").is_string()) { in FromJson() 68 button->buttonName_ = jsonObject.at("buttonName").get<std::string>(); 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 | 240 bool NotificationUserInput::ToJson(nlohmann::json &jsonObject) const in ToJson() 242 jsonObject["inputKey"] = inputKey_; in ToJson() 243 jsonObject["tag"] = tag_; in ToJson() 244 jsonObject["options"] = nlohmann::json(options_); in ToJson() 245 jsonObject["permitFreeFormInput"] = permitFreeFormInput_; in ToJson() 246 jsonObject["permitMimeTypes"] = nlohmann::json(permitMimeTypes_); in ToJson() 247 jsonObject["editType"] = static_cast<int32_t>(editType_); in ToJson() 253 jsonObject["additionalData"] = additionalDataStr; in ToJson() 258 NotificationUserInput *NotificationUserInput::FromJson(const nlohmann::json &jsonObject) in FromJson() argument 260 if (jsonObject.is_null() || !jsonObject.is_object()) { in FromJson() [all …]
|
| /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/account/os_account/interfaces/innerkits/common/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 …]
|
| /base/account/os_account/frameworks/appaccount/native/src/ |
| D | app_account_info.cpp | 205 Json jsonObject = data; in InitCustomData() local 207 associatedData_ = jsonObject.dump(); in InitCustomData() 217 auto jsonObject = Json::parse(associatedData_, nullptr, false); in GetAllAssociatedData() local 218 if (!jsonObject.is_object()) { in GetAllAssociatedData() 223 data = jsonObject.get<std::map<std::string, std::string>>(); in GetAllAssociatedData() 233 auto jsonObject = Json::parse(associatedData_, nullptr, false); in GetAssociatedData() local 234 if (jsonObject.is_discarded()) { in GetAssociatedData() 236 jsonObject = Json::object(); in GetAssociatedData() 239 if (jsonObject.find(key) == jsonObject.end()) { in GetAssociatedData() 244 value = jsonObject.at(key); in GetAssociatedData() [all …]
|