LLVM
8.0.1
|
An implementation of BinaryStream which holds its entire data set in a single contiguous buffer. More...
#include "llvm/Support/BinaryByteStream.h"
Public Member Functions | |
MutableBinaryByteStream ()=default | |
MutableBinaryByteStream (MutableArrayRef< uint8_t > Data, llvm::support::endianness Endian) | |
llvm::support::endianness | getEndian () const override |
Error | readBytes (uint32_t Offset, uint32_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. More... | |
Error | readLongestContiguousChunk (uint32_t Offset, ArrayRef< uint8_t > &Buffer) override |
Given an offset into the stream, read as much as possible without copying any data. More... | |
uint32_t | getLength () override |
Return the number of bytes of data in this stream. More... | |
Error | writeBytes (uint32_t Offset, ArrayRef< uint8_t > Buffer) override |
Attempt to write the given bytes into the stream at the desired offset. More... | |
Error | commit () override |
For buffered streams, commits changes to the backing store. More... | |
MutableArrayRef< uint8_t > | data () const |
Public Member Functions inherited from llvm::WritableBinaryStream | |
~WritableBinaryStream () override=default | |
BinaryStreamFlags | getFlags () const override |
Return the properties of this stream. More... | |
Public Member Functions inherited from llvm::BinaryStream | |
virtual | ~BinaryStream ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::WritableBinaryStream | |
Error | checkOffsetForWrite (uint32_t Offset, uint32_t DataSize) |
Protected Member Functions inherited from llvm::BinaryStream | |
Error | checkOffsetForRead (uint32_t Offset, uint32_t DataSize) |
An implementation of BinaryStream which holds its entire data set in a single contiguous buffer.
As with BinaryByteStream, the mutable version also guarantees that no read operation will ever incur a copy, and similarly it does not own the underlying buffer.
Definition at line 90 of file BinaryByteStream.h.
|
default |
|
inline |
Definition at line 93 of file BinaryByteStream.h.
|
inlineoverridevirtual |
For buffered streams, commits changes to the backing store.
Implements llvm::WritableBinaryStream.
Definition at line 125 of file BinaryByteStream.h.
References llvm::Error::success().
|
inline |
Definition at line 127 of file BinaryByteStream.h.
References llvm::BinaryByteStream::Data.
|
inlineoverridevirtual |
Implements llvm::BinaryStream.
Definition at line 97 of file BinaryByteStream.h.
|
inlineoverridevirtual |
Return the number of bytes of data in this stream.
Implements llvm::BinaryStream.
Definition at line 111 of file BinaryByteStream.h.
Referenced by llvm::pdb::DbiStreamBuilder::getSourceFileNameIndex().
|
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 101 of file BinaryByteStream.h.
|
inlineoverridevirtual |
Given an offset into the stream, read as much as possible without copying any data.
Implements llvm::BinaryStream.
Definition at line 106 of file BinaryByteStream.h.
|
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 113 of file BinaryByteStream.h.
References llvm::BinaryByteStream::Data, llvm::ArrayRef< T >::data(), llvm::ArrayRef< T >::empty(), llvm::Intrinsic::memcpy, llvm::ArrayRef< T >::size(), and llvm::Error::success().