class WritableMappedBlockStream
Declaration
class WritableMappedBlockStream : public WritableBinaryStream { /* full declaration omitted */ };
Description
A BinaryStream which can be read from as well as written to. Note that writing to a BinaryStream always necessitates copying from the input buffer to the stream's backing store. Streams are assumed to be buffered so that to be portable it is necessary to call commit() on the stream when all data has been written.
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:105
Inherits from: WritableBinaryStream
Member Variables
- private llvm::msf::MappedBlockStream ReadInterface
- private llvm::WritableBinaryStreamRef WriteInterface
Method Overview
- protected WritableMappedBlockStream(uint32_t BlockSize, const llvm::msf::MSFStreamLayout & StreamLayout, llvm::WritableBinaryStreamRef MsfData, llvm::BumpPtrAllocator & Allocator)
- public llvm::Error commit()
- public static std::unique_ptr<WritableMappedBlockStream> createDirectoryStream(const llvm::msf::MSFLayout & Layout, llvm::WritableBinaryStreamRef MsfData, llvm::BumpPtrAllocator & Allocator)
- public static std::unique_ptr<WritableMappedBlockStream> createFpmStream(const llvm::msf::MSFLayout & Layout, llvm::WritableBinaryStreamRef MsfData, llvm::BumpPtrAllocator & Allocator, bool AltFpm = false)
- public static std::unique_ptr<WritableMappedBlockStream> createIndexedStream(const llvm::msf::MSFLayout & Layout, llvm::WritableBinaryStreamRef MsfData, uint32_t StreamIndex, llvm::BumpPtrAllocator & Allocator)
- public static std::unique_ptr<WritableMappedBlockStream> createStream(uint32_t BlockSize, const llvm::msf::MSFStreamLayout & Layout, llvm::WritableBinaryStreamRef MsfData, llvm::BumpPtrAllocator & Allocator)
- public uint32_t getBlockSize() const
- public support::endianness getEndian() const
- public uint64_t getLength()
- public uint32_t getNumBlocks() const
- public const llvm::msf::MSFStreamLayout & getStreamLayout() const
- public uint32_t getStreamLength() const
- public llvm::Error readBytes(uint64_t Offset, uint64_t Size, ArrayRef<uint8_t> & Buffer)
- public llvm::Error readLongestContiguousChunk(uint64_t Offset, ArrayRef<uint8_t> & Buffer)
- public llvm::Error writeBytes(uint64_t Offset, ArrayRef<uint8_t> Buffer)
Inherited from WritableBinaryStream:
Inherited from BinaryStream:
- protected checkOffsetForRead
- public getEndian
- public getFlags
- public getLength
- public readBytes
- public readLongestContiguousChunk
Methods
¶WritableMappedBlockStream(
uint32_t BlockSize,
const llvm::msf::MSFStreamLayout&
StreamLayout,
llvm::WritableBinaryStreamRef MsfData,
llvm::BumpPtrAllocator& Allocator)
WritableMappedBlockStream(
uint32_t BlockSize,
const llvm::msf::MSFStreamLayout&
StreamLayout,
llvm::WritableBinaryStreamRef MsfData,
llvm::BumpPtrAllocator& Allocator)
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:147
Parameters
- uint32_t BlockSize
- const llvm::msf::MSFStreamLayout& StreamLayout
- llvm::WritableBinaryStreamRef MsfData
- llvm::BumpPtrAllocator& Allocator
¶llvm::Error commit()
llvm::Error commit()
Description
For buffered streams, commits changes to the backing store.
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:136
¶static std::unique_ptr<WritableMappedBlockStream>
createDirectoryStream(
const llvm::msf::MSFLayout& Layout,
llvm::WritableBinaryStreamRef MsfData,
llvm::BumpPtrAllocator& Allocator)
static std::unique_ptr<WritableMappedBlockStream>
createDirectoryStream(
const llvm::msf::MSFLayout& Layout,
llvm::WritableBinaryStreamRef MsfData,
llvm::BumpPtrAllocator& Allocator)
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:116
Parameters
- const llvm::msf::MSFLayout& Layout
- llvm::WritableBinaryStreamRef MsfData
- llvm::BumpPtrAllocator& Allocator
¶static std::unique_ptr<WritableMappedBlockStream>
createFpmStream(
const llvm::msf::MSFLayout& Layout,
llvm::WritableBinaryStreamRef MsfData,
llvm::BumpPtrAllocator& Allocator,
bool AltFpm = false)
static std::unique_ptr<WritableMappedBlockStream>
createFpmStream(
const llvm::msf::MSFLayout& Layout,
llvm::WritableBinaryStreamRef MsfData,
llvm::BumpPtrAllocator& Allocator,
bool AltFpm = false)
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:121
Parameters
- const llvm::msf::MSFLayout& Layout
- llvm::WritableBinaryStreamRef MsfData
- llvm::BumpPtrAllocator& Allocator
- bool AltFpm = false
¶static std::unique_ptr<WritableMappedBlockStream>
createIndexedStream(
const llvm::msf::MSFLayout& Layout,
llvm::WritableBinaryStreamRef MsfData,
uint32_t StreamIndex,
llvm::BumpPtrAllocator& Allocator)
static std::unique_ptr<WritableMappedBlockStream>
createIndexedStream(
const llvm::msf::MSFLayout& Layout,
llvm::WritableBinaryStreamRef MsfData,
uint32_t StreamIndex,
llvm::BumpPtrAllocator& Allocator)
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:112
Parameters
- const llvm::msf::MSFLayout& Layout
- llvm::WritableBinaryStreamRef MsfData
- uint32_t StreamIndex
- llvm::BumpPtrAllocator& Allocator
¶static std::unique_ptr<WritableMappedBlockStream>
createStream(
uint32_t BlockSize,
const llvm::msf::MSFStreamLayout& Layout,
llvm::WritableBinaryStreamRef MsfData,
llvm::BumpPtrAllocator& Allocator)
static std::unique_ptr<WritableMappedBlockStream>
createStream(
uint32_t BlockSize,
const llvm::msf::MSFStreamLayout& Layout,
llvm::WritableBinaryStreamRef MsfData,
llvm::BumpPtrAllocator& Allocator)
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:108
Parameters
- uint32_t BlockSize
- const llvm::msf::MSFStreamLayout& Layout
- llvm::WritableBinaryStreamRef MsfData
- llvm::BumpPtrAllocator& Allocator
¶uint32_t getBlockSize() const
uint32_t getBlockSize() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:142
¶support::endianness getEndian() const
support::endianness getEndian() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:124
¶uint64_t getLength()
uint64_t getLength()
Description
Return the number of bytes of data in this stream.
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:132
¶uint32_t getNumBlocks() const
uint32_t getNumBlocks() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:143
¶const llvm::msf::MSFStreamLayout&
getStreamLayout() const
const llvm::msf::MSFStreamLayout&
getStreamLayout() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:138
¶uint32_t getStreamLength() const
uint32_t getStreamLength() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:144
¶llvm::Error readBytes(uint64_t Offset,
uint64_t Size,
ArrayRef<uint8_t>& Buffer)
llvm::Error readBytes(uint64_t Offset,
uint64_t Size,
ArrayRef<uint8_t>& Buffer)
Description
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.
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:128
Parameters
- uint64_t Offset
- uint64_t Size
- ArrayRef<uint8_t>& Buffer
¶llvm::Error readLongestContiguousChunk(
uint64_t Offset,
ArrayRef<uint8_t>& Buffer)
llvm::Error readLongestContiguousChunk(
uint64_t Offset,
ArrayRef<uint8_t>& Buffer)
Description
Given an offset into the stream, read as much as possible without copying any data.
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:130
Parameters
- uint64_t Offset
- ArrayRef<uint8_t>& Buffer
¶llvm::Error writeBytes(uint64_t Offset,
ArrayRef<uint8_t> Buffer)
llvm::Error writeBytes(uint64_t Offset,
ArrayRef<uint8_t> Buffer)
Description
Attempt to write the given bytes into the stream at the desired offset. This will always necessitate a copy. Cannot shrink or grow the stream, only writes into existing allocated space.
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:134
Parameters
- uint64_t Offset
- ArrayRef<uint8_t> Buffer