10 #ifndef LLVM_DEBUGINFO_MSF_MAPPEDBLOCKSTREAM_H
11 #define LLVM_DEBUGINFO_MSF_MAPPEDBLOCKSTREAM_H
44 static std::unique_ptr<MappedBlockStream>
48 static std::unique_ptr<MappedBlockStream>
52 static std::unique_ptr<MappedBlockStream>
56 static std::unique_ptr<MappedBlockStream>
92 const MSFStreamLayout StreamLayout;
110 static std::unique_ptr<WritableMappedBlockStream>
114 static std::unique_ptr<WritableMappedBlockStream>
118 static std::unique_ptr<WritableMappedBlockStream>
123 static std::unique_ptr<WritableMappedBlockStream>
142 return ReadInterface.getStreamLayout();
163 #endif // LLVM_DEBUGINFO_MSF_MAPPEDBLOCKSTREAM_H
uint32_t getLength() override
Return the number of bytes of data in this stream.
static std::unique_ptr< WritableMappedBlockStream > createDirectoryStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
uint32_t getNumBlocks() const
static std::unique_ptr< WritableMappedBlockStream > createStream(uint32_t BlockSize, const MSFStreamLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
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 A...
uint32_t getLength() override
Return the number of bytes of data in this stream.
Error commit() override
For buffered streams, commits changes to the backing store.
Error writeBytes(uint32_t Offset, ArrayRef< uint8_t > Buffer) override
Attempt to write the given bytes into the stream at the desired offset.
BumpPtrAllocator & getAllocator()
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
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.
Describes the layout of a stream in an MSF layout.
static std::unique_ptr< MappedBlockStream > createIndexedStream(const MSFLayout &Layout, BinaryStreamRef MsfData, uint32_t StreamIndex, BumpPtrAllocator &Allocator)
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.
std::vector< support::ulittle32_t > Blocks
uint32_t getNumBlocks() const
static std::unique_ptr< MappedBlockStream > createDirectoryStream(const MSFLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
An interface for accessing data in a stream-like format, but which discourages copying.
Allocate memory in an ever growing pool, as if by bump-pointer.
static std::unique_ptr< MappedBlockStream > createFpmStream(const MSFLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
static std::unique_ptr< MappedBlockStream > createStream(uint32_t BlockSize, const MSFStreamLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
static std::unique_ptr< WritableMappedBlockStream > createFpmStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
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 A...
uint32_t getStreamLength() const
static const int BlockSize
uint32_t getBlockSize() const
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
uint32_t getStreamLength() const
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
MappedBlockStream(uint32_t BlockSize, const MSFStreamLayout &StreamLayout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
static std::unique_ptr< WritableMappedBlockStream > createIndexedStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, uint32_t StreamIndex, BumpPtrAllocator &Allocator)
WritableMappedBlockStream(uint32_t BlockSize, const MSFStreamLayout &StreamLayout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator)
support::endianness getEndian() const override
MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the ...
Lightweight error class with error context and mandatory checking.
uint32_t getBlockSize() const
const MSFStreamLayout & getStreamLayout() const
A BinaryStream which can be read from as well as written to.