Halide
Halide::Internal::TemporaryFile Class Referencefinal

A simple utility class that creates a temporary file in its ctor and deletes that file in its dtor; this is useful for temporary files that you want to ensure are deleted when exiting a certain scope. More...

#include <Util.h>

Public Member Functions

 TemporaryFile (const std::string &prefix, const std::string &suffix)
 
const std::string & pathname () const
 
 ~TemporaryFile ()
 
void detach ()
 

Detailed Description

A simple utility class that creates a temporary file in its ctor and deletes that file in its dtor; this is useful for temporary files that you want to ensure are deleted when exiting a certain scope.

Since this is essentially just an RAII wrapper around file_make_temp() and file_unlink(), it has the same failure modes (i.e.: assertion upon error).

Definition at line 287 of file Util.h.

Constructor & Destructor Documentation

◆ TemporaryFile()

Halide::Internal::TemporaryFile::TemporaryFile ( const std::string &  prefix,
const std::string &  suffix 
)
inline

Definition at line 289 of file Util.h.

◆ ~TemporaryFile()

Halide::Internal::TemporaryFile::~TemporaryFile ( )
inline

Definition at line 295 of file Util.h.

References Halide::Internal::file_unlink().

Member Function Documentation

◆ pathname()

const std::string& Halide::Internal::TemporaryFile::pathname ( ) const
inline

Definition at line 292 of file Util.h.

◆ detach()

void Halide::Internal::TemporaryFile::detach ( )
inline

Definition at line 303 of file Util.h.


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