https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Moose::UnitUtils::TempFile Class Reference

Create a temporary file and delete it upon destruction. More...

#include <MooseUnitUtils.h>

Public Member Functions

 TempFile ()
 
 ~TempFile ()
 
const std::filesystem::path & path () const
 

Private Attributes

const std::filesystem::path _path
 

Detailed Description

Create a temporary file and delete it upon destruction.

Definition at line 119 of file MooseUnitUtils.h.

Constructor & Destructor Documentation

◆ TempFile()

Moose::UnitUtils::TempFile::TempFile ( )

Definition at line 34 of file MooseUnitUtils.C.

34: _path(generatePath()) {}
const std::filesystem::path _path

◆ ~TempFile()

Moose::UnitUtils::TempFile::~TempFile ( )

Definition at line 36 of file MooseUnitUtils.C.

37{
38 std::error_code ec;
39 std::filesystem::remove(path(), ec);
40}
const std::filesystem::path & path() const

Member Function Documentation

◆ path()

const std::filesystem::path & Moose::UnitUtils::TempFile::path ( ) const
inline
Returns
The path to the temporary file.

Definition at line 128 of file MooseUnitUtils.h.

128{ return _path; }

Referenced by ~TempFile().

Member Data Documentation

◆ _path

const std::filesystem::path Moose::UnitUtils::TempFile::_path
private

Definition at line 131 of file MooseUnitUtils.h.

Referenced by path().


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