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

The OverlaySyncCleanupHandler class is used to copy files on cleanup and can be added to the CleanupHandler stack in the FileToolkitWithUndo class. More...

#include <overlaysynccleanuphandler.h>

Inheritance diagram for softwarecontainer::OverlaySyncCleanupHandler:
[legend]
Collaboration diagram for softwarecontainer::OverlaySyncCleanupHandler:
[legend]

Public Member Functions

 OverlaySyncCleanupHandler (std::string src, std::string dst)
 OverlaySyncCleanupHandler Constructor of the class. More...
 
bool clean () override
 clean Performs the cleanup handling. More...
 
const std::string queryName () override
 queryName is needed to query member name yet its full functionality is not needed for this class. More...
 

Protected Member Functions

 LOG_DECLARE_CLASS_CONTEXT ("CLEA","Cleanup handler")
 

Detailed Description

The OverlaySyncCleanupHandler class is used to copy files on cleanup and can be added to the CleanupHandler stack in the FileToolkitWithUndo class.

On destruction onf the FileToolKitWithUndo, the src will be copied to dst recursively.

Definition at line 31 of file overlaysynccleanuphandler.h.

Constructor & Destructor Documentation

softwarecontainer::OverlaySyncCleanupHandler::OverlaySyncCleanupHandler ( std::string  src,
std::string  dst 
)

OverlaySyncCleanupHandler Constructor of the class.

Parameters
srcSource to copy the files from
dstDestination of the files.

Definition at line 26 of file overlaysynccleanuphandler.cpp.

27 {
28  m_src = src;
29  m_dst = dst;
30 }

Member Function Documentation

bool softwarecontainer::OverlaySyncCleanupHandler::clean ( )
overridevirtual

clean Performs the cleanup handling.

Returns
true on success
false on failure

Implements softwarecontainer::CleanUpHandler.

Definition at line 32 of file overlaysynccleanuphandler.cpp.

References softwarecontainer::RecursiveCopy::copy(), and softwarecontainer::RecursiveCopy::getInstance().

33 {
34  return RecursiveCopy::getInstance().copy(m_src, m_dst);
35 }
static RecursiveCopy & getInstance()
getInstance Gets the RecursiveCopy instance.
bool copy(std::string src, std::string dst)
copy Copy files from src to dst

Here is the call graph for this function:

const std::string softwarecontainer::OverlaySyncCleanupHandler::queryName ( )
overridevirtual

queryName is needed to query member name yet its full functionality is not needed for this class.

Since no directory removal operation occurs within OverlaySyncCleanupHandler, it is irrelevant when the code checks whether the directory is in the list or not since the purpose of this function is to be used for cleaning path.

Returns
an empty string

Implements softwarecontainer::CleanUpHandler.

Definition at line 37 of file overlaysynccleanuphandler.cpp.

38 {
39  return "";
40 }

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