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:107
Inherits from: WritableBinaryStream
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 uint32_t getLength()
- public uint32_t getNumBlocks() const
- public const llvm::msf::MSFStreamLayout & getStreamLayout() const
- public uint32_t getStreamLength() const
- public llvm::Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef<uint8_t> & Buffer)
- public llvm::Error readLongestContiguousChunk(uint32_t Offset, ArrayRef<uint8_t> & Buffer)
- public llvm::Error writeBytes(uint32_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:149
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:138
¶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:118
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:123
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:114
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:110
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:144
¶support::endianness getEndian() const
support::endianness getEndian() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:126
¶uint32_t getLength()
uint32_t getLength()
Description
Return the number of bytes of data in this stream.
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:134
¶uint32_t getNumBlocks() const
uint32_t getNumBlocks() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:145
¶const llvm::msf::MSFStreamLayout&
getStreamLayout() const
const llvm::msf::MSFStreamLayout&
getStreamLayout() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:140
¶uint32_t getStreamLength() const
uint32_t getStreamLength() const
Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:146
¶llvm::Error readBytes(uint32_t Offset,
uint32_t Size,
ArrayRef<uint8_t>& Buffer)
llvm::Error readBytes(uint32_t Offset,
uint32_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:130
Parameters
- uint32_t Offset
- uint32_t Size
- ArrayRef<uint8_t>& Buffer
¶llvm::Error readLongestContiguousChunk(
uint32_t Offset,
ArrayRef<uint8_t>& Buffer)
llvm::Error readLongestContiguousChunk(
uint32_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:132
Parameters
- uint32_t Offset
- ArrayRef<uint8_t>& Buffer
¶llvm::Error writeBytes(uint32_t Offset,
ArrayRef<uint8_t> Buffer)
llvm::Error writeBytes(uint32_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:136
Parameters
- uint32_t Offset
- ArrayRef<uint8_t> Buffer