The virtual file system interface. More...
#include "llvm/Support/VirtualFileSystem.h"
Path, if one exists. Path e.g. The virtual file system interface.
Definition at line 267 of file VirtualFileSystem.h.
Definition at line 347 of file VirtualFileSystem.h.
| Enumerator | |
|---|---|
| Summary | |
| Contents | |
| RecursiveContents | |
Definition at line 341 of file VirtualFileSystem.h.
Get a directory_iterator for Dir.
Implemented in llvm::FileCollectorFileSystem, and llvm::vfs::RedirectingFileSystem.
Referenced by getHighestNumericTupleInDirectory().
Definition at line 165 of file VirtualFileSystem.cpp.
References llvm::dbgs(), print(), and RecursiveContents.
A and B represent the same file, or an error or false if they do not. Definition at line 154 of file VirtualFileSystem.cpp.
References A(), B(), and status().
Referenced by getCurrentWorkingDirectory().
Check whether Path exists.
By default this uses status() , but filesystems may provide a more efficient implementation if available.
Reimplemented in llvm::vfs::RedirectingFileSystem.
Definition at line 149 of file VirtualFileSystem.cpp.
References llvm::vfs::Status::exists(), and status().
Referenced by llvm::findVCToolChainViaEnvironment(), getCurrentWorkingDirectory(), getFilename(), llvm::getWindowsSDKDir(), and llvm::useUniversalCRT().
This is a convenience method that opens a file, gets its content and then closes the file.
The IsText parameter is used to distinguish whether the file should be opened as a binary or text file.
Definition at line 118 of file VirtualFileSystem.cpp.
References F, openFileForRead(), and openFileForReadBinary().
Referenced by llvm::SpecialCaseList::createInternal().
Get the working directory of this file system.
Implemented in llvm::FileCollectorFileSystem, and llvm::vfs::RedirectingFileSystem.
References A(), B(), equivalent(), exists(), getRealPath(), and isLocal().
Referenced by makeAbsolute().
Gets real path of Path e.g.
collapse all . and .. patterns, resolve symlinks. For real file system, this uses llvm::sys::fs::real_path . This returns errc::operation_not_permitted if not implemented by subclass.
Reimplemented in llvm::FileCollectorFileSystem, and llvm::vfs::RedirectingFileSystem.
Definition at line 140 of file VirtualFileSystem.cpp.
References llvm::operation_not_permitted.
Referenced by getCurrentWorkingDirectory().
Is the file mounted on a local filesystem?
Reimplemented in llvm::FileCollectorFileSystem, and llvm::vfs::RedirectingFileSystem.
Definition at line 145 of file VirtualFileSystem.cpp.
References llvm::operation_not_permitted.
Referenced by getCurrentWorkingDirectory().
Make Path an absolute path.
Makes Path absolute using the current directory if it is not already. An empty Path will result in the current directory.
/absolute/path => /absolute/path relative/../path => <current-directory>/relative/../path
Reimplemented in llvm::vfs::RedirectingFileSystem.
Definition at line 128 of file VirtualFileSystem.cpp.
References getCurrentWorkingDirectory(), llvm::sys::path::is_absolute(), and llvm::sys::path::make_absolute().
Referenced by makeAbsolute().
Get a File object for the text file at Path, if one exists.
Implemented in llvm::FileCollectorFileSystem, and llvm::vfs::RedirectingFileSystem.
Referenced by getBufferForFile(), and openFileForReadBinary().
Get a File object for the binary file at Path, if one exists.
Some non-ascii based file systems perform encoding conversions when reading as a text file, and this function should be used if a file's bytes should be read as-is. On most filesystems, this is the same behaviour as openFileForRead.
Definition at line 286 of file VirtualFileSystem.h.
References openFileForRead().
Referenced by getBufferForFile().
Definition at line 342 of file VirtualFileSystem.h.
References Contents, and printImpl().
Referenced by dump().
Reimplemented in llvm::vfs::RedirectingFileSystem.
Definition at line 359 of file VirtualFileSystem.h.
References printIndent().
Definition at line 365 of file VirtualFileSystem.h.
Referenced by llvm::vfs::RedirectingFileSystem::printEntry(), printImpl(), and llvm::vfs::RedirectingFileSystem::printImpl().
Set the working directory.
This will affect all following operations on this file system and may propagate down for nested file systems.
Implemented in llvm::FileCollectorFileSystem, and llvm::vfs::RedirectingFileSystem.
Get the status of the entry at Path, if one exists.
Implemented in llvm::FileCollectorFileSystem, and llvm::vfs::RedirectingFileSystem.
Referenced by equivalent(), exists(), llvm::findVCToolChainViaSetupConfig(), and getHighestNumericTupleInDirectory().
Definition at line 349 of file VirtualFileSystem.h.
References visitChildFileSystems().
Reimplemented in llvm::vfs::RedirectingFileSystem.
Definition at line 348 of file VirtualFileSystem.h.
Referenced by visit().
Definition at line 270 of file VirtualFileSystem.h.