summaryrefslogtreecommitdiff
path: root/NSCmpts/BackupActions.h
blob: ae1a977feeb4876ff08a1bd9ef45a3547e5ebdb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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_)