LLVM  14.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]
Collaboration diagram for llvm::WritableBinaryStreamRef:
Collaboration graph
[legend]

Public Member Functions

 WritableBinaryStreamRef ()=default
 
 WritableBinaryStreamRef (WritableBinaryStream &Stream)
 
 WritableBinaryStreamRef (WritableBinaryStream &Stream, uint64_t Offset, Optional< uint64_t > Length)
 
 WritableBinaryStreamRef (MutableArrayRef< uint8_t > Data, llvm::support::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. More...
 
 operator BinaryStreamRef () const
 Conver this WritableBinaryStreamRef to a read-only BinaryStreamRef. More...
 
Error commit ()
 For buffered streams, commits changes to the backing store. More...
 
- Public Member Functions inherited from llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >
llvm::support::endianness getEndian () const
 
uint64_t getLength () const
 
WritableBinaryStreamRef drop_front (uint64_t N) const
 Return a new BinaryStreamRef with the first N elements removed. More...
 
WritableBinaryStreamRef drop_back (uint64_t N) const
 Return a new BinaryStreamRef with the last N elements removed. More...
 
WritableBinaryStreamRef keep_front (uint64_t N) const
 Return a new BinaryStreamRef with only the first N elements remaining. More...
 
WritableBinaryStreamRef keep_back (uint64_t N) const
 Return a new BinaryStreamRef with only the last N elements remaining. More...
 
WritableBinaryStreamRef drop_symmetric (uint64_t N) const
 Return a new BinaryStreamRef with the first and last N elements removed. More...
 
WritableBinaryStreamRef slice (uint64_t Offset, uint64_t Len) const
 Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elements. More...
 
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, Optional< uint64_t > Length)
 
 BinaryStreamRefBase (WritableBinaryStream &BorrowedImpl, uint64_t Offset, 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
 
Optional< uint64_tLength
 

Detailed Description

Definition at line 221 of file BinaryStreamRef.h.

Constructor & Destructor Documentation

◆ WritableBinaryStreamRef() [1/7]

llvm::WritableBinaryStreamRef::WritableBinaryStreamRef ( )
default

◆ WritableBinaryStreamRef() [2/7]

WritableBinaryStreamRef::WritableBinaryStreamRef ( WritableBinaryStream Stream)

Definition at line 103 of file BinaryStreamRef.cpp.

◆ WritableBinaryStreamRef() [3/7]

WritableBinaryStreamRef::WritableBinaryStreamRef ( WritableBinaryStream Stream,
uint64_t  Offset,
Optional< uint64_t Length 
)

Definition at line 106 of file BinaryStreamRef.cpp.

◆ WritableBinaryStreamRef() [4/7]

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

Definition at line 111 of file BinaryStreamRef.cpp.

◆ 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 124 of file BinaryStreamRef.cpp.

◆ 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 116 of file BinaryStreamRef.cpp.

References llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::BorrowedImpl, llvm::Data, 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: