LLVM: llvm::vfs::FileSystem Class Reference (original) (raw)

The virtual file system interface. More...

#include "[llvm/Support/VirtualFileSystem.h](VirtualFileSystem%5F8h%5Fsource.html)"

Public Member Functions
~FileSystem () override
virtual llvm::ErrorOr< Status > status (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 text file at Path, if one exists.
virtual llvm::ErrorOr< std::unique_ptr< File > > openFileForReadBinary (const Twine &Path)
Get a File object for the binary 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, bool IsText=true)
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)
Gets real path of Path e.g.
virtual bool exists (const Twine &Path)
Check whether Path exists.
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.
llvm::ErrorOr< bool > equivalent (const Twine &A, const Twine &B)
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
Check whether this instance is a subclass of QueryT.
Public Member Functions inherited from llvm::RTTIRoot
virtual ~RTTIRoot ()=default
virtual bool isA (const void *const ClassID) const
Returns true if this class's ID matches the given class ID.
Static Public Attributes
static const char ID = 0
Protected Member Functions
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 & operator= (const ThreadSafeRefCountedBase &)=delete
~ThreadSafeRefCountedBase ()
Additional Inherited Members
Static Public Member Functions inherited from llvm::RTTIExtends< FileSystem, RTTIRoot >
static const void * classID ()
static bool classof (const T *R)
Static Public Member Functions inherited from llvm::RTTIRoot
static const void * classID ()
Returns the class ID for this type.

The virtual file system interface.

Definition at line 267 of file VirtualFileSystem.h.

VisitCallbackTy

PrintType

FileSystem::~FileSystem ( ) overridedefault

dir_begin()

dump()

void FileSystem::dump ( ) const

equivalent()

Returns

true if A and B represent the same file, or an error or false if they do not.

Definition at line 154 of file VirtualFileSystem.cpp.

References A(), B(), and status().

Referenced by getCurrentWorkingDirectory().

exists()

getBufferForFile()

getCurrentWorkingDirectory()

virtual llvm::ErrorOr< std::string > llvm::vfs::FileSystem::getCurrentWorkingDirectory ( ) const pure virtual

getRealPath()

isLocal()

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

makeAbsolute()

openFileForRead()

openFileForReadBinary()

Get a [File](classllvm%5F1%5F1vfs%5F1%5F1File.html "Represents an open file.") object for the binary file at Path, if one exists.

Some non-ascii based file systems perform encoding conversions when reading as a text file, and this function should be used if a file's bytes should be read as-is. On most filesystems, this is the same behaviour as openFileForRead.

Definition at line 286 of file VirtualFileSystem.h.

References openFileForRead().

Referenced by getBufferForFile().

print()

printImpl()

virtual void llvm::vfs::FileSystem::printImpl ( raw_ostream & OS, PrintType Type, unsigned IndentLevel ) const inlineprotectedvirtual

printIndent()

setCurrentWorkingDirectory()

virtual std::error_code llvm::vfs::FileSystem::setCurrentWorkingDirectory ( const Twine & Path) pure virtual

status()

visit()

void llvm::vfs::FileSystem::visit ( VisitCallbackTy Callback) inline

visitChildFileSystems()

virtual void llvm::vfs::FileSystem::visitChildFileSystems ( VisitCallbackTy Callback) inlinevirtual

ID


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