class BinaryStream

Declaration

class BinaryStream { /* full declaration omitted */ };

Description

An interface for accessing data in a stream-like format, but which discourages copying. Instead of specifying a buffer in which to copy data on a read, the API returns an ArrayRef to data owned by the stream's implementation. Since implementations may not necessarily store data in a single contiguous buffer (or even in memory at all), in such cases a it may be necessary for an implementation to cache such a buffer so that it can return it.

Declared at: llvm/include/llvm/Support/BinaryStream.h:35

Method Overview

Methods

llvm::Error checkOffsetForRead(uint32_t Offset,
                               uint32_t DataSize)

Declared at: llvm/include/llvm/Support/BinaryStream.h:59

Parameters

uint32_t Offset
uint32_t DataSize

virtual llvm::support::endianness getEndian()
    const

Declared at: llvm/include/llvm/Support/BinaryStream.h:39

virtual llvm::BinaryStreamFlags getFlags() const

Description

Return the properties of this stream.

Declared at: llvm/include/llvm/Support/BinaryStream.h:56

virtual uint32_t getLength()

Description

Return the number of bytes of data in this stream.

Declared at: llvm/include/llvm/Support/BinaryStream.h:53

virtual llvm::Error readBytes(
    uint32_t Offset,
    uint32_t Size,
    ArrayRef<uint8_t>& Buffer)

Description

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.

Declared at: llvm/include/llvm/Support/BinaryStream.h:44

Parameters

uint32_t Offset
uint32_t Size
ArrayRef<uint8_t>& Buffer

virtual llvm::Error readLongestContiguousChunk(
    uint32_t Offset,
    ArrayRef<uint8_t>& Buffer)

Description

Given an offset into the stream, read as much as possible without copying any data.

Declared at: llvm/include/llvm/Support/BinaryStream.h:49

Parameters

uint32_t Offset
ArrayRef<uint8_t>& Buffer

virtual ~BinaryStream()

Declared at: llvm/include/llvm/Support/BinaryStream.h:37