LLVM 20.0.0git
|
An implementation of WritableBinaryStream which can write at its end causing the underlying data to grow. More...
#include "llvm/Support/BinaryByteStream.h"
Public Member Functions | |
AppendingBinaryByteStream ()=default | |
AppendingBinaryByteStream (llvm::endianness Endian) | |
void | clear () |
llvm::endianness | getEndian () const override |
Error | readBytes (uint64_t Offset, uint64_t Size, ArrayRef< uint8_t > &Buffer) override |
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. | |
void | insert (uint64_t Offset, ArrayRef< uint8_t > Bytes) |
Error | readLongestContiguousChunk (uint64_t Offset, ArrayRef< uint8_t > &Buffer) override |
Given an offset into the stream, read as much as possible without copying any data. | |
uint64_t | getLength () override |
Return the number of bytes of data in this stream. | |
Error | writeBytes (uint64_t Offset, ArrayRef< uint8_t > Buffer) override |
Attempt to write the given bytes into the stream at the desired offset. | |
Error | commit () override |
For buffered streams, commits changes to the backing store. | |
BinaryStreamFlags | getFlags () const override |
Return the properties of this stream. | |
MutableArrayRef< uint8_t > | data () |
Public Member Functions inherited from llvm::WritableBinaryStream | |
~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. | |
virtual BinaryStreamFlags | getFlags () const |
Return the properties of this stream. | |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::WritableBinaryStream | |
Error | checkOffsetForWrite (uint64_t Offset, uint64_t DataSize) |
Protected Member Functions inherited from llvm::BinaryStream | |
Error | checkOffsetForRead (uint64_t Offset, uint64_t DataSize) |
An implementation of WritableBinaryStream which can write at its end causing the underlying data to grow.
This class owns the underlying data.
Definition at line 134 of file BinaryByteStream.h.
|
default |
|
inline |
Definition at line 140 of file BinaryByteStream.h.
References Endian.
|
inline |
Definition at line 142 of file BinaryByteStream.h.
Referenced by llvm::codeview::ContinuationRecordBuilder::begin().
|
inlineoverridevirtual |
For buffered streams, commits changes to the backing store.
Implements llvm::WritableBinaryStream.
Definition at line 191 of file BinaryByteStream.h.
References llvm::Error::success().
|
inline |
Definition at line 196 of file BinaryByteStream.h.
|
inlineoverridevirtual |
Implements llvm::BinaryStream.
Definition at line 144 of file BinaryByteStream.h.
References Endian.
|
inlineoverridevirtual |
Return the properties of this stream.
Reimplemented from llvm::BinaryStream.
Definition at line 194 of file BinaryByteStream.h.
References llvm::BSF_Append, and llvm::BSF_Write.
|
inlineoverridevirtual |
Return the number of bytes of data in this stream.
Implements llvm::BinaryStream.
Definition at line 168 of file BinaryByteStream.h.
Referenced by writeBytes().
Definition at line 155 of file BinaryByteStream.h.
References llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), and llvm::Offset.
|
inlineoverridevirtual |
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.
Implements llvm::BinaryStream.
Definition at line 146 of file BinaryByteStream.h.
References llvm::WritableBinaryStream::checkOffsetForWrite(), llvm::Offset, llvm::ArrayRef< T >::size(), Size, llvm::ArrayRef< T >::slice(), and llvm::Error::success().
|
inlineoverridevirtual |
Given an offset into the stream, read as much as possible without copying any data.
Implements llvm::BinaryStream.
Definition at line 159 of file BinaryByteStream.h.
References llvm::WritableBinaryStream::checkOffsetForWrite(), llvm::Offset, llvm::ArrayRef< T >::slice(), and llvm::Error::success().
|
inlineoverridevirtual |
Attempt to write the given bytes into the stream at the desired offset.
This will always necessitate a copy. Cannot shrink or grow the stream, only writes into existing allocated space.
Implements llvm::WritableBinaryStream.
Definition at line 170 of file BinaryByteStream.h.
References llvm::ArrayRef< T >::data(), llvm::ArrayRef< T >::empty(), getLength(), llvm::invalid_offset, llvm::Offset, llvm::ArrayRef< T >::size(), and llvm::Error::success().