clang API Documentation

Public Types | Public Member Functions
clang::vfs::OverlayFileSystem Class Reference

A file system that allows overlaying one AbstractFileSystem on top of another. More...

#include <VirtualFileSystem.h>

Inheritance diagram for clang::vfs::OverlayFileSystem:
Inheritance graph
[legend]
Collaboration diagram for clang::vfs::OverlayFileSystem:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
FileSystemList::reverse_iterator 
iterator

Public Member Functions

 OverlayFileSystem (IntrusiveRefCntPtr< FileSystem > Base)
void pushOverlay (IntrusiveRefCntPtr< FileSystem > FS)
 Pushes a file system on top of the stack.
llvm::ErrorOr< Statusstatus (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.
iterator overlays_begin ()
 Get an iterator pointing to the most recently added file system.
iterator overlays_end ()
 Get an iterator pointing one-past the least recently added file system.

Detailed Description

A file system that allows overlaying one AbstractFileSystem on top of another.

Consists of a stack of >=1 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 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).

Definition at line 218 of file VirtualFileSystem.h.


Member Typedef Documentation

typedef FileSystemList::reverse_iterator clang::vfs::OverlayFileSystem::iterator

Definition at line 234 of file VirtualFileSystem.h.


Constructor & Destructor Documentation

OverlayFileSystem::OverlayFileSystem ( IntrusiveRefCntPtr< FileSystem Base)

Definition at line 226 of file VirtualFileSystem.cpp.


Member Function Documentation

directory_iterator OverlayFileSystem::dir_begin ( const Twine &  Dir,
std::error_code &  EC 
) [override, virtual]

Get a directory_iterator for Dir.

Note:
The 'end' iterator is directory_iterator().

Implements clang::vfs::FileSystem.

Definition at line 317 of file VirtualFileSystem.cpp.

ErrorOr< std::unique_ptr< File > > OverlayFileSystem::openFileForRead ( const Twine &  Path) [override, virtual]

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

Implements clang::vfs::FileSystem.

Definition at line 245 of file VirtualFileSystem.cpp.

References clang::format::make_error_code().

Get an iterator pointing to the most recently added file system.

Definition at line 237 of file VirtualFileSystem.h.

Get an iterator pointing one-past the least recently added file system.

Definition at line 241 of file VirtualFileSystem.h.

void OverlayFileSystem::pushOverlay ( IntrusiveRefCntPtr< FileSystem FS)

Pushes a file system on top of the stack.

Definition at line 230 of file VirtualFileSystem.cpp.

ErrorOr< Status > OverlayFileSystem::status ( const Twine &  Path) [override, virtual]

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

Implements clang::vfs::FileSystem.

Definition at line 234 of file VirtualFileSystem.cpp.

References clang::format::make_error_code().


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