LLVM  8.0.1
Public Member Functions | Protected Member Functions | List of all members
llvm::vfs::ProxyFileSystem Class Reference

By default, this delegates all calls to the underlying file system. More...

#include "llvm/Support/VirtualFileSystem.h"

Inheritance diagram for llvm::vfs::ProxyFileSystem:
Inheritance graph
[legend]
Collaboration diagram for llvm::vfs::ProxyFileSystem:
Collaboration graph
[legend]

Public Member Functions

 ProxyFileSystem (IntrusiveRefCntPtr< FileSystem > FS)
 
llvm::ErrorOr< Statusstatus (const Twine &Path) override
 Get the status of the entry at Path, if one exists. More...
 
llvm::ErrorOr< std::unique_ptr< File > > openFileForRead (const Twine &Path) override
 Get a File object for the file at Path, if one exists. More...
 
directory_iterator dir_begin (const Twine &Dir, std::error_code &EC) override
 Get a directory_iterator for Dir. More...
 
llvm::ErrorOr< std::string > getCurrentWorkingDirectory () const override
 Get the working directory of this file system. More...
 
std::error_code setCurrentWorkingDirectory (const Twine &Path) override
 Set the working directory. More...
 
std::error_code getRealPath (const Twine &Path, SmallVectorImpl< char > &Output) const override
 Gets real path of Path e.g. More...
 
std::error_code isLocal (const Twine &Path, bool &Result) override
 Is the file mounted on a local filesystem? More...
 
- Public Member Functions inherited from llvm::vfs::FileSystem
virtual ~FileSystem ()
 
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. More...
 
bool exists (const Twine &Path)
 Check whether a file exists. Provided for convenience. More...
 
std::error_code makeAbsolute (SmallVectorImpl< char > &Path) const
 Make Path an absolute path. More...
 
- Public Member Functions inherited from llvm::ThreadSafeRefCountedBase< FileSystem >
void Retain () const
 
void Release () const
 

Protected Member Functions

FileSystemgetUnderlyingFS ()
 
- Protected Member Functions inherited from llvm::ThreadSafeRefCountedBase< FileSystem >
 ThreadSafeRefCountedBase ()
 

Detailed Description

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 353 of file VirtualFileSystem.h.

Constructor & Destructor Documentation

◆ ProxyFileSystem()

llvm::vfs::ProxyFileSystem::ProxyFileSystem ( IntrusiveRefCntPtr< FileSystem FS)
inlineexplicit

Definition at line 355 of file VirtualFileSystem.h.

Member Function Documentation

◆ dir_begin()

directory_iterator llvm::vfs::ProxyFileSystem::dir_begin ( const Twine Dir,
std::error_code &  EC 
)
inlineoverridevirtual

Get a directory_iterator for Dir.

Note
The 'end' iterator is directory_iterator().

Implements llvm::vfs::FileSystem.

Definition at line 365 of file VirtualFileSystem.h.

◆ getCurrentWorkingDirectory()

llvm::ErrorOr<std::string> llvm::vfs::ProxyFileSystem::getCurrentWorkingDirectory ( ) const
inlineoverridevirtual

Get the working directory of this file system.

Implements llvm::vfs::FileSystem.

Definition at line 368 of file VirtualFileSystem.h.

◆ getRealPath()

std::error_code llvm::vfs::ProxyFileSystem::getRealPath ( const Twine Path,
SmallVectorImpl< char > &  Output 
) const
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 374 of file VirtualFileSystem.h.

◆ getUnderlyingFS()

FileSystem& llvm::vfs::ProxyFileSystem::getUnderlyingFS ( )
inlineprotected

Definition at line 383 of file VirtualFileSystem.h.

◆ isLocal()

std::error_code llvm::vfs::ProxyFileSystem::isLocal ( const Twine Path,
bool Result 
)
inlineoverridevirtual

Is the file mounted on a local filesystem?

Reimplemented from llvm::vfs::FileSystem.

Definition at line 378 of file VirtualFileSystem.h.

◆ openFileForRead()

llvm::ErrorOr<std::unique_ptr<File> > llvm::vfs::ProxyFileSystem::openFileForRead ( const Twine Path)
inlineoverridevirtual

Get a File object for the file at Path, if one exists.

Implements llvm::vfs::FileSystem.

Definition at line 362 of file VirtualFileSystem.h.

◆ setCurrentWorkingDirectory()

std::error_code llvm::vfs::ProxyFileSystem::setCurrentWorkingDirectory ( const Twine Path)
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 371 of file VirtualFileSystem.h.

◆ status()

llvm::ErrorOr<Status> llvm::vfs::ProxyFileSystem::status ( const Twine Path)
inlineoverridevirtual

Get the status of the entry at Path, if one exists.

Implements llvm::vfs::FileSystem.

Definition at line 358 of file VirtualFileSystem.h.


The documentation for this class was generated from the following files: