LLVM  12.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
llvm::sys::fs::TempFile Class Reference

Represents a temporary file. More...

#include "llvm/Support/FileSystem.h"

Collaboration diagram for llvm::sys::fs::TempFile:
Collaboration graph

Public Member Functions

 TempFile (TempFile &&Other)
TempFileoperator= (TempFile &&Other)
Error keep (const Twine &Name)
Error keep ()
Error discard ()
 ~TempFile ()

Static Public Member Functions

static Expected< TempFilecreate (const Twine &Model, unsigned Mode=all_read|all_write)
 This creates a temporary file with createUniqueFile and schedules it for deletion with sys::RemoveFileOnSignal. More...

Public Attributes

std::string TmpName
int FD = -1

Detailed Description

Represents a temporary file.

The temporary file must be eventually discarded or given a final name and kept.

The destructor doesn't implicitly discard because there is no way to properly handle errors in a destructor.

Definition at line 844 of file FileSystem.h.

Constructor & Destructor Documentation

◆ TempFile()

llvm::sys::fs::TempFile::TempFile ( TempFile &&  Other)

Definition at line 1162 of file Path.cpp.

References Other.

◆ ~TempFile()

llvm::sys::fs::TempFile::~TempFile ( )

Definition at line 1171 of file Path.cpp.

References assert().

Member Function Documentation

◆ create()

Expected< TempFile > llvm::sys::fs::TempFile::create ( const Twine Model,
unsigned  Mode = all_read | all_write 

◆ discard()

Error llvm::sys::fs::TempFile::discard ( )

◆ keep() [1/2]

Error llvm::sys::fs::TempFile::keep ( const Twine Name)

◆ keep() [2/2]

Error llvm::sys::fs::TempFile::keep ( )

◆ operator=()

TempFile & llvm::sys::fs::TempFile::operator= ( TempFile &&  Other)

Definition at line 1163 of file Path.cpp.

References Other.

Member Data Documentation

◆ FD

int llvm::sys::fs::TempFile::FD = -1

Definition at line 860 of file FileSystem.h.

Referenced by createOnDiskBuffer(), and llvm::lto::localCache().

◆ TmpName

std::string llvm::sys::fs::TempFile::TmpName

Definition at line 857 of file FileSystem.h.

Referenced by llvm::lto::localCache().

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