Thrill  0.1
TemporaryDirectory Class Reference

Detailed Description

A class which creates a temporary directory in the current directory and returns it via get().

When the object is destroyed the temporary directory is wiped non-recursively.

Definition at line 26 of file temporary_directory.hpp.

#include <temporary_directory.hpp>

Public Member Functions

 TemporaryDirectory ()
 
 TemporaryDirectory (const TemporaryDirectory &)=delete
 non-copyable: delete copy-constructor More...
 
 ~TemporaryDirectory ()
 
const std::string & get () const
 return the temporary directory name More...
 
TemporaryDirectoryoperator= (const TemporaryDirectory &)=delete
 non-copyable: delete assignment operator More...
 
void wipe () const
 wipe contents of directory More...
 

Static Public Member Functions

static std::string make_directory (const char *sample="thrill-testsuite-")
 Create a temporary directory, returns its name without trailing /. More...
 
static void wipe_directory (const std::string &tmp_dir, bool do_rmdir)
 wipe temporary directory NON RECURSIVELY! More...
 

Private Attributes

std::string dir_
 

Constructor & Destructor Documentation

◆ TemporaryDirectory() [1/2]

TemporaryDirectory ( )
inline

Definition at line 35 of file temporary_directory.hpp.

Referenced by TemporaryDirectory::~TemporaryDirectory().

◆ ~TemporaryDirectory()

◆ TemporaryDirectory() [2/2]

TemporaryDirectory ( const TemporaryDirectory )
delete

non-copyable: delete copy-constructor

Member Function Documentation

◆ get()

const std::string& get ( ) const
inline

return the temporary directory name

Definition at line 49 of file temporary_directory.hpp.

References TemporaryDirectory::dir_.

◆ make_directory()

std::string make_directory ( const char *  sample = "thrill-testsuite-")
static

Create a temporary directory, returns its name without trailing /.

Definition at line 100 of file temporary_directory.cpp.

◆ operator=()

TemporaryDirectory& operator= ( const TemporaryDirectory )
delete

non-copyable: delete assignment operator

Referenced by TemporaryDirectory::~TemporaryDirectory().

◆ wipe()

void wipe ( ) const
inline

wipe contents of directory

Definition at line 52 of file temporary_directory.hpp.

References TemporaryDirectory::dir_, and TemporaryDirectory::wipe_directory().

◆ wipe_directory()

void wipe_directory ( const std::string &  tmp_dir,
bool  do_rmdir 
)
static

wipe temporary directory NON RECURSIVELY!

Definition at line 115 of file temporary_directory.cpp.

References sLOG1, and thrill::common::ts_readdir().

Referenced by TemporaryDirectory::wipe(), and TemporaryDirectory::~TemporaryDirectory().

Member Data Documentation

◆ dir_

std::string dir_
private

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