LLVM 20.0.0git
|
A RAII object that creates a file upon initialization and removes it upon destruction. More...
#include "llvm/Testing/Support/SupportHelpers.h"
Public Member Functions | |
TempFile (StringRef Name, StringRef Suffix="", StringRef Contents="", bool Unique=false) | |
Creates a managed file. | |
~TempFile () | |
TempFile (const TempFile &)=delete | |
TempFile & | operator= (const TempFile &)=delete |
TempFile (TempFile &&)=default | |
TempFile & | operator= (TempFile &&)=default |
StringRef | path () const |
The path to the file. | |
A RAII object that creates a file upon initialization and removes it upon destruction.
Definition at line 203 of file SupportHelpers.h.
|
inline |
Creates a managed file.
Name | The name of the file to create. |
Contents | The string to write to the file. |
Unique | If true, the file will be created using llvm::sys::fs::createTemporaryFile. |
Definition at line 213 of file SupportHelpers.h.
References llvm::sys::fs::createTemporaryFile(), Name, llvm::sys::fs::openFileForWrite(), and OS.
|
inline |
Definition at line 235 of file SupportHelpers.h.
References llvm::sys::fs::remove().
|
default |
|
inline |
The path to the file.
Definition at line 248 of file SupportHelpers.h.