|
KiCad PCB EDA Suite
|
Install a temporary directory for the process to use for temporary files, which is (usually) removed on destruction. More...
#include <file_utils.h>
Public Member Functions | |
| SCOPED_PROCESS_TEMP_DIR (const wxString &aPrefix) | |
| ~SCOPED_PROCESS_TEMP_DIR () | |
| SCOPED_PROCESS_TEMP_DIR (const SCOPED_PROCESS_TEMP_DIR &)=delete | |
| SCOPED_PROCESS_TEMP_DIR & | operator= (const SCOPED_PROCESS_TEMP_DIR &)=delete |
Private Attributes | |
| SCOPED_TEMP_DIR | m_dir |
Install a temporary directory for the process to use for temporary files, which is (usually) removed on destruction.
Declare this early in the test program, before any use of temporary directories.
Both ends of its life can be outside the wx lifetime, so its constructor and destructor make no wx logging calls: messages about kept or undeletable directories go to stderr.
The redirect applies to wxFileName and std::filesystem temp paths, but won't affect hardcoded paths (which should be avoided anyway).
This will then automatically tidy up any files created by temp dir functions as in wxFileName and std::filesystem, even if not properly scoped in a SCOPED_TEMP_DIR.
The directory is kept whenever any temporary directory created by SCOPED_TEMP_DIR is kept.
Definition at line 178 of file file_utils.h.
| SCOPED_PROCESS_TEMP_DIR::SCOPED_PROCESS_TEMP_DIR | ( | const wxString & | aPrefix | ) |
Definition at line 205 of file file_utils.cpp.
References m_dir.
Referenced by operator=(), and SCOPED_PROCESS_TEMP_DIR().
| SCOPED_PROCESS_TEMP_DIR::~SCOPED_PROCESS_TEMP_DIR | ( | ) |
Definition at line 216 of file file_utils.cpp.
References KI_TEST::SCOPED_TEMP_DIR::AnyTempDirRetained(), and m_dir.
|
delete |
References SCOPED_PROCESS_TEMP_DIR().
|
delete |
References SCOPED_PROCESS_TEMP_DIR().
|
private |
Definition at line 189 of file file_utils.h.
Referenced by SCOPED_PROCESS_TEMP_DIR(), and ~SCOPED_PROCESS_TEMP_DIR().