clang  8.0.0svn
Public Member Functions | Protected Member Functions | List of all members
clang::vfs::ProxyFileSystem Class Reference

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

#include "clang/Basic/VirtualFileSystem.h"

Inheritance diagram for clang::vfs::ProxyFileSystem:
Inheritance graph
[legend]
Collaboration diagram for clang::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...
 
- Public Member Functions inherited from clang::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...
 

Protected Member Functions

FileSystemgetUnderlyingFS ()
 

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

Constructor & Destructor Documentation

◆ ProxyFileSystem()

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

Definition at line 343 of file VirtualFileSystem.h.

Member Function Documentation

◆ dir_begin()

directory_iterator clang::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 clang::vfs::FileSystem.

Definition at line 353 of file VirtualFileSystem.h.

◆ getCurrentWorkingDirectory()

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

Get the working directory of this file system.

Implements clang::vfs::FileSystem.

Definition at line 356 of file VirtualFileSystem.h.

◆ getRealPath()

std::error_code clang::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 clang::vfs::FileSystem.

Definition at line 362 of file VirtualFileSystem.h.

◆ getUnderlyingFS()

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

Definition at line 368 of file VirtualFileSystem.h.

◆ openFileForRead()

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

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

Implements clang::vfs::FileSystem.

Definition at line 350 of file VirtualFileSystem.h.

◆ setCurrentWorkingDirectory()

std::error_code clang::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 clang::vfs::FileSystem.

Definition at line 359 of file VirtualFileSystem.h.

◆ status()

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

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

Implements clang::vfs::FileSystem.

Definition at line 346 of file VirtualFileSystem.h.


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