Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
datatools::temp_file Class Reference

A class for the management of temporary unique file stored in a given directory. More...

#include <bayeux/datatools/temporary_files.h>

Public Member Functions

 temp_file ()
 Default constructor. More...
 
 temp_file (const char *pattern_, bool remove_at_destroy_=true)
 Constructor. More...
 
 temp_file (std::string pattern_, bool remove_at_destroy_=true)
 Constructor. More...
 
 temp_file (const char *path_dir_, const char *pattern_, bool remove_at_destroy_=true)
 Constructor. More...
 
 temp_file (std::string path_dir_, const char *pattern_, bool remove_at_destroy_=true)
 Constructor. More...
 
 temp_file (std::string path_dir_, std::string pattern_, bool remove_at_destroy_=true)
 Constructor. More...
 
 ~temp_file ()
 Destructor. More...
 
const std::string & get_filename () const
 Return the filename of the temporary file. More...
 
bool is_valid () const
 Check the validity of the temporary file. More...
 
bool is_read_open () const
 Check if the temporary file is open for reading. More...
 
bool is_write_open () const
 Check if the temporary file is open for writing. More...
 
void set_remove_at_destroy (bool)
 Set the 'remove at destroy' flag. More...
 
void set_verbose (bool)
 Activate verbosity. More...
 
std::ofstream & out ()
 Return the associated output stream. More...
 
std::ifstream & in ()
 Return the associated input stream. More...
 
void create (std::string path_dir_, std::string pattern_)
 Create the temporary file from path and filename pattern. More...
 
void close ()
 Close the temporary file. More...
 
void remove ()
 Remove the temporary file from the filesystem. More...
 

Static Public Member Functions

static const std::string & default_pattern ()
 

Protected Member Functions

void set_defaults ()
 Set the default values of attributes. More...
 

Detailed Description

A class for the management of temporary unique file stored in a given directory.

Constructor & Destructor Documentation

◆ temp_file() [1/6]

datatools::temp_file::temp_file ( )

Default constructor.

◆ temp_file() [2/6]

datatools::temp_file::temp_file ( const char *  pattern_,
bool  remove_at_destroy_ = true 
)

Constructor.

◆ temp_file() [3/6]

datatools::temp_file::temp_file ( std::string  pattern_,
bool  remove_at_destroy_ = true 
)

Constructor.

◆ temp_file() [4/6]

datatools::temp_file::temp_file ( const char *  path_dir_,
const char *  pattern_,
bool  remove_at_destroy_ = true 
)

Constructor.

◆ temp_file() [5/6]

datatools::temp_file::temp_file ( std::string  path_dir_,
const char *  pattern_,
bool  remove_at_destroy_ = true 
)

Constructor.

◆ temp_file() [6/6]

datatools::temp_file::temp_file ( std::string  path_dir_,
std::string  pattern_,
bool  remove_at_destroy_ = true 
)

Constructor.

◆ ~temp_file()

datatools::temp_file::~temp_file ( )

Destructor.

Member Function Documentation

◆ close()

void datatools::temp_file::close ( )

Close the temporary file.

◆ create()

void datatools::temp_file::create ( std::string  path_dir_,
std::string  pattern_ 
)

Create the temporary file from path and filename pattern.

◆ default_pattern()

static const std::string& datatools::temp_file::default_pattern ( )
static

◆ get_filename()

const std::string& datatools::temp_file::get_filename ( ) const

Return the filename of the temporary file.

◆ in()

std::ifstream& datatools::temp_file::in ( )

Return the associated input stream.

◆ is_read_open()

bool datatools::temp_file::is_read_open ( ) const

Check if the temporary file is open for reading.

◆ is_valid()

bool datatools::temp_file::is_valid ( ) const

Check the validity of the temporary file.

◆ is_write_open()

bool datatools::temp_file::is_write_open ( ) const

Check if the temporary file is open for writing.

◆ out()

std::ofstream& datatools::temp_file::out ( )

Return the associated output stream.

◆ remove()

void datatools::temp_file::remove ( )

Remove the temporary file from the filesystem.

◆ set_defaults()

void datatools::temp_file::set_defaults ( )
protected

Set the default values of attributes.

◆ set_remove_at_destroy()

void datatools::temp_file::set_remove_at_destroy ( bool  )

Set the 'remove at destroy' flag.

◆ set_verbose()

void datatools::temp_file::set_verbose ( bool  )

Activate verbosity.


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