![]() |
WPILibC++ 2025.3.2
|
SmallVector-backed MemoryBuffer instance. More...
#include <wpi/SmallVectorMemoryBuffer.h>
Public Member Functions | |
| SmallVectorMemoryBuffer (SmallVectorImpl< uint8_t > &&sv) | |
| Construct an SmallVectorMemoryBuffer from the given SmallVector r-value. | |
| SmallVectorMemoryBuffer (SmallVectorImpl< uint8_t > &&sv, std::string_view name) | |
| Construct a named SmallVectorMemoryBuffer from the given SmallVector r-value and StringRef. | |
| ~SmallVectorMemoryBuffer () override | |
| std::string_view | GetBufferIdentifier () const override |
| Return an identifier for this buffer, typically the filename it was read from. | |
| BufferKind | GetBufferKind () const override |
| Return information on the memory mechanism used to support the MemoryBuffer. | |
Public Member Functions inherited from wpi::MemoryBuffer | |
| MemoryBuffer (const MemoryBuffer &)=delete | |
| MemoryBuffer & | operator= (const MemoryBuffer &)=delete |
| virtual | ~MemoryBuffer () |
| const uint8_t * | begin () const |
| const uint8_t * | end () const |
| size_t | size () const |
| std::span< const uint8_t > | GetBuffer () const |
| std::span< const char > | GetCharBuffer () const |
| MemoryBufferRef | GetMemBufferRef () const |
Additional Inherited Members | |
Public Types inherited from wpi::MemoryBuffer | |
| enum | BufferKind { MemoryBuffer_Malloc , MemoryBuffer_MMap } |
| The kind of memory backing used to support the MemoryBuffer. More... | |
Static Public Member Functions inherited from wpi::MemoryBuffer | |
| static wpi::expected< std::unique_ptr< MemoryBuffer >, std::error_code > | GetFile (std::string_view filename, int64_t fileSize=-1) |
| Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful, otherwise returning null. | |
| static std::unique_ptr< MemoryBuffer > | GetFileAsStream (std::string_view filename, std::error_code &ec) |
| Read all of the specified file into a MemoryBuffer as a stream (i.e. | |
| static std::unique_ptr< MemoryBuffer > | GetOpenFileSlice (fs::file_t f, std::string_view filename, std::error_code &ec, uint64_t mapSize, int64_t offset) |
| Given an already-open file descriptor, map some slice of it into a MemoryBuffer. | |
| static std::unique_ptr< MemoryBuffer > | GetOpenFile (fs::file_t f, std::string_view filename, std::error_code &ec, uint64_t fileSize) |
| Given an already-open file descriptor, read the file and return a MemoryBuffer. | |
| static std::unique_ptr< MemoryBuffer > | GetMemBuffer (std::span< const uint8_t > inputData, std::string_view bufferName="") |
| Open the specified memory range as a MemoryBuffer. | |
| static std::unique_ptr< MemoryBuffer > | GetMemBuffer (MemoryBufferRef ref) |
| static std::unique_ptr< MemoryBuffer > | GetMemBufferCopy (std::span< const uint8_t > inputData, std::string_view bufferName="") |
| Open the specified memory range as a MemoryBuffer, copying the contents and taking ownership of it. | |
| static std::unique_ptr< MemoryBuffer > | GetFileSlice (std::string_view filename, std::error_code &ec, uint64_t mapSize, uint64_t offset) |
| Map a subrange of the specified file as a MemoryBuffer. | |
Protected Member Functions inherited from wpi::MemoryBuffer | |
| MemoryBuffer ()=default | |
| void | Init (const uint8_t *bufStart, const uint8_t *bufEnd) |
SmallVector-backed MemoryBuffer instance.
This class enables efficient construction of MemoryBuffers from SmallVector instances.
|
inline |
Construct an SmallVectorMemoryBuffer from the given SmallVector r-value.
|
inline |
Construct a named SmallVectorMemoryBuffer from the given SmallVector r-value and StringRef.
|
override |
|
inlineoverridevirtual |
Return an identifier for this buffer, typically the filename it was read from.
Reimplemented from wpi::MemoryBuffer.
|
inlineoverridevirtual |
Return information on the memory mechanism used to support the MemoryBuffer.
Implements wpi::MemoryBuffer.