Lines Matching defs:value
38 bool PutIntValueToFormatMap(FormatDataMap &formatMap, const std::string_view &key, int32_t value)
42 data.val.int32Val = value;
47 bool PutLongValueToFormatMap(FormatDataMap &formatMap, const std::string_view &key, int64_t value)
51 data.val.int64Val = value;
56 bool PutFloatValueToFormatMap(FormatDataMap &formatMap, const std::string_view &key, float value)
60 data.val.floatVal = value;
65 bool PutDoubleValueToFormatMap(FormatDataMap &formatMap, const std::string_view &key, double value)
69 data.val.doubleVal = value;
74 bool PutStringValueToFormatMap(FormatDataMap &formatMap, const std::string_view &key, const std::string_view &value)
78 data.stringVal = value;
144 bool Format::PutIntValue(const std::string_view &key, int32_t value)
149 Any::IsSameTypeWith<int32_t>(defaultValue.value()) ||
150 Any::IsSameTypeWith<bool>(defaultValue.value()) || IsIntEnum(key.data());
151 FALSE_RETURN_V_MSG_E(isSameType, false, "Key's value type does not match int32, key: %{public}s", key.data());
154 return SetMetaData(*meta_, std::string(key), value);
157 bool Format::PutLongValue(const std::string_view &key, int64_t value)
162 Any::IsSameTypeWith<int64_t>(defaultValue.value()) || IsLongEnum(key.data());
163 FALSE_RETURN_V_MSG_E(isSameType, false, "Key's value type does not match int64, key: %{public}s", key.data());
165 return SetMetaData(*meta_, std::string(key), value);
168 bool Format::PutFloatValue(const std::string_view &key, float value)
172 auto isSameType = Any::IsSameTypeWith<float>(defaultValue.value());
173 FALSE_RETURN_V_MSG_E(isSameType, false, "Key's value type does not match float, key: %{public}s", key.data());
176 meta_->SetData(std::string(key), value);
180 bool Format::PutDoubleValue(const std::string_view &key, double value)
184 auto isSameType = Any::IsSameTypeWith<double>(defaultValue.value());
185 FALSE_RETURN_V_MSG_E(isSameType, false, "Key's value type does not match double, key: %{public}s", key.data());
188 meta_->SetData(std::string(key), value);
192 bool Format::PutStringValue(const std::string_view &key, const std::string_view &value)
196 auto isSameType = Any::IsSameTypeWith<std::string>(defaultValue.value());
197 FALSE_RETURN_V_MSG_E(isSameType, false, "Key's value type does not match string, key: %{public}s", key.data());
200 meta_->SetData(std::string(key), std::string(value));
208 auto isSameType = Any::IsSameTypeWith<std::vector<uint8_t>>(defaultValue.value());
209 FALSE_RETURN_V_MSG_E(isSameType, false, "Key's value type does not match buffer, key: %{public}s", key.data());
216 std::vector<uint8_t> value(addr, addr + size);
217 meta_->SetData(std::string(key), std::move(value));
220 Any *value = const_cast<Any *>(&(iter->second));
221 auto tmpVector = AnyCast<std::vector<uint8_t>>(value);
222 FALSE_RETURN_V_MSG_E(tmpVector != nullptr, false, "Any value is invalid. Key: " PUBLIC_LOG_S, key.data());
237 bool Format::GetIntValue(const std::string_view &key, int32_t &value) const
239 return GetMetaData(*meta_, std::string(key), value);
242 bool Format::GetLongValue(const std::string_view &key, int64_t &value) const
244 return GetMetaData(*meta_, std::string(key), value);
247 bool Format::GetFloatValue(const std::string_view &key, float &value) const
249 return meta_->GetData(std::string(key), value);
252 bool Format::GetDoubleValue(const std::string_view &key, double &value) const
254 return meta_->GetData(std::string(key), value);
257 bool Format::GetStringValue(const std::string_view &key, std::string &value) const
259 return meta_->GetData(std::string(key), value);
267 Any *value = const_cast<Any *>(&(iter->second));
268 if (AnyCast<Buf>(value) != nullptr) {
269 *addr = (AnyCast<Buf>(value))->data();
270 size = (AnyCast<Buf>(value))->size();
277 bool Format::PutFormatVector(const std::string_view &key, std::vector<Format> &value)
280 auto ret = formatVecMap_.insert(std::make_pair(std::string(key), value));
284 bool Format::GetFormatVector(const std::string_view &key, std::vector<Format> &value) const
289 value.assign(iter->second.begin(), iter->second.end());
361 Any *value = const_cast<Any *>(&(iter->second));
362 uint8_t *addr = (AnyCast<std::vector<uint8_t>>(value))->data();
363 size_t size = (AnyCast<std::vector<uint8_t>>(value))->size();
370 FALSE_LOG_MSG(ret, "Put value to formatMap failed, key = %{public}s", iter->first.c_str());
404 Any *value = const_cast<Any *>(&(iter->second));
405 if (AnyCast<std::vector<uint8_t>>(value) != nullptr) {
406 dumpStream << iter->first << ", bufferSize = " << (AnyCast<std::vector<uint8_t>>(value))->size()