LLVM 22.0.0git
|
Represents a temporary file. More...
#include "llvm/Support/FileSystem.h"
Public Member Functions | |
LLVM_ABI | TempFile (TempFile &&Other) |
LLVM_ABI TempFile & | operator= (TempFile &&Other) |
LLVM_ABI Error | keep (const Twine &Name) |
LLVM_ABI Error | keep () |
LLVM_ABI Error | discard () |
LLVM_ABI | ~TempFile () |
Static Public Member Functions | |
static LLVM_ABI Expected< TempFile > | create (const Twine &Model, unsigned Mode=all_read|all_write, OpenFlags ExtraFlags=OF_None) |
This creates a temporary file with createUniqueFile and schedules it for deletion with sys::RemoveFileOnSignal. |
Public Attributes | |
std::string | TmpName |
int | FD = -1 |
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 857 of file FileSystem.h.
llvm::sys::fs::TempFile::TempFile | ( | TempFile && | Other | ) |
Definition at line 1211 of file Path.cpp.
References llvm::Other.
llvm::sys::fs::TempFile::~TempFile | ( | ) |
Definition at line 1224 of file Path.cpp.
References assert(), and ~TempFile().
Referenced by ~TempFile().
|
static |
This creates a temporary file with createUniqueFile and schedules it for deletion with sys::RemoveFileOnSignal.
Definition at line 1325 of file Path.cpp.
References llvm::consumeError(), create(), llvm::sys::fs::createUniqueFile(), llvm::errorCodeToError(), FD, H, llvm::sys::fs::OF_Delete, llvm::operation_not_permitted, and llvm::sys::RemoveFileOnSignal().
Referenced by create(), createOnDiskBuffer(), llvm::localCache(), llvm::writeArchive(), llvm::writeToOutput(), and llvm::object::writeUniversalBinary().
Error llvm::sys::fs::TempFile::discard | ( | ) |
Definition at line 1226 of file Path.cpp.
References discard(), llvm::sys::DontRemoveFileOnSignal(), llvm::errnoAsErrorCode(), llvm::errorCodeToError(), FD, llvm::sys::fs::remove(), and TmpName.
Referenced by discard(), and llvm::localCache().
Error llvm::sys::fs::TempFile::keep | ( | ) |
Definition at line 1305 of file Path.cpp.
References assert(), llvm::sys::DontRemoveFileOnSignal(), llvm::errnoAsErrorCode(), llvm::errorCodeToError(), FD, H, keep(), llvm::Error::success(), and TmpName.
Definition at line 1254 of file Path.cpp.
References assert(), llvm::sys::fs::copy_file(), llvm::sys::DontRemoveFileOnSignal(), llvm::errnoAsErrorCode(), llvm::errorCodeToError(), FD, H, keep(), llvm::sys::fs::remove(), llvm::sys::fs::rename(), and TmpName.
Referenced by keep(), keep(), and llvm::localCache().
Definition at line 1212 of file Path.cpp.
References FD, operator=(), llvm::Other, and TmpName.
Referenced by operator=().
int llvm::sys::fs::TempFile::FD = -1 |
Definition at line 874 of file FileSystem.h.
Referenced by create(), discard(), keep(), keep(), llvm::localCache(), and operator=().
std::string llvm::sys::fs::TempFile::TmpName |
Definition at line 871 of file FileSystem.h.
Referenced by discard(), keep(), keep(), llvm::localCache(), and operator=().