Lines Matching refs:name
54 bool Serializable::GetValue(cJSON *node, const std::string &name, std::string &value)
56 auto subNode = GetSubNode(node, name);
58 IMSA_HILOGD("%{public}s not string!", name.c_str());
65 bool Serializable::GetValue(cJSON *node, const std::string &name, int32_t &value)
67 auto subNode = GetSubNode(node, name);
69 IMSA_HILOGD("%{public}s not number!", name.c_str());
76 bool Serializable::GetValue(cJSON *node, const std::string &name, uint32_t &value)
78 auto subNode = GetSubNode(node, name);
80 IMSA_HILOGD("%{public}s not number", name.c_str());
85 IMSA_HILOGD("%{public}s is negative", name.c_str());
92 bool Serializable::GetValue(cJSON *node, const std::string &name, bool &value)
94 auto subNode = GetSubNode(node, name);
96 IMSA_HILOGD("%{public}s not bool", name.c_str());
103 bool Serializable::GetValue(cJSON *node, const std::string &name, Serializable &value)
105 auto object = GetSubNode(node, name);
107 IMSA_HILOGD("%{public}s not object", name.c_str());
113 bool Serializable::SetValue(cJSON *node, const std::string &name, const std::string &value)
115 auto item = cJSON_AddStringToObject(node, name.c_str(), value.c_str());
119 bool Serializable::SetValue(cJSON *node, const std::string &name, const int32_t &value)
121 auto item = cJSON_AddNumberToObject(node, name.c_str(), value);
125 cJSON *Serializable::GetSubNode(cJSON *node, const std::string &name)
127 if (name.empty()) {
132 IMSA_HILOGD("not object, name:%{public}s", name.c_str());
135 if (!cJSON_HasObjectItem(node, name.c_str())) {
136 IMSA_HILOGD("subNode: %{public}s not contain.", name.c_str());
139 return cJSON_GetObjectItem(node, name.c_str());