LLVM 19.0.0git
Public Member Functions | List of all members
llvm::FileCollectorFileSystem Class Reference
Inheritance diagram for llvm::FileCollectorFileSystem:
Inheritance graph
[legend]

Public Member Functions

 FileCollectorFileSystem (IntrusiveRefCntPtr< vfs::FileSystem > FS, std::shared_ptr< FileCollector > Collector)
 
llvm::ErrorOr< llvm::vfs::Statusstatus (const Twine &Path) override
 Get the status of the entry at Path, if one exists.
 
llvm::ErrorOr< std::unique_ptr< llvm::vfs::File > > openFileForRead (const Twine &Path) override
 Get a File object for the file at Path, if one exists.
 
llvm::vfs::directory_iterator dir_begin (const llvm::Twine &Dir, std::error_code &EC) override
 Get a directory_iterator for Dir.
 
std::error_code getRealPath (const Twine &Path, SmallVectorImpl< char > &Output) const override
 Gets real path of Path e.g.
 
std::error_code isLocal (const Twine &Path, bool &Result) override
 Is the file mounted on a local filesystem?
 
llvm::ErrorOr< std::string > getCurrentWorkingDirectory () const override
 Get the working directory of this file system.
 
std::error_code setCurrentWorkingDirectory (const llvm::Twine &Path) override
 Set the working directory.
 
- Public Member Functions inherited from llvm::vfs::FileSystem
virtual ~FileSystem ()
 
virtual llvm::ErrorOr< Statusstatus (const Twine &Path)=0
 Get the status of the entry at Path, if one exists.
 
virtual llvm::ErrorOr< std::unique_ptr< File > > openFileForRead (const Twine &Path)=0
 Get a File object for the file at Path, if one exists.
 
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.
 
virtual directory_iterator dir_begin (const Twine &Dir, std::error_code &EC)=0
 Get a directory_iterator for Dir.
 
virtual std::error_code setCurrentWorkingDirectory (const Twine &Path)=0
 Set the working directory.
 
virtual llvm::ErrorOr< std::string > getCurrentWorkingDirectory () const =0
 Get the working directory of this file system.
 
virtual std::error_code getRealPath (const Twine &Path, SmallVectorImpl< char > &Output) const
 Gets real path of Path e.g.
 
bool exists (const Twine &Path)
 Check whether a file exists. Provided for convenience.
 
virtual std::error_code isLocal (const Twine &Path, bool &Result)
 Is the file mounted on a local filesystem?
 
virtual std::error_code makeAbsolute (SmallVectorImpl< char > &Path) const
 Make Path an absolute path.
 
void print (raw_ostream &OS, PrintType Type=PrintType::Contents, unsigned IndentLevel=0) const
 
virtual void visitChildFileSystems (VisitCallbackTy Callback)
 
void visit (VisitCallbackTy Callback)
 
LLVM_DUMP_METHOD void dump () const
 
- Public Member Functions inherited from llvm::ThreadSafeRefCountedBase< FileSystem >
unsigned UseCount () const
 
void Retain () const
 
void Release () const
 
- Public Member Functions inherited from llvm::RTTIExtends< FileSystem, RTTIRoot >
const void * dynamicClassID () const override
 
bool isA (const void *const ClassID) const override
 
- Public Member Functions inherited from llvm::RTTIRoot
virtual ~RTTIRoot ()=default
 
virtual const void * dynamicClassID () const =0
 Returns the class ID for the dynamic type of this RTTIRoot instance.
 
virtual bool isA (const void *const ClassID) const
 Returns true if this class's ID matches the given class ID.
 
template<typename QueryT >
bool isA () const
 Check whether this instance is a subclass of QueryT.
 

Additional Inherited Members

- Public Types inherited from llvm::vfs::FileSystem
enum class  PrintType { Summary , Contents , RecursiveContents }
 
using VisitCallbackTy = llvm::function_ref< void(FileSystem &)>
 
- Static Public Member Functions inherited from llvm::RTTIExtends< FileSystem, RTTIRoot >
static const void * classID ()
 
static bool classof (const RTTIRoot *R)
 
- Static Public Member Functions inherited from llvm::RTTIRoot
static const void * classID ()
 Returns the class ID for this type.
 
- Static Public Attributes inherited from llvm::vfs::FileSystem
static const char ID = 0
 
- Protected Member Functions inherited from llvm::vfs::FileSystem
virtual void printImpl (raw_ostream &OS, PrintType Type, unsigned IndentLevel) const
 
void printIndent (raw_ostream &OS, unsigned IndentLevel) const
 
- Protected Member Functions inherited from llvm::ThreadSafeRefCountedBase< FileSystem >
 ThreadSafeRefCountedBase ()=default
 
 ThreadSafeRefCountedBase (const ThreadSafeRefCountedBase &)
 
ThreadSafeRefCountedBaseoperator= (const ThreadSafeRefCountedBase &)=delete
 
 ~ThreadSafeRefCountedBase ()
 

Detailed Description

Definition at line 257 of file FileCollector.cpp.

Constructor & Destructor Documentation

◆ FileCollectorFileSystem()

llvm::FileCollectorFileSystem::FileCollectorFileSystem ( IntrusiveRefCntPtr< vfs::FileSystem FS,
std::shared_ptr< FileCollector Collector 
)
inlineexplicit

Definition at line 259 of file FileCollector.cpp.

Member Function Documentation

◆ dir_begin()

llvm::vfs::directory_iterator llvm::FileCollectorFileSystem::dir_begin ( const llvm::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 278 of file FileCollector.cpp.

References Collector.

◆ getCurrentWorkingDirectory()

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

Get the working directory of this file system.

Implements llvm::vfs::FileSystem.

Definition at line 298 of file FileCollector.cpp.

◆ getRealPath()

std::error_code llvm::FileCollectorFileSystem::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 283 of file FileCollector.cpp.

References Collector, and llvm::SmallVectorBase< Size_T >::size().

◆ isLocal()

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

Is the file mounted on a local filesystem?

Reimplemented from llvm::vfs::FileSystem.

Definition at line 294 of file FileCollector.cpp.

◆ openFileForRead()

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

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

Implements llvm::vfs::FileSystem.

Definition at line 271 of file FileCollector.cpp.

References Collector.

◆ setCurrentWorkingDirectory()

std::error_code llvm::FileCollectorFileSystem::setCurrentWorkingDirectory ( const llvm::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 302 of file FileCollector.cpp.

◆ status()

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

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

Implements llvm::vfs::FileSystem.

Definition at line 263 of file FileCollector.cpp.

References Collector.


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