LLVM: llvm::WritableBinaryStream Class Reference (original) (raw)
A BinaryStream which can be read from as well as written to. More...
#include "[llvm/Support/BinaryStream.h](BinaryStream%5F8h%5Fsource.html)"
| Public Member Functions | |
|---|---|
| ~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 Error | commit ()=0 |
| For buffered streams, commits changes to the backing store. | |
| BinaryStreamFlags | getFlags () const override |
| Return the properties of this stream. | |
| Public Member Functions inherited from llvm::BinaryStream | |
| virtual | ~BinaryStream ()=default |
| virtual llvm::endianness | getEndian () const =0 |
| 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 ArrayRef to point to data owned by the 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. | |
| virtual uint64_t | getLength ()=0 |
| Return the number of bytes of data in this stream. |
A BinaryStream which can be read from as well as written to.
Note that writing to a BinaryStream always necessitates copying from the input buffer to the stream's backing store. Streams are assumed to be buffered so that to be portable it is necessary to call commit() on the stream when all data has been written.
Definition at line 72 of file BinaryStream.h.
| llvm::WritableBinaryStream::~WritableBinaryStream ( ) | overridedefault |
|---|
◆ checkOffsetForWrite()
Definition at line 88 of file BinaryStream.h.
References llvm::BSF_Append, llvm::BinaryStream::checkOffsetForRead(), llvm::DataSize, getFlags(), llvm::BinaryStream::getLength(), llvm::invalid_offset, llvm::make_error(), llvm::Offset, and llvm::Error::success().
Referenced by llvm::AppendingBinaryByteStream::readBytes(), llvm::AppendingBinaryByteStream::readLongestContiguousChunk(), llvm::msf::WritableMappedBlockStream::writeBytes(), and llvm::MutableBinaryByteStream::writeBytes().
◆ commit()
| virtual Error llvm::WritableBinaryStream::commit ( ) | pure virtual |
|---|
◆ getFlags()
| BinaryStreamFlags llvm::WritableBinaryStream::getFlags ( ) const | inlineoverridevirtual |
|---|
◆ writeBytes()
The documentation for this class was generated from the following file:
- include/llvm/Support/BinaryStream.h