llvm::BinaryStreamWriter

Provides write-only access to a subclass of WritableBinaryStream.

Synopsis

Declared in <llvm/Support/BinaryStreamWriter.h>

class BinaryStreamWriter;

Description

Provides bounds checking and helpers for writing certain common data types such as null-terminated strings, integers in various flavors of endianness, etc. Can be subclassed to provide reading and writing of custom datatypes, although no methods are overridable.

Member Functions

NameDescription
BinaryStreamWriter [constructor]Constructors
~BinaryStreamWriter [destructor] [virtual]Destroy a BinaryStreamWriter.
operator= Copy-assign a BinaryStreamWriter.
bytesRemaining Return the number of bytes remaining from the current offset.
getLength Return the length of the underlying stream.
getOffset Return the current write offset.
padToAlignment Pad the stream with zeros up to the next multiple of Align.
setOffset Set the current write offset.
split Split this writer into two writers at Off.
writeArray writeArray overloads
writeBytes Write the bytes in Buffer to the underlying stream.
writeCString Write Str followed by a null terminator.
writeEnum Write the enum Num as its underlying integer value.
writeFixedString Write Str without a null terminator.
writeInteger Write the integer Value in the stream's endianness.
writeObject Write Obj to the underlying stream as if by memcpy.
writeSLEB128 Write Value to the underlying stream using SLEB128 encoding.
writeStreamRef writeStreamRef overloads
writeULEB128 Write Value to the underlying stream using ULEB128 encoding.

Protected Data Members

NameDescription
Offset The current byte offset for subsequent writes.
Stream The underlying writable stream being written to.

Non-Member Functions

NameDescription
pdb::writeSparseBitVectorWrite a SparseBitVector to a PDB binary stream.