LLVM  8.0.1
Public Member Functions | List of all members
llvm::vfs::File Class Referenceabstract

Represents an open file. More...

#include "llvm/Support/VirtualFileSystem.h"

Public Member Functions

virtual ~File ()
 Destroy the file after closing it (if open). More...
 
virtual llvm::ErrorOr< Statusstatus ()=0
 Get the status of the file. More...
 
virtual llvm::ErrorOr< std::string > getName ()
 Get the name of the file. More...
 
virtual llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > getBuffer (const Twine &Name, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false)=0
 Get the contents of the file as a MemoryBuffer. More...
 
virtual std::error_code close ()=0
 Closes the file. More...
 

Detailed Description

Represents an open file.

Definition at line 99 of file VirtualFileSystem.h.

Constructor & Destructor Documentation

◆ ~File()

File::~File ( )
virtualdefault

Destroy the file after closing it (if open).

Sub-classes should generally call close() inside their destructors. We cannot do that from the base class, since close is virtual.

Referenced by llvm::vfs::Status::exists().

Member Function Documentation

◆ close()

virtual std::error_code llvm::vfs::File::close ( )
pure virtual

Closes the file.

◆ getBuffer()

virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer> > llvm::vfs::File::getBuffer ( const Twine Name,
int64_t  FileSize = -1,
bool  RequiresNullTerminator = true,
bool  IsVolatile = false 
)
pure virtual

Get the contents of the file as a MemoryBuffer.

◆ getName()

virtual llvm::ErrorOr<std::string> llvm::vfs::File::getName ( )
inlinevirtual

◆ status()

virtual llvm::ErrorOr<Status> llvm::vfs::File::status ( )
pure virtual

Get the status of the file.


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