diff options
Diffstat (limited to 'NSCmpts/BackupActions.h')
-rw-r--r-- | NSCmpts/BackupActions.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/NSCmpts/BackupActions.h b/NSCmpts/BackupActions.h new file mode 100644 index 0000000..ae1a977 --- /dev/null +++ b/NSCmpts/BackupActions.h @@ -0,0 +1,113 @@ +// BackupActions.h: interface for the CBackupActions class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_BACKUPACTIONS_H__75916453_A62F_11D3_82DF_0020182B97FC__INCLUDED_) +#define AFX_BACKUPACTIONS_H__75916453_A62F_11D3_82DF_0020182B97FC__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ActionEngine.h" +#include <mystring.h> +#include <path.h> + +#include "../common/cmptdata.h" + +class CBackupActions +{ +public: + /////////////////////////////////////////////////////// + // Holds the data read functionality for all the + // Different types of backups + class BasePrepare : public CAction + { + public: + BasePrepare() {}; + + // Read Our own Data here + HRESULT Initialize(const CPropertyBag& data); + + protected: + file_path m_dest; + string_array m_src; + string_set m_asIgnore; + }; + + //////////////////////////////////////////////////// + // This action is the first action to go into + // the engine. It adds all the other actions + class ArchivePrepare : public BasePrepare + { + public: + ArchivePrepare() {}; + + virtual bool Do(CActionEngine* pEngine, HWND hwndUpdates); + virtual void Fix(HRESULT) { } + virtual bool IsFixable(HRESULT) const + { return false; } + virtual bool IsRetryable() const + { return false; } + }; + + //////////////////////////////////////////////////// + // This action is the first action to go into + // the engine. It adds all the other actions + class DatePrepare : public BasePrepare + { + public: + DatePrepare() {}; + + virtual bool Do(CActionEngine* pEngine, HWND hwndUpdates); + virtual void Fix(HRESULT) { } + virtual bool IsFixable(HRESULT) const + { return false; } + virtual bool IsRetryable() const + { return false; } + }; + + ////////////////////////////////////////////////////// + // Standard Archive Backup File + class ArchiveCopy : public CAction + { + public: + ArchiveCopy(const file_path& src, const file_path& dest) + : m_src(src), m_dest(dest) + { } + + virtual bool Do(CActionEngine* pEngine, HWND hwndUpdates); + virtual void Fix(HRESULT) { } + virtual bool IsFixable(HRESULT) const + { return false; } + virtual bool IsRetryable() const + { return true; } + + protected: + file_path m_dest; + file_path m_src; + }; + + ////////////////////////////////////////////////////// + // Standard Date Backup File + class DateCopy : public CAction + { + public: + DateCopy(const file_path& src, const file_path& dest) + : m_src(src), m_dest(dest) + { } + + virtual bool Do(CActionEngine* pEngine, HWND hwndUpdates); + virtual void Fix(HRESULT/* hr*/) { } + virtual bool IsFixable(HRESULT/* hr*/) const + { return false; } + virtual bool IsRetryable() const + { return true; } + + protected: + file_path m_dest; + file_path m_src; + }; +}; + +#endif // !defined(AFX_BACKUPACTIONS_H__75916453_A62F_11D3_82DF_0020182B97FC__INCLUDED_) |