RAII helper that deletes a file when destroyed, typically on exceptions.

Synopsis

Declared in <llvm/Support/FileUtilities.h>

class FileRemover;

Description

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).

Member Functions

Name

Description

FileRemover [constructor]

Constructors

~FileRemover [destructor]

Destroy the FileRemover, deleting the owned file if deleteIt is true.

releaseFile

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

setFile

Take ownership of a file so it is removed when this object is destroyed.

Created with MrDocs