LLVM
8.0.1
|
BinaryItemStream represents a sequence of objects stored in some kind of external container but for which it is useful to view as a stream of contiguous bytes. More...
#include "llvm/Support/BinaryItemStream.h"
Public Member Functions | |
BinaryItemStream (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... | |
void | setItems (ArrayRef< T > ItemArray) |
uint32_t | getLength () override |
Return the number of bytes of data in this stream. More... | |
Public Member Functions inherited from llvm::BinaryStream | |
virtual | ~BinaryStream ()=default |
virtual BinaryStreamFlags | getFlags () const |
Return the properties of this stream. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::BinaryStream | |
Error | checkOffsetForRead (uint32_t Offset, uint32_t DataSize) |
BinaryItemStream represents a sequence of objects stored in some kind of external container but for which it is useful to view as a stream of contiguous bytes.
An example of this might be if you have a collection of records and you serialize each one into a buffer, and store these serialized records in a container. The pointers themselves are not laid out contiguously in memory, but we may wish to read from or write to these records as if they were.
Definition at line 35 of file BinaryItemStream.h.
|
inlineexplicit |
Definition at line 37 of file BinaryItemStream.h.
|
inlineoverridevirtual |
Implements llvm::BinaryStream.
Definition at line 40 of file BinaryItemStream.h.
|
inlineoverridevirtual |
Return the number of bytes of data in this stream.
Implements llvm::BinaryStream.
Definition at line 70 of file BinaryItemStream.h.
References assert(), llvm::lower_bound(), and llvm::stream_too_short.
|
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 BinaryItemStream.h.
References llvm::stream_too_short, llvm::Error::success(), and llvm::ArrayRef< T >::take_front().
|
inlineoverridevirtual |
Given an offset into the stream, read as much as possible without copying any data.
Implements llvm::BinaryStream.
Definition at line 56 of file BinaryItemStream.h.
References llvm::Error::success().
|
inline |
Definition at line 65 of file BinaryItemStream.h.
Referenced by writeRecords().