/base/customization/enterprise_device_management/interfaces/inner_api/plugin_kits/src/utils/ |
D | json_serializer.cpp | 21 bool JsonSerializer::Deserialize(const std::string &jsonString, Json::Value &dataObj) in Deserialize() argument 23 const auto rawJsonLength = static_cast<int>(jsonString.length()); in Deserialize() 27 if (!reader->parse(jsonString.c_str(), jsonString.c_str() + rawJsonLength, &dataObj, &err)) { in Deserialize() 34 bool JsonSerializer::Serialize(const Json::Value &dataObj, std::string &jsonString) in Serialize() argument 38 jsonString = Json::writeString(builder, dataObj); in Serialize() 44 std::string jsonString = data.ReadString(); in GetPolicy() local 45 return Deserialize(jsonString, result); in GetPolicy() 50 std::string jsonString; in WritePolicy() local 51 if (!Serialize(result, jsonString)) { in WritePolicy() 54 return reply.WriteString(jsonString); in WritePolicy()
|
D | bool_serializer.cpp | 20 bool BoolSerializer::Deserialize(const std::string &jsonString, bool &dataObj) in Deserialize() argument 24 if (jsonString.size() != TRUE_STRING_SIZE && jsonString.size() != FALSE_STRING_SIZE) { in Deserialize() 28 temp.resize(jsonString.size()); in Deserialize() 29 std::transform(jsonString.begin(), jsonString.end(), temp.begin(), ::tolower); in Deserialize() 41 bool BoolSerializer::Serialize(const bool &dataObj, std::string &jsonString) in Serialize() argument 43 jsonString = dataObj ? TRUE_VALUE : ""; in Serialize()
|
D | string_serializer.cpp | 21 bool StringSerializer::Deserialize(const std::string &jsonString, std::string &dataObj) in Deserialize() argument 23 if (!jsonString.empty()) { in Deserialize() 24 std::string jsonStr = jsonString; in Deserialize() 28 dataObj = jsonString; in Deserialize() 33 bool StringSerializer::Serialize(const std::string &dataObj, std::string &jsonString) in Serialize() argument 35 jsonString = dataObj; in Serialize()
|
D | long_serializer.cpp | 23 bool LongSerializer::Deserialize(const std::string &jsonString, int64_t &dataObj) in Deserialize() argument 25 dataObj = strtoll(jsonString.c_str(), nullptr, EdmConstants::DECIMAL); in Deserialize() 29 bool LongSerializer::Serialize(const int64_t &dataObj, std::string &jsonString) in Serialize() argument 31 jsonString = std::to_string(dataObj); in Serialize()
|
D | int_serializer.cpp | 24 bool IntSerializer::Deserialize(const std::string &jsonString, int32_t &dataObj) in Deserialize() argument 26 dataObj = strtol(jsonString.c_str(), nullptr, EdmConstants::DECIMAL); in Deserialize() 30 bool IntSerializer::Serialize(const int32_t &dataObj, std::string &jsonString) in Serialize() argument 32 jsonString = std::to_string(dataObj); in Serialize()
|
D | map_string_serializer.cpp | 21 bool MapStringSerializer::Deserialize(const std::string &jsonString, std::map<std::string, std::str… in Deserialize() argument 23 if (jsonString.empty()) { in Deserialize() 27 const auto rawJsonLength = static_cast<int>(jsonString.length()); in Deserialize() 31 if (!reader->parse(jsonString.c_str(), jsonString.c_str() + rawJsonLength, &root, &err)) { in Deserialize() 53 …ngSerializer::Serialize(const std::map<std::string, std::string> &dataObj, std::string &jsonString) in Serialize() argument 56 jsonString = ""; in Serialize() 65 jsonString = Json::writeString(builder, root); in Serialize()
|
/base/customization/enterprise_device_management/test/unittest/src/ |
D | policy_serializer_test.cpp | 85 string jsonString; variable 86 ASSERT_TRUE(serializer->Serialize(value, jsonString)); 87 ASSERT_EQ(jsonString, "s1"); 89 jsonString = "s2"; 90 ASSERT_TRUE(serializer->Deserialize(jsonString, value)); 121 string jsonString; variable 122 ASSERT_TRUE(serializer->Serialize(value, jsonString)); 123 auto sd = remove_if(jsonString.begin(), jsonString.end(), isspace); 124 jsonString.erase(sd, jsonString.end()); 125 ASSERT_EQ(jsonString, R"(["v1","v2","v3","v4","v5"])"); [all …]
|
/base/customization/enterprise_device_management/interfaces/inner_api/plugin_kits/include/ |
D | ipolicy_serializer.h | 45 virtual bool Deserialize(const std::string &jsonString, DT &dataObj) = 0; 54 virtual bool Serialize(const DT &dataObj, std::string &jsonString) = 0; 95 virtual bool Deserialize(const std::string &jsonString, T_ARRAY &dataObj) override; 97 virtual bool Serialize(const T_ARRAY &dataObj, std::string &jsonString) override; 110 bool ArraySerializer<DT, T_ARRAY>::Deserialize(const std::string &jsonString, T_ARRAY &dataObj) in Deserialize() argument 112 if (jsonString.empty()) { in Deserialize() 116 const auto rawJsonLength = static_cast<int>(jsonString.length()); in Deserialize() 120 if (!reader->parse(jsonString.c_str(), jsonString.c_str() + rawJsonLength, &root, &err)) { in Deserialize() 141 bool ArraySerializer<DT, T_ARRAY>::Serialize(const T_ARRAY &dataObj, std::string &jsonString) in Serialize() argument 144 jsonString = ""; in Serialize() [all …]
|
/base/notification/distributed_notification_service/interfaces/inner_api/ |
D | notification_json_convert.h | 62 … ConvertToJsonString(const NotificationJsonConvertionBase *convertionBase, std::string &jsonString) in ConvertToJsonString() argument 74 jsonString = jsonObject.dump(); in ConvertToJsonString() 103 static T *ConvertFromJsonString(const std::string &jsonString) in ConvertFromJsonString() argument 105 if (jsonString.empty()) { in ConvertFromJsonString() 110 auto jsonObject = nlohmann::json::parse(jsonString); in ConvertFromJsonString()
|
/base/customization/enterprise_device_management/test/unittest/edm_plugin/src/ |
D | set_browser_policies_plugin_test.cpp | 100 std::string jsonString; variable 101 MapStringSerializer::GetInstance()->Serialize(policies, jsonString); 106 plugin.OnGetPolicy(jsonString, data, reply, DEFAULT_USER_ID); 121 std::string jsonString; variable 122 MapStringSerializer::GetInstance()->Serialize(policies, jsonString); 127 plugin.OnGetPolicy(jsonString, data, reply, DEFAULT_USER_ID);
|
/base/customization/enterprise_device_management/interfaces/inner_api/plugin_kits/include/utils/ |
D | bool_serializer.h | 32 bool Deserialize(const std::string &jsonString, bool &dataObj) override; 34 bool Serialize(const bool &dataObj, std::string &jsonString) override;
|
D | int_serializer.h | 29 bool Deserialize(const std::string &jsonString, int32_t &dataObj) override; 31 bool Serialize(const int32_t &dataObj, std::string &jsonString) override;
|
D | long_serializer.h | 29 bool Deserialize(const std::string &jsonString, int64_t &dataObj) override; 31 bool Serialize(const int64_t &dataObj, std::string &jsonString) override;
|
D | json_serializer.h | 29 bool Deserialize(const std::string &jsonString, Json::Value &dataObj) override; 31 bool Serialize(const Json::Value &dataObj, std::string &jsonString) override;
|
D | string_serializer.h | 29 bool Deserialize(const std::string &jsonString, std::string &dataObj) override; 31 bool Serialize(const std::string &dataObj, std::string &jsonString) override;
|
D | map_string_serializer.h | 30 …bool Deserialize(const std::string &jsonString, std::map<std::string, std::string> &dataObj) overr… 32 …bool Serialize(const std::map<std::string, std::string> &dataObj, std::string &jsonString) overrid…
|
/base/customization/enterprise_device_management/services/edm_plugin/src/utils/ |
D | wifi_device_config_serializer.cpp | 21 bool WifiDeviceConfigSerializer::Deserialize(const std::string &jsonString, Wifi::WifiDeviceConfig … in Deserialize() argument 26 …ifiDeviceConfigSerializer::Serialize(const Wifi::WifiDeviceConfig &config, std::string &jsonString) in Serialize() argument
|
D | uninstall_param_serializer.cpp | 20 bool UninstallParamSerializer::Deserialize(const std::string &jsonString, UninstallParam &config) in Deserialize() argument 25 bool UninstallParamSerializer::Serialize(const UninstallParam &config, std::string &jsonString) in Serialize() argument
|
D | http_proxy_serializer.cpp | 20 bool HttpProxySerializer::Deserialize(const std::string &jsonString, NetManagerStandard::HttpProxy … in Deserialize() argument 25 …ttpProxySerializer::Serialize(const NetManagerStandard::HttpProxy &config, std::string &jsonString) in Serialize() argument
|
D | install_param_serializer.cpp | 20 bool InstallParamSerializer::Deserialize(const std::string &jsonString, InstallParam &config) in Deserialize() argument 25 bool InstallParamSerializer::Serialize(const InstallParam &config, std::string &jsonString) in Serialize() argument
|
/base/customization/enterprise_device_management/services/edm_plugin/include/utils/ |
D | uninstall_param_serializer.h | 37 bool Deserialize(const std::string &jsonString, UninstallParam &dataObj) override; 39 bool Serialize(const UninstallParam &dataObj, std::string &jsonString) override;
|
D | install_param_serializer.h | 37 bool Deserialize(const std::string &jsonString, InstallParam &dataObj) override; 39 bool Serialize(const InstallParam &dataObj, std::string &jsonString) override;
|
D | http_proxy_serializer.h | 32 …bool Deserialize(const std::string &jsonString, OHOS::NetManagerStandard::HttpProxy &dataObj) over… 34 …bool Serialize(const OHOS::NetManagerStandard::HttpProxy &dataObj, std::string &jsonString) overri…
|
D | wifi_device_config_serializer.h | 32 bool Deserialize(const std::string &jsonString, Wifi::WifiDeviceConfig &dataObj) override; 34 bool Serialize(const Wifi::WifiDeviceConfig &dataObj, std::string &jsonString) override;
|
/base/usb/usb_manager/services/native/src/ |
D | usb_host_manager.cpp | 106 auto jsonString = Json::writeString(builder, dev.ToJson()); in PublishCommonEvent() local 107 data.SetData(jsonString); in PublishCommonEvent() 110 …(MODULE_SERVICE, "send %{public}s broadcast device:%{public}s", event.c_str(), jsonString.c_str()); in PublishCommonEvent()
|