Deep Learning Visualizer
Interactive visualization of basic applications of deep learning
Loading...
Searching...
No Matches
test_helpers::temp_file Class Reference

A scratch file in the system temporary directory which is removed once the test finishes, whether it passed or not. More...

#include <test_helpers.h>

Public Member Functions

 temp_file (std::string_view name)
 
 temp_file (const temp_file &)=delete
 
temp_file & operator= (const temp_file &)=delete
 
 temp_file (temp_file &&)=delete
 
temp_file & operator= (temp_file &&)=delete
 
void write_text (std::string_view text) const
 Replaces the contents of the file with the given text.
 
void write_bytes (const std::vector< std::uint8_t > &bytes) const
 Replaces the contents of the file with the given raw bytes.
 
const std::filesystem::path & path () const
 

Detailed Description

A scratch file in the system temporary directory which is removed once the test finishes, whether it passed or not.

Constructor & Destructor Documentation

◆ temp_file()

test_helpers::temp_file::temp_file ( std::string_view  name)
inlineexplicit
Parameters
nameA suffix which keeps the files of separate tests apart.

Member Function Documentation

◆ path()

const std::filesystem::path & test_helpers::temp_file::path ( ) const
inline
Returns
The path of the scratch file.

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