class ProxyFileSystem

Declaration

class ProxyFileSystem : public FileSystem { /* full declaration omitted */ };

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.

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:424

Inherits from: FileSystem

Member Variables

private IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS

Method Overview

  • public ProxyFileSystem(IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS)
  • private virtual void anchor()
  • public llvm::vfs::directory_iterator dir_begin(const llvm::Twine & Dir, std::error_code & EC)
  • public llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const
  • public std::error_code getRealPath(const llvm::Twine & Path, SmallVectorImpl<char> & Output) const
  • protected llvm::vfs::FileSystem & getUnderlyingFS()
  • public std::error_code isLocal(const llvm::Twine & Path, bool & Result)
  • public llvm::ErrorOr<std::unique_ptr<File>> openFileForRead(const llvm::Twine & Path)
  • public std::error_code setCurrentWorkingDirectory(const llvm::Twine & Path)
  • public llvm::ErrorOr<Status> status(const llvm::Twine & Path)

Inherited from FileSystem:

Methods

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

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:426

Parameters

IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS

virtual void anchor()

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:459

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

Description

Get a directory_iterator for \p Dir.

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:436

Parameters

const llvm::Twine& Dir
std::error_code& EC

llvm::ErrorOr<std::string>
getCurrentWorkingDirectory() const

Description

Get the working directory of this file system.

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:439

std::error_code getRealPath(
    const llvm::Twine& Path,
    SmallVectorImpl<char>& Output) const

Description

Gets real path of \p 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.

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:445

Parameters

const llvm::Twine& Path
SmallVectorImpl<char>& Output

llvm::vfs::FileSystem& getUnderlyingFS()

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:454

std::error_code isLocal(const llvm::Twine& Path,
                        bool& Result)

Description

Is the file mounted on a local filesystem?

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:449

Parameters

const llvm::Twine& Path
bool& Result

llvm::ErrorOr<std::unique_ptr<File>>
openFileForRead(const llvm::Twine& Path)

Description

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

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:433

Parameters

const llvm::Twine& Path

std::error_code setCurrentWorkingDirectory(
    const llvm::Twine& Path)

Description

Set the working directory. This will affect all following operations on this file system and may propagate down for nested file systems.

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:442

Parameters

const llvm::Twine& Path

llvm::ErrorOr<Status> status(
    const llvm::Twine& Path)

Description

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

Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:429

Parameters

const llvm::Twine& Path