LLVM 20.0.0git
|
Represents an open file. More...
#include "llvm/Support/VirtualFileSystem.h"
Public Member Functions | |
virtual | ~File () |
Destroy the file after closing it (if open). | |
virtual llvm::ErrorOr< Status > | status ()=0 |
Get the status of the file. | |
virtual llvm::ErrorOr< std::string > | getName () |
Get the name of the file. | |
virtual llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > | getBuffer (const Twine &Name, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false)=0 |
Get the contents of the file as a MemoryBuffer . | |
virtual std::error_code | close ()=0 |
Closes the file. | |
Static Public Member Functions | |
static ErrorOr< std::unique_ptr< File > > | getWithPath (ErrorOr< std::unique_ptr< File > > Result, const Twine &P) |
Protected Member Functions | |
virtual void | setPath (const Twine &Path) |
Represents an open file.
Definition at line 111 of file VirtualFileSystem.h.
|
virtualdefault |
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.
|
pure virtual |
Closes the file.
|
pure virtual |
Get the contents of the file as a MemoryBuffer
.
|
inlinevirtual |
Get the name of the file.
Definition at line 122 of file VirtualFileSystem.h.
References llvm::vfs::Status::getName(), status(), and llvm::StringRef::str().
|
static |
Definition at line 2526 of file VirtualFileSystem.cpp.
Referenced by llvm::vfs::RedirectingFileSystem::openFileForRead().
Definition at line 143 of file VirtualFileSystem.h.
|
pure virtual |
Get the status of the file.
Referenced by getName().