This class creates a temporary file for the test, and removes it when the test is done.
More...
#include <TempFile.hxx>
|
| | TempFile (const TempDir &dir, const string &basename) |
| | Constructor.
|
| |
| const string & | name () const |
| |
| int | fd () |
| |
| void | write (const uint8_t byte) |
| | writes a single byte to the temporary file.
|
| |
| void | rewrite (const string &s) |
| | writes the given data to the temporary file from offset 0.
|
| |
| void | write (const string &s) |
| | writes the given data to the temporary file.
|
| |
|
| string | fileName_ |
| | The full path name.
|
| |
| int | fd_ |
| | The file descriptor.
|
| |
This class creates a temporary file for the test, and removes it when the test is done.
Definition at line 84 of file TempFile.hxx.
◆ TempFile()
| TempFile::TempFile |
( |
const TempDir & |
dir, |
|
|
const string & |
basename |
|
) |
| |
Constructor.
- Parameters
-
| dir | isthe temp directory to create the file within. |
| basename | will be the prefix of the name. A unique suffix will be appended for each file. |
Definition at line 69 of file TempFile.cxx.
◆ ~TempFile()
◆ fd()
◆ name()
| const string & TempFile::name |
( |
| ) |
const |
|
inline |
- Returns
- the full path name to this temporary file.
Definition at line 98 of file TempFile.hxx.
◆ rewrite()
| void TempFile::rewrite |
( |
const string & |
s | ) |
|
writes the given data to the temporary file from offset 0.
- Parameters
-
Definition at line 79 of file TempFile.cxx.
◆ write() [1/2]
| void TempFile::write |
( |
const string & |
s | ) |
|
|
inline |
writes the given data to the temporary file.
- Parameters
-
Definition at line 122 of file TempFile.hxx.
◆ write() [2/2]
| void TempFile::write |
( |
const uint8_t |
byte | ) |
|
|
inline |
writes a single byte to the temporary file.
- Parameters
-
Definition at line 110 of file TempFile.hxx.
◆ fd_
◆ fileName_
| string TempFile::fileName_ |
|
private |
The documentation for this class was generated from the following files: