clang  6.0.0svn
Public Member Functions | List of all members
clang::vfs::File Class Referenceabstract

Represents an open file. More...

#include "clang/Basic/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 101 of file VirtualFileSystem.h.

Constructor & Destructor Documentation

◆ ~File()

File::~File ( )
virtual

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.

Definition at line 84 of file VirtualFileSystem.cpp.

Member Function Documentation

◆ close()

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

Closes the file.

◆ getBuffer()

virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer> > clang::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> clang::vfs::File::getName ( )
inlinevirtual

Get the name of the file.

Definition at line 112 of file VirtualFileSystem.h.

References clang::vfs::Status::getName().

◆ status()

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

Get the status of the file.


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