Lines Matching refs:value

36     std::uint8_t value[0];

73 static inline size_t Count(bool value)
75 return sizeof(value) + sizeof(TLVHead);
77 static inline size_t Count(int8_t value)
79 return sizeof(value) + sizeof(TLVHead);
81 static inline size_t Count(int16_t value)
83 return sizeof(value) + sizeof(TLVHead);
85 static inline size_t Count(int32_t value)
87 return sizeof(value) + sizeof(TLVHead);
89 static inline size_t Count(double value)
91 return sizeof(value) + sizeof(TLVHead);
93 static inline size_t Count(int64_t value)
95 return sizeof(value) + sizeof(TLVHead);
97 static inline size_t Count(uint32_t value)
99 return sizeof(value) + sizeof(TLVHead);
101 static inline size_t Count(const std::string &value)
103 return value.size() + sizeof(TLVHead);
105 static inline size_t Count(const RawMem &value)
107 return value.bufferLen + sizeof(TLVHead);
109 static inline size_t Count(TLVObject &value)
111 return value.Count() + sizeof(TLVHead);
114 inline size_t Count(const std::shared_ptr<T> value)
116 if (value == nullptr) {
119 return Count(*value);
122 inline size_t Count(const std::vector<T> &value)
125 for (auto &item : value) {
130 static inline size_t Count(const std::vector<uint8_t> &value)
133 expectSize += value.size();
136 static inline size_t Count(const std::map<std::string, std::vector<uint8_t>> &value)
139 for (auto &item : value) {
146 static inline size_t Count(const Details &value)
149 for (auto &item : value) {
156 static inline size_t Count(const std::shared_ptr<AAFwk::Want> &value)
159 if (value == nullptr) {
162 return expectSize + Count(ParcelUtil::Parcelable2Raw(value.get()));
165 static inline size_t Count(std::shared_ptr<Media::PixelMap> value)
168 if (value == nullptr) {
171 return expectSize + Count(PixelMap2Vector(value));
174 static inline size_t Count(const std::shared_ptr<Object> &value)
177 if (value == nullptr) {
180 for (auto &item : value->value_) {
187 static inline size_t Count(const std::monostate &value)
192 static inline size_t Count(const void *value)
197 static std::shared_ptr<Media::PixelMap> Vector2PixelMap(std::vector<std::uint8_t> &value);
222 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, std::monostate value);
223 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, void *value);
224 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, bool value);
225 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, double value);
226 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, int8_t value);
227 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, int16_t value);
228 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, int32_t value);
229 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, int64_t value);
230 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, uint32_t value);
231 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, const std::string &value);
232 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, const Object &value);
233 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, const AAFwk::Want &value);
234 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, const Media::PixelMap &value);
235 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, const RawMem &value);
236 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, TLVObject &value);
238 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, std::vector<T> &value)
246 bool ret = WriteValue(buffer, value);
250 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, std::vector<uint8_t> &value);
251 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, std::map<std::string, std::vector<uint8_t>> &value);
253 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, std::shared_ptr<T> &value)
255 if (value == nullptr) {
258 return Write(buffer, type, *value);
273 bool Write(std::vector<std::uint8_t> &buffer, uint16_t type, const Details &value);
276 bool ReadValue(const std::vector<std::uint8_t> &buffer, bool &value, const TLVHead &head);
277 bool ReadValue(const std::vector<std::uint8_t> &buffer, std::monostate &value, const TLVHead &head);
278 bool ReadValue(const std::vector<std::uint8_t> &buffer, void *value, const TLVHead &head);
279 bool ReadValue(const std::vector<std::uint8_t> &buffer, int8_t &value, const TLVHead &head);
280 bool ReadValue(const std::vector<std::uint8_t> &buffer, int16_t &value, const TLVHead &head);
281 bool ReadValue(const std::vector<std::uint8_t> &buffer, int32_t &value, const TLVHead &head);
282 bool ReadValue(const std::vector<std::uint8_t> &buffer, int64_t &value, const TLVHead &head);
283 bool ReadValue(const std::vector<std::uint8_t> &buffer, double &value, const TLVHead &head);
284 bool ReadValue(const std::vector<std::uint8_t> &buffer, uint32_t &value, const TLVHead &head);
285 bool ReadValue(const std::vector<std::uint8_t> &buffer, std::string &value, const TLVHead &head);
287 bool ReadValue(const std::vector<std::uint8_t> &buffer, Object &value, const TLVHead &head);
288 bool ReadValue(const std::vector<std::uint8_t> &buffer, AAFwk::Want &value, const TLVHead &head);
290 const std::vector<std::uint8_t> &buffer, std::shared_ptr<Media::PixelMap> &value, const TLVHead &head);
291 bool ReadValue(const std::vector<std::uint8_t> &buffer, TLVObject &value, const TLVHead &head);
293 bool ReadValue(const std::vector<std::uint8_t> &buffer, std::vector<T> &value, const TLVHead &head)
297 // V: item value
305 value.push_back(item);
310 bool ReadValue(const std::vector<std::uint8_t> &buffer, std::vector<uint8_t> &value, const TLVHead &head);
321 bool ReadValue(const std::vector<std::uint8_t> &buffer, std::variant<_Types...> &value, const TLVHead &head);
324 bool ReadValue(const std::vector<std::uint8_t> &buffer, EntryValue &value, const TLVHead &head);
326 bool ReadValue(const std::vector<std::uint8_t> &buffer, Details &value, const TLVHead &head);
327 bool ReadValue(const std::vector<std::uint8_t> &buffer, std::map<std::string, std::vector<uint8_t>> &value,
331 bool ReadValue(const std::vector<std::uint8_t> &buffer, std::shared_ptr<T> &value, const TLVHead &head)
333 value = std::make_shared<T>();
334 if (value == nullptr) {
337 return ReadValue(buffer, *value, head);
367 bool WriteBasic(std::vector<std::uint8_t> &buffer, uint16_t type, T value)
369 if (!HasExpectBuffer(buffer, sizeof(TLVHead) + sizeof(value))) {
374 tlvHead->len = HostToNet((uint32_t)sizeof(value));
375 auto valueBuff = HostToNet(value);
376 auto ret = memcpy_s(tlvHead->value, sizeof(value), &valueBuff, sizeof(value));
380 cursor_ += sizeof(TLVHead) + sizeof(value);
385 bool WriteValue(std::vector<std::uint8_t> &buffer, std::vector<T> &value)
389 for (T &item : value) {
390 // V:item value
396 bool ReadBasicValue(const std::vector<std::uint8_t> &buffer, bool &value, const TLVHead &head)
405 auto ret = memcpy_s(&value, sizeof(bool), buffer.data() + cursor_, sizeof(bool));
412 value = NetToHost(value);
418 bool ReadBasicValue(const std::vector<std::uint8_t> &buffer, T &value, const TLVHead &head)
426 auto ret = memcpy_s(&value, sizeof(T), buffer.data() + cursor_, sizeof(T));
430 value = NetToHost(value);