10 #ifndef LLVM_DEBUGINFO_MSF_STREAMREADER_H
11 #define LLVM_DEBUGINFO_MSF_STREAMREADER_H
46 typename std::underlying_type<T>::type
N;
49 Dest =
static_cast<T>(
N);
57 Dest =
reinterpret_cast<const T *
>(Buffer.
data());
64 if (NumElements == 0) {
69 if (NumElements > UINT32_MAX /
sizeof(
T))
72 if (
auto EC =
readBytes(Bytes, NumElements *
sizeof(
T)))
78 template <
typename T,
typename U>
94 if (Length /
sizeof(
T) != NumItems)
112 uint8_t
peek()
const;
121 #endif // LLVM_DEBUGINFO_MSF_STREAMREADER_H
RefType slice(uint32_t Offset, uint32_t Len) const
Error readFixedString(StringRef &Dest, uint32_t Length)
uint32_t getLength() const
void setOffset(uint32_t Off)
Error readArray(FixedStreamArray< T > &Array, uint32_t NumItems)
Error readArray(VarStreamArray< T, U > &Array, uint32_t Size)
Error readZeroString(StringRef &Dest)
uint32_t getLength() const
Error readBytes(ArrayRef< uint8_t > &Buffer, uint32_t Size)
Error readInteger(uint8_t &Dest)
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Error skip(uint32_t Amount)
Error readLongestContiguousChunk(ArrayRef< uint8_t > &Buffer)
const Extractor & getExtractor() const
uint32_t getOffset() const
static ErrorSuccess success()
Create a success value.
Error readStreamRef(ReadableStreamRef &Ref)
uint32_t bytesRemaining() const
StreamReader(ReadableStreamRef Stream)
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
Error readObject(const T *&Dest)