-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXUpdateManager.h
More file actions
93 lines (70 loc) · 2.5 KB
/
XUpdateManager.h
File metadata and controls
93 lines (70 loc) · 2.5 KB
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
#pragma once
#include <windows.h>
#include <string>
#include "PatchedInfo.h"
class XUpdateManager
{
public:
static XUpdateManager& GetInstance();
struct LogHandler
{
virtual void SetCancelButton( bool bEnable ) {};
virtual void SetStatusMessage( const char *szLog ) {};
virtual void AddLog( const char *szLog ) {};
};
void SetLogHandler( LogHandler* pLog ) { m_pLog = pLog; }
LogHandler* GetLogHandler() const { return m_pLog; }
enum
{
NONE = 0, FREEZE = 1, MELT = 2, ENCODE = 1, DECODE = 2
};
void SetOption( int nCompress, int nNameEncode, bool bBuildIndex, bool bBuildDirectory, bool bDoXOR, const char *szAppName, int nVerison )
{
m_nCompress = nCompress;
m_nNameEncode = nNameEncode;
m_bBuildIndex = bBuildIndex;
m_bBuildDirectory = bBuildDirectory;
m_bDoXOR = bDoXOR;
m_strAppName = szAppName;
m_nVersion = nVerison;
}
void GetOption( int & nCompress, int & nNameEncode, bool & bBuildIndex, bool & bBuildDirectory, bool & bDoXOR, std::string & strAppName, int & nVerison ) const
{
nCompress = m_nCompress;
nNameEncode = m_nNameEncode;
bBuildIndex = m_bBuildIndex;
bBuildDirectory = m_bBuildDirectory;
bDoXOR = m_bDoXOR;
strAppName = m_strAppName;
nVerison = m_nVersion;
}
void SetVersion( int nVersion ) { m_nVersion = nVersion; }
void SetAppName( const char* szAppName ) { m_strAppName = szAppName; }
int GetVersion( void ) const { return m_nVersion; }
std::string GetAppName( void ) const { return m_strAppName; }
std::string GetPatchPatchName( void ) const { return m_strPatchPatchName; }
void SaveUpdateInfo( void );
void CloseHandle( void );
void Cancel( void );
void onDrop( HDROP* pFile );
void onSelectPath( std::string szFolderFullPath );
bool onDirectory( struct XOption *pOpt, const char* szBaseDirectory, const char *szPathName, std::string& strPatchInfo );
bool onFile( const PatchedInfo& Patched, struct XOption *pOpt, const char* szBaseDirectory, const char* szFileName, std::string& strPatchInfo );
bool MakeTPF( const XOption& option, const std::string& strPatchInfo );
private:
XUpdateManager();
virtual ~XUpdateManager();
void loadUpdateInfo( void );
void procPatch( const char *szPathName );
LogHandler* m_pLog;
std::string m_strAppName;
std::string m_strPatchPatchName;
int m_nCompress;
int m_nNameEncode;
int m_nVersion;
bool m_bBuildIndex;
bool m_bBuildDirectory;
bool m_bDoXOR;
public:
HANDLE m_hCommandLineExecution;
};