Home
last modified time | relevance | path

Searched refs:jsonString (Results 1 – 25 of 33) sorted by relevance

12

/base/customization/enterprise_device_management/interfaces/inner_api/plugin_kits/src/utils/
Djson_serializer.cpp21 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()
Dbool_serializer.cpp20 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()
Dstring_serializer.cpp21 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()
Dlong_serializer.cpp23 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()
Dint_serializer.cpp24 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()
Dmap_string_serializer.cpp21 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/
Dpolicy_serializer_test.cpp85 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/
Dipolicy_serializer.h45 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/
Dnotification_json_convert.h62 … 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/
Dset_browser_policies_plugin_test.cpp100 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/
Dbool_serializer.h32 bool Deserialize(const std::string &jsonString, bool &dataObj) override;
34 bool Serialize(const bool &dataObj, std::string &jsonString) override;
Dint_serializer.h29 bool Deserialize(const std::string &jsonString, int32_t &dataObj) override;
31 bool Serialize(const int32_t &dataObj, std::string &jsonString) override;
Dlong_serializer.h29 bool Deserialize(const std::string &jsonString, int64_t &dataObj) override;
31 bool Serialize(const int64_t &dataObj, std::string &jsonString) override;
Djson_serializer.h29 bool Deserialize(const std::string &jsonString, Json::Value &dataObj) override;
31 bool Serialize(const Json::Value &dataObj, std::string &jsonString) override;
Dstring_serializer.h29 bool Deserialize(const std::string &jsonString, std::string &dataObj) override;
31 bool Serialize(const std::string &dataObj, std::string &jsonString) override;
Dmap_string_serializer.h30 …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/
Dwifi_device_config_serializer.cpp21 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
Duninstall_param_serializer.cpp20 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
Dhttp_proxy_serializer.cpp20 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
Dinstall_param_serializer.cpp20 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/
Duninstall_param_serializer.h37 bool Deserialize(const std::string &jsonString, UninstallParam &dataObj) override;
39 bool Serialize(const UninstallParam &dataObj, std::string &jsonString) override;
Dinstall_param_serializer.h37 bool Deserialize(const std::string &jsonString, InstallParam &dataObj) override;
39 bool Serialize(const InstallParam &dataObj, std::string &jsonString) override;
Dhttp_proxy_serializer.h32 …bool Deserialize(const std::string &jsonString, OHOS::NetManagerStandard::HttpProxy &dataObj) over…
34 …bool Serialize(const OHOS::NetManagerStandard::HttpProxy &dataObj, std::string &jsonString) overri…
Dwifi_device_config_serializer.h32 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/
Dusb_host_manager.cpp106 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()

12