Public Member Functions | Static Public Member Functions | Private Attributes
utilmm::tempfile Class Reference

#include <system.hh>

List of all members.

Public Member Functions

FILE * detach ()
FILE * handle () const
boost::filesystem::path path () const
 tempfile ()
 tempfile (std::string const &basename)
 ~tempfile ()

Static Public Member Functions

static FILE * create ()
static FILE * mkstemp (std::string const &base, boost::filesystem::path &path)

Private Attributes

auto_close m_guard
boost::filesystem::path m_path

Detailed Description

A temporary file. It is created on construction and removed on destruction

Definition at line 89 of file system.hh.

Constructor & Destructor Documentation

Create a temporary file. If you use this constructor, you cannot have the file name. You'll have to use only the file handle.


Definition at line 127 of file

Close and destroy the file

Definition at line 130 of file

tempfile::tempfile ( std::string const &  basename)

Create a temporary file using a base name The file name is available using path()

The tempfile() version is more secure. Use only this constructor if you need the file path

Definition at line 120 of file

Member Function Documentation

FILE * tempfile::create ( ) [static]

Creates a temporary file

the file descriptor to the open file
unix_erroran error occured

Definition at line 94 of file

FILE * tempfile::detach ( )

Disassociates this object from the temporary file After a call to disassociate(), path() and fd() are no longer available

the file path

Definition at line 147 of file

FILE * tempfile::handle ( void  ) const

Get the underlying file handle

Definition at line 141 of file

FILE * tempfile::mkstemp ( std::string const &  base,
boost::filesystem::path &  path 
) [static]

Wrapper around mkstemp Do not use this function to create a temporary file Use a tempfile object instead

Definition at line 102 of file

boost::filesystem::path tempfile::path ( ) const

Get the file path The file path is only available if the tempfile(std::string) constructor has been used.

the file path or an empty path if it is not available

Definition at line 155 of file

Member Data Documentation

Definition at line 92 of file system.hh.

boost::filesystem::path utilmm::tempfile::m_path [private]

Definition at line 91 of file system.hh.

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

Author(s): Sylvain Joyeux/
autogenerated on Thu Jan 2 2014 11:38:31