18 bool isLittleEndian,
const char *Data) {
20 uint32_t offset = *offset_ptr;
27 *offset_ptr +=
sizeof(val);
33 static T *
getUs(uint32_t *offset_ptr,
T *dst, uint32_t count,
34 const DataExtractor *de,
bool isLittleEndian,
const char *Data){
35 uint32_t offset = *offset_ptr;
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());
66 uint32_t count)
const {
67 return getUs<uint16_t>(offset_ptr, dst, count,
this, IsLittleEndian,
72 return getU<uint32_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
76 uint32_t count)
const {
77 return getUs<uint32_t>(offset_ptr, dst, count,
this, IsLittleEndian,
82 return getU<uint64_t>(offset_ptr,
this, IsLittleEndian, Data.
data());
86 uint32_t count)
const {
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);
122 uint32_t offset = *offset_ptr;
125 *offset_ptr = pos + 1;
126 return Data.
data() + offset;
137 uint32_t offset = *offset_ptr;
141 byte = Data[offset++];
142 result |= uint64_t(byte & 0x7f) << shift;
144 if ((byte & 0x80) == 0)
148 *offset_ptr = offset;
158 uint32_t offset = *offset_ptr;
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.
size_t find(char C, size_t From=0) const
#define llvm_unreachable(msg)
static const bool IsLittleEndianHost
const char * data() const
unsigned char SwapByteOrder(unsigned char C)
bool empty() const
empty - Check if the string is empty.