LLVM 20.0.0git
Public Member Functions | List of all members
llvm::WritableBinaryStreamRef Class Reference

#include "llvm/Support/BinaryStreamRef.h"

Inheritance diagram for llvm::WritableBinaryStreamRef:
Inheritance graph
[legend]

Public Member Functions

 WritableBinaryStreamRef ()=default
 
 WritableBinaryStreamRef (WritableBinaryStream &Stream)
 
 WritableBinaryStreamRef (WritableBinaryStream &Stream, uint64_t Offset, std::optional< uint64_t > Length)
 
 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
 
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.
 
 operator BinaryStreamRef () const
 Conver this WritableBinaryStreamRef to a read-only BinaryStreamRef.
 
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
 
 BinaryStreamRefBase (WritableBinaryStream &BorrowedImpl)
 
 BinaryStreamRefBase (std::shared_ptr< WritableBinaryStream > SharedImpl, uint64_t Offset, std::optional< uint64_t > Length)
 
 BinaryStreamRefBase (WritableBinaryStream &BorrowedImpl, uint64_t Offset, std::optional< uint64_t > Length)
 
 BinaryStreamRefBase (const BinaryStreamRefBase &Other)=default
 
 BinaryStreamRefBase (BinaryStreamRefBase &&Other)=default
 
BinaryStreamRefBaseoperator= (const BinaryStreamRefBase &Other)=default
 
BinaryStreamRefBaseoperator= (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 217 of file BinaryStreamRef.h.

Constructor & Destructor Documentation

◆ WritableBinaryStreamRef() [1/7]

llvm::WritableBinaryStreamRef::WritableBinaryStreamRef ( )
default

◆ WritableBinaryStreamRef() [2/7]

WritableBinaryStreamRef::WritableBinaryStreamRef ( WritableBinaryStream Stream)

Definition at line 97 of file BinaryStreamRef.cpp.

◆ WritableBinaryStreamRef() [3/7]

WritableBinaryStreamRef::WritableBinaryStreamRef ( WritableBinaryStream Stream,
uint64_t  Offset,
std::optional< uint64_t Length 
)

Definition at line 100 of file BinaryStreamRef.cpp.

◆ WritableBinaryStreamRef() [4/7]

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

Definition at line 105 of file BinaryStreamRef.cpp.

References Endian, and llvm::size().

◆ WritableBinaryStreamRef() [5/7]

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

◆ WritableBinaryStreamRef() [6/7]

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

◆ WritableBinaryStreamRef() [7/7]

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

Member Function Documentation

◆ commit()

Error WritableBinaryStreamRef::commit ( )

◆ operator BinaryStreamRef()

WritableBinaryStreamRef::operator BinaryStreamRef ( ) const

Conver this WritableBinaryStreamRef to a read-only BinaryStreamRef.

Definition at line 118 of file BinaryStreamRef.cpp.

References llvm::Length.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ 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, llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::ViewOffset, and llvm::WritableBinaryStream::writeBytes().

Referenced by llvm::BinaryStreamWriter::writeBytes(), and llvm::msf::WritableMappedBlockStream::writeBytes().


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