getFile overloads
Declared in <llvm/Support/MemoryBuffer.h>
Map the specified file as a write-through memory buffer.
static
ErrorOr<std::unique_ptr<WriteThroughMemoryBuffer>>
getFile(
Twine const& Filename,
int64_t FileSize = -1);
» more...
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful, otherwise returning null.
static
ErrorOr<std::unique_ptr<MemoryBuffer>>
getFile(
Twine const& Filename,
bool IsText = false,
bool RequiresNullTerminator = true,
bool IsVolatile = false,
std::optional<Align> Alignment = std::nullopt);
» more...
| Name | Description |
|---|---|
| Filename | Path of the file to map. |
| FileSize | Size of the file in bytes, or -1 to determine it from the file itself. |
| IsText | Set to true to indicate that the file should be read in text mode. |
| RequiresNullTerminator | Whether the buffer must be null-terminated. |
| IsVolatile | Set to true to indicate that the contents of the file can change outside the user's control, e.g. when libclang tries to parse while the user is editing/updating the file or if the file is on an NFS. |
| Alignment | Set to indicate that the buffer should be aligned to at least the specified alignment. |