ROSE 0.11.145.147
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 Sawyer/FileSystem.h.

#include <Sawyer/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.
 
 TemporaryDirectory (const boost::filesystem::path &name)
 Create a temporary directory with the specified name.
 
 ~TemporaryDirectory ()
 Recursively unlink the temporary directory.
 
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 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 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 Sawyer/FileSystem.h.

Member Function Documentation

◆ name()

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

Path of temporary directory.

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

◆ keep() [1/2]

bool Sawyer::FileSystem::TemporaryDirectory::keep ( ) const
inline

Property: Keep directory instead of deleting it.

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

◆ keep() [2/2]

void Sawyer::FileSystem::TemporaryDirectory::keep ( bool  b)
inline

Property: Keep directory instead of deleting it.

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


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