class OverlayFileSystem
Declaration
class OverlayFileSystem : public FileSystem { /* full declaration omitted */ };
Description
A file system that allows overlaying one \p AbstractFileSystem on top of another. Consists of a stack of >=1 \p FileSystem objects, which are treated as being one merged file system. When there is a directory that exists in more than one file system, the \p OverlayFileSystem contains a directory containing the union of their contents. The attributes (permissions, etc.) of the top-most (most recently added) directory are used. When there is a file that exists in more than one file system, the file in the top-most file system overrides the other(s).
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:321
Inherits from: FileSystem
Method Overview
- public OverlayFileSystem(IntrusiveRefCntPtr<llvm::vfs::FileSystem> Base)
- 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
- public std::error_code isLocal(const llvm::Twine & Path, bool & Result)
- public llvm::ErrorOr<std::unique_ptr<File>> openFileForRead(const llvm::Twine & Path)
- public llvm::vfs::OverlayFileSystem::iterator overlays_begin()
- public llvm::vfs::OverlayFileSystem::const_iterator overlays_begin() const
- public llvm::vfs::OverlayFileSystem::iterator overlays_end()
- public llvm::vfs::OverlayFileSystem::const_iterator overlays_end() const
- public llvm::vfs::OverlayFileSystem::const_reverse_iterator overlays_rbegin() const
- public llvm::vfs::OverlayFileSystem::reverse_iterator overlays_rbegin()
- public llvm::vfs::OverlayFileSystem::const_reverse_iterator overlays_rend() const
- public llvm::vfs::OverlayFileSystem::reverse_iterator overlays_rend()
- public void pushOverlay(IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS)
- public std::error_code setCurrentWorkingDirectory(const llvm::Twine & Path)
- public llvm::ErrorOr<Status> status(const llvm::Twine & Path)
Inherited from FileSystem:
- public dir_begin
- public exists
- public getBufferForFile
- public getCurrentWorkingDirectory
- public getRealPath
- public isLocal
- public makeAbsolute
- public openFileForRead
- public setCurrentWorkingDirectory
- public status
Methods
¶OverlayFileSystem(
IntrusiveRefCntPtr<llvm::vfs::FileSystem>
Base)
OverlayFileSystem(
IntrusiveRefCntPtr<llvm::vfs::FileSystem>
Base)
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:329
Parameters
- IntrusiveRefCntPtr<llvm::vfs::FileSystem> Base
¶llvm::vfs::directory_iterator dir_begin(
const llvm::Twine& Dir,
std::error_code& EC)
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:337
Parameters
- const llvm::Twine& Dir
- std::error_code& EC
¶llvm::ErrorOr<std::string>
getCurrentWorkingDirectory() const
llvm::ErrorOr<std::string>
getCurrentWorkingDirectory() const
Description
Get the working directory of this file system.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:338
¶std::error_code getRealPath(
const llvm::Twine& Path,
SmallVectorImpl<char>& Output) const
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:341
Parameters
- const llvm::Twine& Path
- SmallVectorImpl<char>& Output
¶std::error_code isLocal(const llvm::Twine& Path,
bool& Result)
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:340
Parameters
- const llvm::Twine& Path
- bool& Result
¶llvm::ErrorOr<std::unique_ptr<File>>
openFileForRead(const llvm::Twine& Path)
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:336
Parameters
- const llvm::Twine& Path
¶llvm::vfs::OverlayFileSystem::iterator
overlays_begin()
llvm::vfs::OverlayFileSystem::iterator
overlays_begin()
Description
Get an iterator pointing to the most recently added file system.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:350
¶llvm::vfs::OverlayFileSystem::const_iterator
overlays_begin() const
llvm::vfs::OverlayFileSystem::const_iterator
overlays_begin() const
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:351
¶llvm::vfs::OverlayFileSystem::iterator
overlays_end()
llvm::vfs::OverlayFileSystem::iterator
overlays_end()
Description
Get an iterator pointing one-past the least recently added file system.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:354
¶llvm::vfs::OverlayFileSystem::const_iterator
overlays_end() const
llvm::vfs::OverlayFileSystem::const_iterator
overlays_end() const
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:355
¶llvm::vfs::OverlayFileSystem::
const_reverse_iterator
overlays_rbegin() const
llvm::vfs::OverlayFileSystem::
const_reverse_iterator
overlays_rbegin() const
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:359
¶llvm::vfs::OverlayFileSystem::reverse_iterator
overlays_rbegin()
llvm::vfs::OverlayFileSystem::reverse_iterator
overlays_rbegin()
Description
Get an iterator pointing to the least recently added file system.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:358
¶llvm::vfs::OverlayFileSystem::
const_reverse_iterator
overlays_rend() const
llvm::vfs::OverlayFileSystem::
const_reverse_iterator
overlays_rend() const
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:363
¶llvm::vfs::OverlayFileSystem::reverse_iterator
overlays_rend()
llvm::vfs::OverlayFileSystem::reverse_iterator
overlays_rend()
Description
Get an iterator pointing one-past the most recently added file system.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:362
¶void pushOverlay(
IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS)
void pushOverlay(
IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS)
Description
Pushes a file system on top of the stack.
Declared at: llvm/include/llvm/Support/VirtualFileSystem.h:332
Parameters
- IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS
¶std::error_code setCurrentWorkingDirectory(
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:339
Parameters
- const llvm::Twine& Path
¶llvm::ErrorOr<Status> status(
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:334
Parameters
- const llvm::Twine& Path