LLVM: include/llvm/Support/BinaryStream.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_SUPPORT_BINARYSTREAM_H

10#define LLVM_SUPPORT_BINARYSTREAM_H

11

16#include

17

18namespace llvm {

19

26

27

28

29

30

31

32

33

35public:

37

39

40

41

42

45

46

47

50

51

53

54

56

57protected:

65};

66

67

68

69

70

71

73public:

75

76

77

78

80

81

83

84

86

87protected:

96};

97

98}

99

100#endif

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

An interface for accessing data in a stream-like format, but which discourages copying.

Definition BinaryStream.h:34

virtual llvm::endianness getEndian() const =0

virtual uint64_t getLength()=0

Return the number of bytes of data in this stream.

virtual ~BinaryStream()=default

virtual Error readBytes(uint64_t Offset, uint64_t Size, ArrayRef< uint8_t > &Buffer)=0

Given an offset into the stream and a number of bytes, attempt to read the bytes and set the output A...

virtual Error readLongestContiguousChunk(uint64_t Offset, ArrayRef< uint8_t > &Buffer)=0

Given an offset into the stream, read as much as possible without copying any data.

virtual BinaryStreamFlags getFlags() const

Return the properties of this stream.

Definition BinaryStream.h:55

Error checkOffsetForRead(uint64_t Offset, uint64_t DataSize)

Definition BinaryStream.h:58

Lightweight error class with error context and mandatory checking.

static ErrorSuccess success()

Create a success value.

A BinaryStream which can be read from as well as written to.

Definition BinaryStream.h:72

Error checkOffsetForWrite(uint64_t Offset, uint64_t DataSize)

Definition BinaryStream.h:88

~WritableBinaryStream() override=default

virtual Error writeBytes(uint64_t Offset, ArrayRef< uint8_t > Data)=0

Attempt to write the given bytes into the stream at the desired offset.

BinaryStreamFlags getFlags() const override

Return the properties of this stream.

Definition BinaryStream.h:85

virtual Error commit()=0

For buffered streams, commits changes to the backing store.

This is an optimization pass for GlobalISel generic memory operations.

BinaryStreamFlags

Definition BinaryStream.h:20

@ BSF_None

Definition BinaryStream.h:21

@ BSF_Append

Definition BinaryStream.h:23

@ BSF_Write

Definition BinaryStream.h:22

FunctionAddr VTableAddr uintptr_t uintptr_t DataSize

Error make_error(ArgTs &&... Args)

Make a Error instance representing failure using the given error info type.

@ LLVM_MARK_AS_BITMASK_ENUM

FunctionAddr VTableAddr uintptr_t uintptr_t Data