LLVM  8.0.1
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, uint32_t Offset, Optional< uint32_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, uint32_t Offset, uint32_t Length)=delete
 
Error writeBytes (uint32_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
 
uint32_t getLength () const
 
WritableBinaryStreamRef drop_front (uint32_t N) const
 Return a new BinaryStreamRef with the first N elements removed. More...
 
WritableBinaryStreamRef drop_back (uint32_t N) const
 Return a new BinaryStreamRef with the last N elements removed. More...
 
WritableBinaryStreamRef keep_front (uint32_t N) const
 Return a new BinaryStreamRef with only the first N elements remaining. More...
 
WritableBinaryStreamRef keep_back (uint32_t N) const
 Return a new BinaryStreamRef with only the last N elements remaining. More...
 
WritableBinaryStreamRef drop_symmetric (uint32_t N) const
 Return a new BinaryStreamRef with the first and last N elements removed. More...
 
WritableBinaryStreamRef slice (uint32_t Offset, uint32_t Len) const
 Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elements. More...
 
bool valid () const
 
bool operator== (const WritableBinaryStreamRef &Other) const
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >
 BinaryStreamRefBase ()=default
 
 BinaryStreamRefBase (WritableBinaryStream &BorrowedImpl)
 
 BinaryStreamRefBase (std::shared_ptr< WritableBinaryStream > SharedImpl, uint32_t Offset, Optional< uint32_t > Length)
 
 BinaryStreamRefBase (WritableBinaryStream &BorrowedImpl, uint32_t Offset, Optional< uint32_t > Length)
 
 BinaryStreamRefBase (const BinaryStreamRefBase &Other)=default
 
 BinaryStreamRefBase (BinaryStreamRefBase &&Other)=default
 
BinaryStreamRefBaseoperator= (const BinaryStreamRefBase &Other)=default
 
BinaryStreamRefBaseoperator= (BinaryStreamRefBase &&Other)=default
 
Error checkOffsetForRead (uint32_t Offset, uint32_t DataSize) const
 
- Protected Attributes inherited from llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >
std::shared_ptr< WritableBinaryStreamSharedImpl
 
WritableBinaryStreamBorrowedImpl
 
uint32_t ViewOffset
 
Optional< uint32_tLength
 

Detailed Description

Definition at line 223 of file BinaryStreamRef.h.

Constructor & Destructor Documentation

◆ WritableBinaryStreamRef() [1/7]

llvm::WritableBinaryStreamRef::WritableBinaryStreamRef ( )
default

◆ WritableBinaryStreamRef() [2/7]

WritableBinaryStreamRef::WritableBinaryStreamRef ( WritableBinaryStream Stream)

Definition at line 104 of file BinaryStreamRef.cpp.

◆ WritableBinaryStreamRef() [3/7]

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

Definition at line 107 of file BinaryStreamRef.cpp.

◆ WritableBinaryStreamRef() [4/7]

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

Definition at line 112 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,
uint32_t  Offset,
uint32_t  Length 
)
delete

Member Function Documentation

◆ commit()

Error WritableBinaryStreamRef::commit ( )

◆ operator BinaryStreamRef()

WritableBinaryStreamRef::operator BinaryStreamRef ( ) const

◆ 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 ( uint32_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 118 of file BinaryStreamRef.cpp.

References llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::BorrowedImpl, llvm::ArrayRef< T >::size(), 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: