clang API Documentation

Public Member Functions
clang::vfs::File Class Reference

Represents an open file. More...

#include <VirtualFileSystem.h>

List of all members.

Public Member Functions

virtual ~File ()
 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.
virtual llvm::ErrorOr< Statusstatus ()=0
 Get the status of the file.
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.
virtual std::error_code close ()=0
 Closes the file.
virtual void setName (StringRef Name)=0
 Sets the name to use for this file.

Detailed Description

Represents an open file.

Definition at line 83 of file VirtualFileSystem.h.


Constructor & Destructor Documentation

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 66 of file VirtualFileSystem.cpp.


Member Function Documentation

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

Closes the file.

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.

virtual void clang::vfs::File::setName ( StringRef  Name) [pure virtual]

Sets the name to use for this file.

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: