#include "llvm/Support/DataExtractor.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/SwapByteOrder.h"
usingnamespacellvm;
bool DataExtractor::prepareRead(uint64_t Offset, uint64_t Size,
Error *E) const { … }
static bool isError(Error *E) { … }
template <typename T>
T DataExtractor::getU(uint64_t *offset_ptr, Error *Err) const { … }
template <typename T>
T *DataExtractor::getUs(uint64_t *offset_ptr, T *dst, uint32_t count,
Error *Err) const { … }
uint8_t DataExtractor::getU8(uint64_t *offset_ptr, llvm::Error *Err) const { … }
uint8_t *DataExtractor::getU8(uint64_t *offset_ptr, uint8_t *dst,
uint32_t count) const { … }
uint8_t *DataExtractor::getU8(Cursor &C, uint8_t *Dst, uint32_t Count) const { … }
uint16_t DataExtractor::getU16(uint64_t *offset_ptr, llvm::Error *Err) const { … }
uint16_t *DataExtractor::getU16(uint64_t *offset_ptr, uint16_t *dst,
uint32_t count) const { … }
uint32_t DataExtractor::getU24(uint64_t *OffsetPtr, Error *Err) const { … }
uint32_t DataExtractor::getU32(uint64_t *offset_ptr, llvm::Error *Err) const { … }
uint32_t *DataExtractor::getU32(uint64_t *offset_ptr, uint32_t *dst,
uint32_t count) const { … }
uint64_t DataExtractor::getU64(uint64_t *offset_ptr, llvm::Error *Err) const { … }
uint64_t *DataExtractor::getU64(uint64_t *offset_ptr, uint64_t *dst,
uint32_t count) const { … }
uint64_t DataExtractor::getUnsigned(uint64_t *offset_ptr, uint32_t byte_size,
llvm::Error *Err) const { … }
int64_t
DataExtractor::getSigned(uint64_t *offset_ptr, uint32_t byte_size) const { … }
StringRef DataExtractor::getCStrRef(uint64_t *OffsetPtr, Error *Err) const { … }
StringRef DataExtractor::getFixedLengthString(uint64_t *OffsetPtr,
uint64_t Length,
StringRef TrimChars) const { … }
StringRef DataExtractor::getBytes(uint64_t *OffsetPtr, uint64_t Length,
Error *Err) const { … }
template <typename T>
static T getLEB128(StringRef Data, uint64_t *OffsetPtr, Error *Err,
T (&Decoder)(const uint8_t *p, unsigned *n,
const uint8_t *end, const char **error)) { … }
uint64_t DataExtractor::getULEB128(uint64_t *offset_ptr, Error *Err) const { … }
int64_t DataExtractor::getSLEB128(uint64_t *offset_ptr, Error *Err) const { … }
void DataExtractor::skip(Cursor &C, uint64_t Length) const { … }