class AppendingBinaryByteStream

Declaration

class AppendingBinaryByteStream : public WritableBinaryStream { /* full declaration omitted */ };

Description

An implementation of WritableBinaryStream which can write at its end causing the underlying data to grow. This class owns the underlying data.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:134

Inherits from: WritableBinaryStream

Member Variables

private std::vector<uint8_t> Data
private llvm::support::endianness Endian = llvm::support::little

Method Overview

Inherited from WritableBinaryStream:

Inherited from BinaryStream:

Methods

AppendingBinaryByteStream()

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:139

AppendingBinaryByteStream(
    llvm::support::endianness Endian)

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:140

Parameters

llvm::support::endianness Endian

void clear()

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:143

llvm::Error commit()

Description

For buffered streams, commits changes to the backing store.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:192

MutableArrayRef<uint8_t> data()

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:197

llvm::support::endianness getEndian() const

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:145

llvm::BinaryStreamFlags getFlags() const

Description

Return the properties of this stream.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:195

uint64_t getLength()

Description

Return the number of bytes of data in this stream.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:169

void insert(uint64_t Offset,
            ArrayRef<uint8_t> Bytes)

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:156

Parameters

uint64_t Offset
ArrayRef<uint8_t> Bytes

llvm::Error readBytes(uint64_t Offset,
                      uint64_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/BinaryByteStream.h:147

Parameters

uint64_t Offset
uint64_t Size
ArrayRef<uint8_t>& Buffer

llvm::Error readLongestContiguousChunk(
    uint64_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/BinaryByteStream.h:160

Parameters

uint64_t Offset
ArrayRef<uint8_t>& Buffer

llvm::Error writeBytes(uint64_t Offset,
                       ArrayRef<uint8_t> Buffer)

Description

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.

Declared at: llvm/include/llvm/Support/BinaryByteStream.h:171

Parameters

uint64_t Offset
ArrayRef<uint8_t> Buffer