ISIS Core Library 0.7.2 (api 3.0.0)
Public Member Functions

isis::util::TmpFile Class Reference

Class to automatically create and handle a temporary file. More...

#include <tmpfile.hpp>

Public Member Functions

 TmpFile (std::string prefix="", std::string suffix="")
 Create a temporary file.
 ~TmpFile ()
 Will delete the temporary file if its still there.

Detailed Description

Class to automatically create and handle a temporary file.

This can e.g. be used when writing plugins for image formats to have a mock object. The file will be created by the constructor and deleted by the destructor. If its not there anymore, a warning will be send. This inherits from boost::filesystem::path and thus can be used as such.

Definition at line 35 of file tmpfile.hpp.


Constructor & Destructor Documentation

isis::util::TmpFile::TmpFile ( std::string  prefix = "",
std::string  suffix = "" 
)

Create a temporary file.

This generates a temporary filename using the given prefix and suffix. The file will also be created to prevent any following calls from generating the same filename.

Parameters:
prefixstring to be inserted between the path and the actual filename
suffixstring to be appended to the filename

Definition at line 38 of file tmpfile.cpp.

isis::util::TmpFile::~TmpFile ( )

Will delete the temporary file if its still there.

Definition at line 47 of file tmpfile.cpp.


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