22 std::memcpy(&val, &Data[offset],
sizeof(val));
27 *offset_ptr +=
sizeof(val);
38 for (
T *value_ptr = dst, *
end = dst + count; value_ptr !=
end;
39 ++value_ptr, offset +=
sizeof(*dst))
40 *value_ptr = getU<T>(offset_ptr, de, isLittleEndian, Data);
51 return getU<uint8_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
56 return getUs<uint8_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
62 return getU<uint16_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
67 return getUs<uint16_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
72 return getU<uint32_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
77 return getUs<uint32_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
82 return getU<uint64_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
87 return getUs<uint64_t>(offset_ptr, dst,
count,
this, IsLittleEndian,
95 return getU8(offset_ptr);
101 return getU64(offset_ptr);
110 return (int8_t)
getU8(offset_ptr);
112 return (int16_t)
getU16(offset_ptr);
114 return (int32_t)
getU32(offset_ptr);
116 return (int64_t)
getU64(offset_ptr);
125 *offset_ptr = pos + 1;
126 return Data.
data() + offset;
141 byte = Data[offset++];
142 result |= uint64_t(byte & 0x7f) << shift;
144 if ((byte & 0x80) == 0)
148 *offset_ptr = offset;
162 byte = Data[offset++];
163 result |= uint64_t(byte & 0x7f) << shift;
165 if ((byte & 0x80) == 0)
170 if (shift < 64 && (byte & 0x40))
171 result |= -(1ULL << shift);
173 *offset_ptr = offset;
const_iterator end(StringRef path)
Get end iterator over path.
void swapByteOrder(T &Value)
static const bool IsLittleEndianHost
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(std::begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).