class TempFile
Declaration
class TempFile { /* full declaration omitted */ };
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.
Declared at: llvm/include/llvm/Support/FileSystem.h:844
Member Variables
- public std::string TmpName
- public int FD = -1
Method Overview
- public TempFile(llvm::sys::fs::TempFile && Other)
- public static Expected<llvm::sys::fs::TempFile> create(const llvm::Twine & Model, unsigned int Mode = all_read | all_write)
- public llvm::Error discard()
- public llvm::Error keep(const llvm::Twine & Name)
- public llvm::Error keep()
- public ~TempFile()
Methods
¶TempFile(llvm::sys::fs::TempFile&& Other)
TempFile(llvm::sys::fs::TempFile&& Other)
Declared at: llvm/include/llvm/Support/FileSystem.h:853
Parameters
- llvm::sys::fs::TempFile&& Other
¶static Expected<llvm::sys::fs::TempFile> create(
const llvm::Twine& Model,
unsigned int Mode = all_read | all_write)
static Expected<llvm::sys::fs::TempFile> create(
const llvm::Twine& Model,
unsigned int Mode = all_read | all_write)
Description
This creates a temporary file with createUniqueFile and schedules it for deletion with sys::RemoveFileOnSignal.
Declared at: llvm/include/llvm/Support/FileSystem.h:851
Parameters
- const llvm::Twine& Model
- unsigned int Mode = all_read | all_write
¶llvm::Error discard()
llvm::Error discard()
Declared at: llvm/include/llvm/Support/FileSystem.h:869
¶llvm::Error keep(const llvm::Twine& Name)
llvm::Error keep(const llvm::Twine& Name)
Declared at: llvm/include/llvm/Support/FileSystem.h:863
Parameters
- const llvm::Twine& Name
¶llvm::Error keep()
llvm::Error keep()
Declared at: llvm/include/llvm/Support/FileSystem.h:866
¶~TempFile()
~TempFile()
Declared at: llvm/include/llvm/Support/FileSystem.h:872