ROSE  0.9.9.168
Public Member Functions | List of all members
Sawyer::FileSystem::TemporaryFile Class Reference

Description

Creates a temporary file.

Creates a file with the specified name (or a pseudo-random name in the system temp directory), and make sure it gets deleted from the file system upon object destruction.

Definition at line 24 of file Sawyer/FileSystem.h.

#include <FileSystem.h>

Public Member Functions

 TemporaryFile ()
 Create a temporary file in the system temp directory. More...
 
 TemporaryFile (const boost::filesystem::path &name)
 Create a temporary file with the specified name. More...
 
 ~TemporaryFile ()
 Unlink the temporary file from the filesystem. More...
 
const boost::filesystem::path & name () const
 Path of temporary file. More...
 
std::ofstream & stream ()
 Output stream for temporary file. More...
 

Constructor & Destructor Documentation

Sawyer::FileSystem::TemporaryFile::TemporaryFile ( )
inline

Create a temporary file in the system temp directory.

Definition at line 35 of file Sawyer/FileSystem.h.

Sawyer::FileSystem::TemporaryFile::TemporaryFile ( const boost::filesystem::path &  name)
inlineexplicit

Create a temporary file with the specified name.

Definition at line 41 of file Sawyer/FileSystem.h.

Sawyer::FileSystem::TemporaryFile::~TemporaryFile ( )
inline

Unlink the temporary file from the filesystem.

This also closes the stream if it's open.

Definition at line 49 of file Sawyer/FileSystem.h.

Member Function Documentation

const boost::filesystem::path& Sawyer::FileSystem::TemporaryFile::name ( ) const
inline

Path of temporary file.

Definition at line 55 of file Sawyer/FileSystem.h.

std::ofstream& Sawyer::FileSystem::TemporaryFile::stream ( )
inline

Output stream for temporary file.

Definition at line 58 of file Sawyer/FileSystem.h.


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