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 | |
BinaryByteStream ()=default | |
BinaryByteStream (ArrayRef< uint8_t > Data, llvm::support::endianness Endian) | |
BinaryByteStream (StringRef 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... | |
ArrayRef< uint8_t > | data () const |
StringRef | str () const |
Public Member Functions inherited from llvm::BinaryStream | |
virtual | ~BinaryStream ()=default |
virtual BinaryStreamFlags | getFlags () const |
Return the properties of this stream. More... | |
Protected Attributes | |
llvm::support::endianness | Endian |
ArrayRef< uint8_t > | Data |
Additional Inherited Members | |
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.
BinaryByteStream guarantees that no read operation will ever incur a copy. Note that BinaryByteStream does not own the underlying buffer.
Definition at line 32 of file BinaryByteStream.h.
|
default |
|
inline |
Definition at line 35 of file BinaryByteStream.h.
|
inline |
Definition at line 37 of file BinaryByteStream.h.
|
inline |
Definition at line 60 of file BinaryByteStream.h.
References Data.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Return the number of bytes of data in this stream.
Implements llvm::BinaryStream.
Definition at line 58 of file BinaryByteStream.h.
References Data, and llvm::ArrayRef< T >::size().
Referenced by llvm::object::WindowsResource::getHeadEntry(), and llvm::AppendingBinaryByteStream::writeBytes().
|
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 42 of file BinaryByteStream.h.
References llvm::BinaryStream::checkOffsetForRead(), Data, 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 50 of file BinaryByteStream.h.
References llvm::BinaryStream::checkOffsetForRead(), Data, llvm::ArrayRef< T >::slice(), and llvm::Error::success().
|
inline |
Definition at line 62 of file BinaryByteStream.h.
References Data, llvm::ArrayRef< T >::data(), and llvm::ArrayRef< T >::size().
|
protected |
Definition at line 69 of file BinaryByteStream.h.
Referenced by data(), llvm::MutableBinaryByteStream::data(), llvm::AppendingBinaryByteStream::data(), getLength(), readBytes(), readLongestContiguousChunk(), str(), and llvm::MutableBinaryByteStream::writeBytes().
|
protected |
Definition at line 68 of file BinaryByteStream.h.
Referenced by getEndian(), and llvm::AppendingBinaryByteStream::getEndian().