LLVM 18.0.0git
|
By default, this delegates all calls to the underlying file system. More...
#include "llvm/Support/VirtualFileSystem.h"
Public Member Functions | |
ProxyFileSystem (IntrusiveRefCntPtr< FileSystem > FS) | |
llvm::ErrorOr< Status > | status (const Twine &Path) override |
Get the status of the entry at Path , if one exists. | |
llvm::ErrorOr< std::unique_ptr< File > > | openFileForRead (const Twine &Path) override |
Get a File object for the file at Path , if one exists. | |
directory_iterator | dir_begin (const Twine &Dir, std::error_code &EC) override |
Get a directory_iterator for Dir . | |
llvm::ErrorOr< std::string > | getCurrentWorkingDirectory () const override |
Get the working directory of this file system. | |
std::error_code | setCurrentWorkingDirectory (const Twine &Path) override |
Set the working directory. | |
std::error_code | getRealPath (const Twine &Path, SmallVectorImpl< char > &Output) const override |
Gets real path of Path e.g. | |
std::error_code | isLocal (const Twine &Path, bool &Result) override |
Is the file mounted on a local filesystem? | |
![]() | |
virtual | ~FileSystem () |
virtual llvm::ErrorOr< Status > | status (const Twine &Path)=0 |
Get the status of the entry at Path , if one exists. | |
virtual llvm::ErrorOr< std::unique_ptr< File > > | openFileForRead (const Twine &Path)=0 |
Get a File object for the file at Path , if one exists. | |
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > | getBufferForFile (const Twine &Name, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false) |
This is a convenience method that opens a file, gets its content and then closes the file. | |
virtual directory_iterator | dir_begin (const Twine &Dir, std::error_code &EC)=0 |
Get a directory_iterator for Dir . | |
virtual std::error_code | setCurrentWorkingDirectory (const Twine &Path)=0 |
Set the working directory. | |
virtual llvm::ErrorOr< std::string > | getCurrentWorkingDirectory () const =0 |
Get the working directory of this file system. | |
virtual std::error_code | getRealPath (const Twine &Path, SmallVectorImpl< char > &Output) const |
Gets real path of Path e.g. | |
bool | exists (const Twine &Path) |
Check whether a file exists. Provided for convenience. | |
virtual std::error_code | isLocal (const Twine &Path, bool &Result) |
Is the file mounted on a local filesystem? | |
virtual std::error_code | makeAbsolute (SmallVectorImpl< char > &Path) const |
Make Path an absolute path. | |
void | print (raw_ostream &OS, PrintType Type=PrintType::Contents, unsigned IndentLevel=0) const |
LLVM_DUMP_METHOD void | dump () const |
![]() | |
unsigned | UseCount () const |
void | Retain () const |
void | Release () const |
Protected Member Functions | |
FileSystem & | getUnderlyingFS () const |
![]() | |
virtual void | printImpl (raw_ostream &OS, PrintType Type, unsigned IndentLevel) const |
void | printIndent (raw_ostream &OS, unsigned IndentLevel) const |
![]() | |
ThreadSafeRefCountedBase ()=default | |
ThreadSafeRefCountedBase (const ThreadSafeRefCountedBase &) | |
ThreadSafeRefCountedBase & | operator= (const ThreadSafeRefCountedBase &)=delete |
~ThreadSafeRefCountedBase () | |
Additional Inherited Members | |
![]() | |
enum class | PrintType { Summary , Contents , RecursiveContents } |
By default, this delegates all calls to the underlying file system.
This is useful when derived file systems want to override some calls and still proxy other calls.
Definition at line 423 of file VirtualFileSystem.h.
|
inlineexplicit |
Definition at line 425 of file VirtualFileSystem.h.
|
inlineoverridevirtual |
Get a directory_iterator for Dir
.
Implements llvm::vfs::FileSystem.
Definition at line 435 of file VirtualFileSystem.h.
|
inlineoverridevirtual |
Get the working directory of this file system.
Implements llvm::vfs::FileSystem.
Definition at line 438 of file VirtualFileSystem.h.
|
inlineoverridevirtual |
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 from llvm::vfs::FileSystem.
Definition at line 444 of file VirtualFileSystem.h.
|
inlineprotected |
Definition at line 453 of file VirtualFileSystem.h.
|
inlineoverridevirtual |
Is the file mounted on a local filesystem?
Reimplemented from llvm::vfs::FileSystem.
Definition at line 448 of file VirtualFileSystem.h.
|
inlineoverridevirtual |
Get a File
object for the file at Path
, if one exists.
Implements llvm::vfs::FileSystem.
Definition at line 432 of file VirtualFileSystem.h.
|
inlineoverridevirtual |
Set the working directory.
This will affect all following operations on this file system and may propagate down for nested file systems.
Implements llvm::vfs::FileSystem.
Definition at line 441 of file VirtualFileSystem.h.
|
inlineoverridevirtual |
Get the status of the entry at Path
, if one exists.
Implements llvm::vfs::FileSystem.
Definition at line 428 of file VirtualFileSystem.h.