LLVM 20.0.0git
|
Common stuff for mutable and immutable StreamRefs. More...
#include "llvm/Support/BinaryStreamRef.h"
Public Member Functions | |
llvm::endianness | getEndian () const |
uint64_t | getLength () const |
RefType | drop_front (uint64_t N) const |
Return a new BinaryStreamRef with the first N elements removed. | |
RefType | drop_back (uint64_t N) const |
Return a new BinaryStreamRef with the last N elements removed. | |
RefType | keep_front (uint64_t N) const |
Return a new BinaryStreamRef with only the first N elements remaining. | |
RefType | keep_back (uint64_t N) const |
Return a new BinaryStreamRef with only the last N elements remaining. | |
RefType | drop_symmetric (uint64_t N) const |
Return a new BinaryStreamRef with the first and last N elements removed. | |
RefType | 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 |
Protected Member Functions | |
BinaryStreamRefBase ()=default | |
BinaryStreamRefBase (StreamType &BorrowedImpl) | |
BinaryStreamRefBase (std::shared_ptr< StreamType > SharedImpl, uint64_t Offset, std::optional< uint64_t > Length) | |
BinaryStreamRefBase (StreamType &BorrowedImpl, uint64_t Offset, std::optional< uint64_t > Length) | |
BinaryStreamRefBase (const BinaryStreamRefBase &Other)=default | |
BinaryStreamRefBase & | operator= (const BinaryStreamRefBase &Other)=default |
BinaryStreamRefBase & | operator= (BinaryStreamRefBase &&Other)=default |
BinaryStreamRefBase (BinaryStreamRefBase &&Other)=default | |
Error | checkOffsetForRead (uint64_t Offset, uint64_t DataSize) const |
Protected Attributes | |
std::shared_ptr< StreamType > | SharedImpl |
StreamType * | BorrowedImpl = nullptr |
uint64_t | ViewOffset = 0 |
std::optional< uint64_t > | Length |
Friends | |
bool | operator== (const RefType &LHS, const RefType &RHS) |
Common stuff for mutable and immutable StreamRefs.
Definition at line 23 of file BinaryStreamRef.h.
|
protecteddefault |
|
inlineexplicitprotected |
Definition at line 26 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::BorrowedImpl, llvm::BSF_Append, and llvm::BinaryStreamRefBase< RefType, StreamType >::Length.
|
inlineprotected |
Definition at line 32 of file BinaryStreamRef.h.
|
inlineprotected |
Definition at line 36 of file BinaryStreamRef.h.
|
protecteddefault |
|
protecteddefault |
|
inlineprotected |
Definition at line 132 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::getLength(), llvm::invalid_offset, llvm::Offset, llvm::stream_too_short, and llvm::Error::success().
|
inline |
Return a new BinaryStreamRef with the last N
elements removed.
If this BinaryStreamRef is length-tracking and N
is greater than 0, then this BinaryStreamRef will no longer length-track.
Definition at line 76 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::BorrowedImpl, llvm::BinaryStreamRefBase< RefType, StreamType >::getLength(), and N.
Referenced by llvm::BinaryStreamRefBase< RefType, StreamType >::keep_front().
|
inline |
Return a new BinaryStreamRef with the first N
elements removed.
If this BinaryStreamRef is length-tracking, then the resulting one will be too.
Definition at line 58 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::BorrowedImpl, llvm::BinaryStreamRefBase< RefType, StreamType >::getLength(), and N.
Referenced by llvm::BinaryStreamRefBase< RefType, StreamType >::drop_symmetric(), llvm::pdb::LinePrinter::formatMsfStreamData(), llvm::BinaryStreamRefBase< RefType, StreamType >::keep_back(), llvm::VarStreamArrayIterator< ValueType, Extractor >::operator+=(), llvm::BinaryStreamRefBase< RefType, StreamType >::slice(), llvm::BinaryStreamWriter::split(), and llvm::BinaryStreamReader::split().
|
inline |
Return a new BinaryStreamRef with the first and last N
elements removed.
Definition at line 109 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::drop_front(), and N.
|
inline |
Definition at line 46 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::BorrowedImpl.
Referenced by llvm::BinaryStreamReader::readInteger(), and llvm::BinaryStreamWriter::writeInteger().
|
inline |
Definition at line 48 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::BorrowedImpl, llvm::BinaryStreamRefBase< RefType, StreamType >::Length, and llvm::BinaryStreamRefBase< RefType, StreamType >::ViewOffset.
Referenced by llvm::codeview::DebugSubsectionRecordBuilder::calculateSerializedLength(), llvm::BinaryStreamRefBase< RefType, StreamType >::checkOffsetForRead(), llvm::codeview::DebugSubsectionRecordBuilder::commit(), llvm::BinaryStreamRefBase< RefType, StreamType >::drop_back(), llvm::BinaryStreamRefBase< RefType, StreamType >::drop_front(), llvm::VarStreamArray< ValueType, Extractor >::empty(), llvm::FixedStreamArray< T >::FixedStreamArray(), llvm::BinaryStreamReader::getLength(), llvm::BinaryStreamWriter::getLength(), llvm::codeview::DebugSubsectionRecord::getRecordLength(), llvm::BinaryStreamRefBase< RefType, StreamType >::keep_back(), llvm::BinaryStreamRefBase< RefType, StreamType >::keep_front(), llvm::VarStreamArrayIterator< ValueType, Extractor >::operator+=(), llvm::FixedStreamArray< T >::size(), llvm::BinarySubstreamRef::size(), and llvm::VarStreamArrayIterator< ValueType, Extractor >::VarStreamArrayIterator().
|
inline |
Return a new BinaryStreamRef with only the last N
elements remaining.
Definition at line 102 of file BinaryStreamRef.h.
References assert(), llvm::BinaryStreamRefBase< RefType, StreamType >::drop_front(), llvm::BinaryStreamRefBase< RefType, StreamType >::getLength(), and N.
|
inline |
Return a new BinaryStreamRef with only the first N
elements remaining.
Definition at line 96 of file BinaryStreamRef.h.
References assert(), llvm::BinaryStreamRefBase< RefType, StreamType >::drop_back(), llvm::BinaryStreamRefBase< RefType, StreamType >::getLength(), and N.
Referenced by llvm::pdb::LinePrinter::formatMsfStreamData().
|
protecteddefault |
|
protecteddefault |
|
inline |
Return a new BinaryStreamRef with the first Offset
elements removed, and retaining exactly Len
elements.
Definition at line 115 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::drop_front(), and llvm::Offset.
Referenced by llvm::BinaryStreamReader::readStreamRef(), llvm::BinarySubstreamRef::slice(), and llvm::VarStreamArray< ValueType, Extractor >::substream().
|
inline |
Definition at line 119 of file BinaryStreamRef.h.
References llvm::BinaryStreamRefBase< RefType, StreamType >::BorrowedImpl.
Referenced by llvm::codeview::DebugStringTableSubsectionRef::valid(), and llvm::VarStreamArray< ValueType, Extractor >::valid().
|
friend |
Definition at line 121 of file BinaryStreamRef.h.
|
protected |
Definition at line 141 of file BinaryStreamRef.h.
Referenced by llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase(), llvm::BinaryStreamRefBase< RefType, StreamType >::drop_back(), llvm::BinaryStreamRefBase< RefType, StreamType >::drop_front(), llvm::BinaryStreamRefBase< RefType, StreamType >::getEndian(), llvm::BinaryStreamRefBase< RefType, StreamType >::getLength(), and llvm::BinaryStreamRefBase< RefType, StreamType >::valid().
|
protected |
Definition at line 143 of file BinaryStreamRef.h.
Referenced by llvm::BinaryStreamRefBase< RefType, StreamType >::BinaryStreamRefBase(), and llvm::BinaryStreamRefBase< RefType, StreamType >::getLength().
|
protected |
Definition at line 140 of file BinaryStreamRef.h.
|
protected |
Definition at line 142 of file BinaryStreamRef.h.
Referenced by llvm::BinaryStreamRefBase< RefType, StreamType >::getLength().