class File
Declaration
class File { /* full declaration omitted */ };
Description
Represents an open file.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:98
Method Overview
- public virtual std::error_code close()
- public virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> getBuffer(const llvm::Twine & Name, int64_t FileSize = -1, bool RequiresNullTerminator = true, bool IsVolatile = false)
- public virtual llvm::ErrorOr<std::string> getName()
- public virtual llvm::ErrorOr<Status> status()
- public virtual ~File()
Methods
¶virtual std::error_code close()
virtual std::error_code close()
Description
Closes the file.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:122
¶virtual llvm::ErrorOr<
std::unique_ptr<llvm::MemoryBuffer>>
getBuffer(const llvm::Twine& Name,
int64_t FileSize = -1,
bool RequiresNullTerminator = true,
bool IsVolatile = false)
virtual llvm::ErrorOr<
std::unique_ptr<llvm::MemoryBuffer>>
getBuffer(const llvm::Twine& Name,
int64_t FileSize = -1,
bool RequiresNullTerminator = true,
bool IsVolatile = false)
Description
Get the contents of the file as a \p MemoryBuffer.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:118
Parameters
- const llvm::Twine& Name
- int64_t FileSize = -1
- bool RequiresNullTerminator = true
- bool IsVolatile = false
¶virtual llvm::ErrorOr<std::string> getName()
virtual llvm::ErrorOr<std::string> getName()
Description
Get the name of the file
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:109
¶virtual llvm::ErrorOr<Status> status()
virtual llvm::ErrorOr<Status> status()
Description
Get the status of the file.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:106
¶virtual ~File()
virtual ~File()
Description
Destroy the file after closing it (if open). Sub-classes should generally call close() inside their destructors. We cannot do that from the base class, since close is virtual.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:103