Class representing the existence of a temporary file. More...
#include <tpie/tempname.h>
Inherits noncopyable.
Public Member Functions | |
bool | is_persistent () const |
void | set_persistent (bool p) |
Set persistence. More... | |
temp_file (const std::string &path, bool persist=false) | |
Create a temp_file associated with a specific file. More... | |
void | set_path (const std::string &path, bool persist=false) |
Associate with a specific file. More... | |
void | update_recorded_size (stream_size_type size) |
temp_file () | |
Create a temp_file and generate a random temporary file name. More... | |
~temp_file () | |
temp_file destructor. More... | |
const std::string & | path () |
Get the path of the associated file. More... | |
void | free () |
If not persistent, unlink the associated file. More... | |
Class representing the existence of a temporary file.
When a temp_file object goes out of scope and is not set to persistent, the associated temporary file will be deleted.
Definition at line 152 of file tempname.h.
tpie::temp_file::temp_file | ( | const std::string & | path, |
bool | persist = false |
||
) |
Create a temp_file associated with a specific file.
tpie::temp_file::temp_file | ( | ) |
Create a temp_file and generate a random temporary file name.
tpie::temp_file::~temp_file | ( | ) |
temp_file destructor.
If not persistent, unlink the associated file.
void tpie::temp_file::free | ( | ) |
If not persistent, unlink the associated file.
|
inline |
Definition at line 162 of file tempname.h.
Referenced by tpie::ami::stack< T >::persist(), and tpie::ami::stream< T >::persist().
const std::string& tpie::temp_file::path | ( | ) |
Get the path of the associated file.
Referenced by tpie::pipelining::serialization_bits::rev_input_t< rev_output_t< output_dest_t > >::begin(), tpie::file_base_crtp< file_stream_base >::open(), tpie::pipelining::serialization_bits::rev_output_t< output_dest_t >::propagate(), and tpie::ami::stream< T >::stream().
void tpie::temp_file::set_path | ( | const std::string & | path, |
bool | persist = false |
||
) |
Associate with a specific file.
|
inline |
Set persistence.
When true, the file will not be deleted when this goes out of scope.
Definition at line 168 of file tempname.h.
Referenced by tpie::ami::stack< T >::persist(), tpie::ami::stream< T >::persist(), and tpie::queue< T >::queue().