LLVM  8.0.1
Public Member Functions | Public Attributes | List of all members
llvm::MemoryBufferByteStream Class Reference

An implementation of BinaryStream whose data is backed by an llvm MemoryBuffer object. More...

#include "llvm/Support/BinaryByteStream.h"

Inheritance diagram for llvm::MemoryBufferByteStream:
Inheritance graph
[legend]
Collaboration diagram for llvm::MemoryBufferByteStream:
Collaboration graph
[legend]

Public Member Functions

 MemoryBufferByteStream (std::unique_ptr< MemoryBuffer > Buffer, llvm::support::endianness Endian)
 
- Public Member Functions inherited from llvm::BinaryByteStream
 BinaryByteStream ()=default
 
 BinaryByteStream (ArrayRef< uint8_t > Data, llvm::support::endianness Endian)
 
 BinaryByteStream (StringRef Data, llvm::support::endianness Endian)
 
llvm::support::endianness getEndian () const override
 
Error readBytes (uint32_t Offset, uint32_t Size, ArrayRef< uint8_t > &Buffer) override
 Given an offset into the stream and a number of bytes, attempt to read the bytes and set the output ArrayRef to point to data owned by the stream. More...
 
Error readLongestContiguousChunk (uint32_t Offset, ArrayRef< uint8_t > &Buffer) override
 Given an offset into the stream, read as much as possible without copying any data. More...
 
uint32_t getLength () override
 Return the number of bytes of data in this stream. More...
 
ArrayRef< uint8_t > data () const
 
StringRef str () const
 
- Public Member Functions inherited from llvm::BinaryStream
virtual ~BinaryStream ()=default
 
virtual BinaryStreamFlags getFlags () const
 Return the properties of this stream. More...
 

Public Attributes

std::unique_ptr< MemoryBufferMemBuffer
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::BinaryStream
Error checkOffsetForRead (uint32_t Offset, uint32_t DataSize)
 
- Protected Attributes inherited from llvm::BinaryByteStream
llvm::support::endianness Endian
 
ArrayRef< uint8_t > Data
 

Detailed Description

An implementation of BinaryStream whose data is backed by an llvm MemoryBuffer object.

MemoryBufferByteStream owns the MemoryBuffer in question. As with BinaryByteStream, reading from a MemoryBufferByteStream will never cause a copy.

Definition at line 76 of file BinaryByteStream.h.

Constructor & Destructor Documentation

◆ MemoryBufferByteStream()

llvm::MemoryBufferByteStream::MemoryBufferByteStream ( std::unique_ptr< MemoryBuffer Buffer,
llvm::support::endianness  Endian 
)
inline

Definition at line 78 of file BinaryByteStream.h.

Member Data Documentation

◆ MemBuffer

std::unique_ptr<MemoryBuffer> llvm::MemoryBufferByteStream::MemBuffer

Definition at line 83 of file BinaryByteStream.h.


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