ROSE  0.11.96.11
Public Member Functions | List of all members
Sawyer::FileSystem::TemporaryDirectory Class Reference

Description

Create a temporary directory.

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

Definition at line 70 of file util/Sawyer/FileSystem.h.

#include <FileSystem.h>

Inheritance diagram for Sawyer::FileSystem::TemporaryDirectory:
Inheritance graph
[legend]
Collaboration diagram for Sawyer::FileSystem::TemporaryDirectory:
Collaboration graph
[legend]

Public Member Functions

 TemporaryDirectory ()
 Create a temporary subdirectory in the system's temp directory. More...
 
 TemporaryDirectory (const boost::filesystem::path &name)
 Create a temporary directory with the specified name. More...
 
 ~TemporaryDirectory ()
 Recursively unlink the temporary directory. More...
 
const boost::filesystem::path & name () const
 Path of temporary directory.
 
bool keep () const
 Property: Keep directory instead of deleting it.
 
void keep (bool b)
 Property: Keep directory instead of deleting it.
 

Constructor & Destructor Documentation

◆ TemporaryDirectory() [1/2]

Sawyer::FileSystem::TemporaryDirectory::TemporaryDirectory ( )
inline

Create a temporary subdirectory in the system's temp directory.

The directory is recursively unlinked from the filesystem when this object is destroyed.

Definition at line 78 of file util/Sawyer/FileSystem.h.

◆ TemporaryDirectory() [2/2]

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

Create a temporary directory with the specified name.

Creates the specified directory. Parent directories must already exist. The directory is recursively unlinked from the filesystem when this object is destroyed.

Definition at line 87 of file util/Sawyer/FileSystem.h.

◆ ~TemporaryDirectory()

Sawyer::FileSystem::TemporaryDirectory::~TemporaryDirectory ( )
inline

Recursively unlink the temporary directory.

This destructor recursively unlinks the directory and its contents from the filesystem, but does not remove any parent directories even if they would become empty.

Definition at line 96 of file util/Sawyer/FileSystem.h.


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