Go to the documentation of this file.
9 #ifndef LLVM_SUPPORT_BINARYSTREAM_H
10 #define LLVM_SUPPORT_BINARYSTREAM_H
101 #endif // LLVM_SUPPORT_BINARYSTREAM_H
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...
An interface for accessing data in a stream-like format, but which discourages copying.
This is an optimization pass for GlobalISel generic memory operations.
#define LLVM_MARK_AS_BITMASK_ENUM(LargestValue)
LLVM_MARK_AS_BITMASK_ENUM lets you opt in an individual enum type so you can perform bitwise operatio...
static ErrorSuccess success()
Create a success value.
virtual Error commit()=0
For buffered streams, commits changes to the backing store.
Error checkOffsetForRead(uint64_t Offset, uint64_t DataSize)
virtual uint64_t getLength()=0
Return the number of bytes of data in this stream.
~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.
virtual BinaryStreamFlags getFlags() const
Return the properties of this stream.
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.
Lightweight error class with error context and mandatory checking.
Error checkOffsetForWrite(uint64_t Offset, uint64_t DataSize)
virtual ~BinaryStream()=default
virtual llvm::support::endianness getEndian() const =0
A BinaryStream which can be read from as well as written to.
BinaryStreamFlags getFlags() const override
Return the properties of this stream.