LLVM 22.0.0git
llvm::WritableBinaryStreamRef Class Reference

#include "llvm/Support/BinaryStreamRef.h"

Inheritance diagram for llvm::WritableBinaryStreamRef:
[legend]

Public Member Functions

 WritableBinaryStreamRef ()=default
LLVM_ABI WritableBinaryStreamRef (WritableBinaryStream &Stream)
LLVM_ABI WritableBinaryStreamRef (WritableBinaryStream &Stream, uint64_t Offset, std::optional< uint64_t > Length)
LLVM_ABI WritableBinaryStreamRef (MutableArrayRef< uint8_t > Data, llvm::endianness Endian)
 WritableBinaryStreamRef (const WritableBinaryStreamRef &Other)=default
WritableBinaryStreamRefoperator= (const WritableBinaryStreamRef &Other)=default
 WritableBinaryStreamRef (WritableBinaryStreamRef &&Other)=default
WritableBinaryStreamRefoperator= (WritableBinaryStreamRef &&Other)=default
 WritableBinaryStreamRef (WritableBinaryStreamRef &S, uint64_t Offset, uint64_t Length)=delete
LLVM_ABI Error writeBytes (uint64_t Offset, ArrayRef< uint8_t > Data) const
 Given an Offset into this WritableBinaryStreamRef and some input data, writes the data to the underlying stream.
LLVM_ABI operator BinaryStreamRef () const
 Conver this WritableBinaryStreamRef to a read-only BinaryStreamRef.
LLVM_ABI Error commit ()
 For buffered streams, commits changes to the backing store.
Public Member Functions inherited from llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >
llvm::endianness getEndian () const
uint64_t getLength () const
WritableBinaryStreamRef drop_front (uint64_t N) const
 Return a new BinaryStreamRef with the first N elements removed.
WritableBinaryStreamRef drop_back (uint64_t N) const
 Return a new BinaryStreamRef with the last N elements removed.
WritableBinaryStreamRef keep_front (uint64_t N) const
 Return a new BinaryStreamRef with only the first N elements remaining.
WritableBinaryStreamRef keep_back (uint64_t N) const
 Return a new BinaryStreamRef with only the last N elements remaining.
WritableBinaryStreamRef drop_symmetric (uint64_t N) const
 Return a new BinaryStreamRef with the first and last N elements removed.
WritableBinaryStreamRef slice (uint64_t Offset, uint64_t Len) const
 Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elements.
bool valid () const

Additional Inherited Members

Protected Member Functions inherited from llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >
 BinaryStreamRefBase ()=default
BinaryStreamRefBaseoperator= (const BinaryStreamRefBase &Other)=default
Error checkOffsetForRead (uint64_t Offset, uint64_t DataSize) const
Protected Attributes inherited from llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >
std::shared_ptr< WritableBinaryStreamSharedImpl
WritableBinaryStreamBorrowedImpl
uint64_t ViewOffset
std::optional< uint64_tLength

Detailed Description

Definition at line 219 of file BinaryStreamRef.h.

Constructor & Destructor Documentation

◆ WritableBinaryStreamRef() [1/7]

llvm::WritableBinaryStreamRef::WritableBinaryStreamRef ( )
default

◆ WritableBinaryStreamRef() [2/7]

WritableBinaryStreamRef::WritableBinaryStreamRef ( WritableBinaryStream & Stream)

◆ WritableBinaryStreamRef() [3/7]

◆ WritableBinaryStreamRef() [4/7]

WritableBinaryStreamRef::WritableBinaryStreamRef ( MutableArrayRef< uint8_t > Data,
llvm::endianness Endian )
explicit

◆ WritableBinaryStreamRef() [5/7]

llvm::WritableBinaryStreamRef::WritableBinaryStreamRef ( const WritableBinaryStreamRef & Other)
default

References llvm::Other.

◆ WritableBinaryStreamRef() [6/7]

llvm::WritableBinaryStreamRef::WritableBinaryStreamRef ( WritableBinaryStreamRef && Other)
default

References llvm::Other.

◆ WritableBinaryStreamRef() [7/7]

llvm::WritableBinaryStreamRef::WritableBinaryStreamRef ( WritableBinaryStreamRef & S,
uint64_t Offset,
uint64_t Length )
delete

Member Function Documentation

◆ commit()

Error WritableBinaryStreamRef::commit ( )

For buffered streams, commits changes to the backing store.

Definition at line 123 of file BinaryStreamRef.cpp.

References llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::BorrowedImpl.

◆ operator BinaryStreamRef()

◆ operator=() [1/2]

WritableBinaryStreamRef & llvm::WritableBinaryStreamRef::operator= ( const WritableBinaryStreamRef & Other)
default

References llvm::Other.

◆ operator=() [2/2]

WritableBinaryStreamRef & llvm::WritableBinaryStreamRef::operator= ( WritableBinaryStreamRef && Other)
default

References llvm::Other.

◆ writeBytes()

Error WritableBinaryStreamRef::writeBytes ( uint64_t Offset,
ArrayRef< uint8_t > Data ) const

Given an Offset into this WritableBinaryStreamRef and some input data, writes the data to the underlying stream.

Returns
a success error code if the data could fit within the underlying stream at the specified location and the implementation could write the data, and an appropriate error code otherwise.

Definition at line 110 of file BinaryStreamRef.cpp.

References llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::BorrowedImpl, llvm::Data, llvm::Offset, and llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::ViewOffset.


The documentation for this class was generated from the following files: