Lines Matching refs:value
31 std::uint8_t value[0];
48 size_t Count(const std::string &value);
49 size_t Count(const std::vector<uint8_t> &value);
50 size_t Count(const OHOS::AAFwk::Want &value);
51 size_t Count(const std::monostate &value);
52 size_t Count(const void *value);
54 bool Write(TAG tag, const std::string &value);
55 bool Write(TAG tag, const std::vector<uint8_t> &value);
56 bool Write(TAG tag, const OHOS::AAFwk::Want &value);
57 bool Write(TAG tag, const std::monostate &value);
58 bool Write(TAG tag, const void *value);
60 bool Read(std::string &value, const TLVHead &head);
61 bool Read(std::vector<uint8_t> &value, const TLVHead &head);
62 bool Read(OHOS::AAFwk::Want &value, const TLVHead &head);
63 bool Read(std::monostate &value, const TLVHead &head);
64 bool Read(void *value, const TLVHead &head);
66 template <typename T> size_t CountBasic(const T &value);
67 template <typename T> bool WriteBasic(TAG type, const T &value);
68 template <typename T> bool ReadBasic(T &value, const TLVHead &head);
92 template <typename T> size_t TLVObject::CountBasic(const T &value)
94 static_assert(std::is_fundamental<T>::value, "T must be a fundamental type.");
95 auto size = sizeof(value) + sizeof(TLVHead);
100 template <typename T> bool TLVObject::WriteBasic(TAG type, const T &value)
102 static_assert(std::is_fundamental<T>::value, "T must be a fundamental type.");
103 if (!HasExpectBuffer(sizeof(TLVHead) + sizeof(value))) {
108 tlvHead->len = HostToNet((uint32_t)sizeof(value));
109 auto valueBuff = HostToNet(value);
110 if (memcpy_s(tlvHead->value, sizeof(value), &valueBuff, sizeof(value)) != EOK) {
113 cursor_ += sizeof(TLVHead) + sizeof(value);
117 template <typename T> bool TLVObject::ReadBasic(T &value, const TLVHead &head)
119 static_assert(std::is_fundamental<T>::value, "T must be a fundamental type.");
130 auto ret = memcpy_s(&value, sizeof(T), startCursor, sizeof(T));
134 value = NetToHost(value);