stc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
stc::testutil::TestFile Struct Reference

#include <TestFile.hpp>

Public Member Functions

 TestFile (const std::filesystem::path &f, bool create=false)
 
 ~TestFile ()
 
void deleteFile ()
 

Public Attributes

std::filesystem::path file
 

Detailed Description

Test utility for RAII ownership of a file.

The file, if it exists at the time of initialization, is deleted. It's also deleted at the end of the test when this class is destroyed.

Note
This class is incompatible with symlinks.

Constructor & Destructor Documentation

◆ TestFile()

stc::testutil::TestFile::TestFile ( const std::filesystem::path &  f,
bool  create = false 
)
inline

◆ ~TestFile()

stc::testutil::TestFile::~TestFile ( )
inline

Member Function Documentation

◆ deleteFile()

void stc::testutil::TestFile::deleteFile ( )
inline

Member Data Documentation

◆ file

std::filesystem::path stc::testutil::TestFile::file

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