softwarecontainer  0.18.0-739e8d7 2017-05-04
softwarecontainer::RecursiveDelete Class Reference

The RecursiveDelete class is a singleton class used to delete files recursively in a directory. More...

#include <recursivedelete.h>

Public Member Functions

 RecursiveDelete (RecursiveDelete &s)=delete
 Disallow copy and operator constructors. More...
 
void operator= (RecursiveDelete const &s)=delete
 
bool del (std::string dir)
 delete Delete files from directory More...
 

Static Public Member Functions

static RecursiveDeletegetInstance ()
 getInstance Gets the RecursiveDelete instance. More...
 

Detailed Description

The RecursiveDelete class is a singleton class used to delete files recursively in a directory.

Definition at line 29 of file recursivedelete.h.

Constructor & Destructor Documentation

softwarecontainer::RecursiveDelete::RecursiveDelete ( RecursiveDelete s)
delete

Disallow copy and operator constructors.

Member Function Documentation

RecursiveDelete & softwarecontainer::RecursiveDelete::getInstance ( )
static

getInstance Gets the RecursiveDelete instance.

Returns
The RecursiveDelete instance.

Definition at line 51 of file recursivedelete.cpp.

52 {
53  static RecursiveDelete instance;
54  return instance;
55 }
RecursiveDelete(RecursiveDelete &s)=delete
Disallow copy and operator constructors.
bool softwarecontainer::RecursiveDelete::del ( std::string  dir)

delete Delete files from directory

Parameters
dirThe source path to deletefrom
Returns
true on success
false on failure

Definition at line 57 of file recursivedelete.cpp.

58 {
59  bool retval = true;
60  if (nftw(dir.c_str(), deleteFile, 20, FTW_DEPTH) != 0) {
61  log_error() << "Failed to recursively delete " << dir;
62  retval = false;
63  }
64 
65  return retval;
66 }

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