Lines Matching refs:Data
33 template <typename Fn> bool Adapt(Fn F, const uint8_t *Data, size_t Size);
44 size_t UnpackPrimitive(const uint8_t *Data, size_t Size, T *Value) { in UnpackPrimitive() argument
47 *Value = *reinterpret_cast<const T *>(Data); in UnpackPrimitive()
55 size_t UnpackSingle(const uint8_t *Data, size_t Size, T *Value);
59 size_t UnpackSingle<Type>(const uint8_t *Data, size_t Size, Type *Value) { \
60 return UnpackPrimitive(Data, Size, Value); \
86 size_t UnpackSingle<std::vector<uint8_t>>(const uint8_t *Data, size_t Size, in UNPACK_SINGLE_PRIMITIVE()
90 size_t Len = std::min(static_cast<size_t>(*Data), Size - 1); in UNPACK_SINGLE_PRIMITIVE()
91 std::vector<uint8_t> V(Data + 1, Data + 1 + Len); in UNPACK_SINGLE_PRIMITIVE()
97 size_t UnpackSingle<std::string>(const uint8_t *Data, size_t Size,
101 size_t Len = std::min(static_cast<size_t>(*Data), Size - 1);
102 std::string S(Data + 1, Data + 1 + Len);
112 UnpackImpl(const uint8_t *Data, size_t Size, TupleT *Tuple) { in UnpackImpl() argument
119 UnpackImpl(const uint8_t *Data, size_t Size, TupleT *Tuple) {
120 size_t NewSize = UnpackSingle(Data, Size, &std::get<N>(*Tuple));
125 return UnpackImpl<N + 1, TupleT>(Data + (Size - NewSize), NewSize, Tuple);
130 bool Unpack(const uint8_t *Data, size_t Size, std::tuple<Args...> *Tuple) { in Unpack() argument
131 return UnpackImpl<0, std::tuple<Args...>>(Data, Size, Tuple); in Unpack()
170 bool UnpackAndApply(Fn F, const uint8_t *Data, size_t Size) {
172 if (!Unpack(Data, Size, &Tuple))
181 template <typename Fn> bool Adapt(Fn F, const uint8_t *Data, size_t Size) {
182 return impl::UnpackAndApply(F, Data, Size);