ΒΆllvm::Error readNativeFileToEOF(
    llvm::sys::fs::file_t FileHandle,
    SmallVectorImpl<char>& Buffer,
    ssize_t ChunkSize = DefaultReadChunkSize)

Description

Reads from \p FileHandle until EOF, appending to \p Buffer in chunks of size \p ChunkSize. This calls \a readNativeFile() in a loop. On Error, previous chunks that were read successfully are left in \p Buffer and returned. Note: For reading the final chunk at EOF, \p Buffer's capacity needs extra storage of \p ChunkSize.

Declared at: llvm/include/llvm/Support/FileSystem.h:1033

Parameters

llvm::sys::fs::file_t FileHandle
File to read from.
SmallVectorImpl<char>& Buffer
Where to put the file content.
ssize_t ChunkSize = DefaultReadChunkSize
Size of chunks.

Returns

The error if EOF was not found.