LLVM 20.0.0git
Public Member Functions | List of all members
llvm::FileRemover Class Reference

FileRemover - This class is a simple object meant to be stack allocated. More...

#include "llvm/Support/FileUtilities.h"

Public Member Functions

 FileRemover ()
 
 FileRemover (const Twine &filename, bool deleteIt=true)
 
 ~FileRemover ()
 
void setFile (const Twine &filename, bool deleteIt=true)
 setFile - Give ownership of the file to the FileRemover so it will be removed when the object is destroyed.
 
void releaseFile ()
 releaseFile - Take ownership of the file away from the FileRemover so it will not be removed when the object is destroyed.
 

Detailed Description

FileRemover - This class is a simple object meant to be stack allocated.

If an exception is thrown from a region, the object removes the filename specified (if deleteIt is true).

Definition at line 42 of file FileUtilities.h.

Constructor & Destructor Documentation

◆ FileRemover() [1/2]

llvm::FileRemover::FileRemover ( )
inline

Definition at line 46 of file FileUtilities.h.

◆ FileRemover() [2/2]

llvm::FileRemover::FileRemover ( const Twine filename,
bool  deleteIt = true 
)
inlineexplicit

Definition at line 48 of file FileUtilities.h.

◆ ~FileRemover()

llvm::FileRemover::~FileRemover ( )
inline

Definition at line 53 of file FileUtilities.h.

References llvm::sys::fs::remove().

Member Function Documentation

◆ releaseFile()

void llvm::FileRemover::releaseFile ( )
inline

releaseFile - Take ownership of the file away from the FileRemover so it will not be removed when the object is destroyed.

Definition at line 76 of file FileUtilities.h.

◆ setFile()

void llvm::FileRemover::setFile ( const Twine filename,
bool  deleteIt = true 
)
inline

setFile - Give ownership of the file to the FileRemover so it will be removed when the object is destroyed.

If the FileRemover already had ownership of a file, remove it first.

Definition at line 63 of file FileUtilities.h.

References llvm::sys::fs::remove().


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