Subversion Repositories spk

Rev

Rev 10 | Rev 14 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 13
Line 1... Line 1...
1
#pragma once
1
#pragma once
2
#include "BaseFile.h"
2
#include "BaseFile.h"
3
 
-
 
4
tstruct SSettingType {
-
 
5
	Utils::String	sKey;
-
 
6
	int		iType;
-
 
7
} SSettingType;
-
 
8
 
3
 
9
typedef struct SWaresText {
4
typedef struct SWaresText {
10
	int		iLang;
5
	int		iLang;
11
	Utils::String  sName;
6
	Utils::String  sName;
12
	Utils::String  sDesc;
7
	Utils::String  sDesc;
Line 53... Line 48...
53
		SCRIPTTYPE_GENERALMOD,
48
		SCRIPTTYPE_GENERALMOD,
54
		SCRIPTTYPE_TOTAL,
49
		SCRIPTTYPE_TOTAL,
55
		SCRIPTTYPE_WINGCOMMAND,
50
		SCRIPTTYPE_WINGCOMMAND,
56
		SCRIPTTYPE_MAX
51
		SCRIPTTYPE_MAX
57
	};
52
	};
-
 
53
 
-
 
54
	tstruct SSettingType {
-
 
55
		Utils::String	sKey;
-
 
56
		int		iType;
-
 
57
	} SSettingType;
-
 
58
 
58
 
59
 
59
private:
60
private:
60
	enum {
61
	enum {
61
		SETTING_INTEGER,
62
		SETTING_INTEGER,
62
		SETTING_STRING,
63
		SETTING_STRING,
Line 65... Line 66...
65
 
66
 
66
	typedef struct SSettingString : public SSettingType {
67
	typedef struct SSettingString : public SSettingType {
67
		SSettingString () { iType = SETTING_STRING; }
68
		SSettingString () { iType = SETTING_STRING; }
68
		Utils::String sValue;
69
		Utils::String sValue;
69
	} SSettingString;
70
	} SSettingString;
70
 
71
 
71
	typedef struct SSettingInteger : public SSettingType {
72
	typedef struct SSettingInteger : public SSettingType {
72
		SSettingInteger () { iType = SETTING_INTEGER; }
73
		SSettingInteger () { iType = SETTING_INTEGER; }
73
		int iValue;
74
		int iValue;
74
	} SSettingInteger;
75
	} SSettingInteger;
75
 
76
 
76
	typedef struct SSettingCheck : public SSettingType {
77
	typedef struct SSettingCheck : public SSettingType {
77
		SSettingCheck () { iType = SETTING_CHECK; }
78
		SSettingCheck () { iType = SETTING_CHECK; }
78
		bool bValue ;
79
		bool bValue ;
79
	} SSettingCheck;
80
	} SSettingCheck;
-
 
81
 
80
 
82
 
81
public:
83
public:
82
	static int ConvertScriptType(const Utils::String &sType);
84
	static int ConvertScriptType(const Utils::String &sType);
83
	static Utils::String GetScriptTypeStringStatic(int type);
85
	static Utils::String GetScriptTypeStringStatic(int type);
84
	static Utils::String GetWareText(SWares *w, int lang);
86
	static Utils::String GetWareText(SWares *w, int lang);
85
	static Utils::String GetWareDesc(SWares *w, int lang);
87
	static Utils::String GetWareDesc(SWares *w, int lang);
86
 
88
 
87
	// get functions
89
	// get functions
88
	Utils::String GetScriptTypeString(int lang);
90
	Utils::String GetScriptTypeString(int lang) const;
89
	Utils::String GetCustomScriptType (){ return m_sScriptType; }
91
	Utils::String GetCustomScriptType () const { return m_sScriptType; }
90
	Utils::String GetCustomScriptType (int lang);
92
	Utils::String GetCustomScriptType (int lang) const;
91
	Utils::String GetOtherName ()	{ return m_sOtherName; }
93
	Utils::String GetOtherName () const	{ return m_sOtherName; }
92
	Utils::String GetOtherAuthor ()	{ return m_sOtherAuthor; }
94
	Utils::String GetOtherAuthor ()	const { return m_sOtherAuthor; }
93
	CLinkList<SWares> *GetWaresList() { return &m_lWares; }
95
	CLinkList<SWares> *GetWaresList() { return &m_lWares; }
94
	CLinkList<SSettingType> *GetSettingsList() { return &m_lSettings; }
96
	CLinkList<SSettingType> *GetSettingsList() { return &m_lSettings; }
95
 
97
 
96
	bool CheckValidReadmes ();
98
	bool CheckValidReadmes () const;
97
 
99
 
98
	bool   IsCustomStart () { return (m_iPackageType == PACKAGETYPE_CUSTOMSTART) ? true : false;  }
100
	bool   IsCustomStart () const	{ return (m_iPackageType == PACKAGETYPE_CUSTOMSTART) ? true : false;  }
99
	bool   IsPackageUpdate () { return (m_iPackageType == PACKAGETYPE_UPDATE) ? true : false; }
101
	bool   IsPackageUpdate () const { return (m_iPackageType == PACKAGETYPE_UPDATE) ? true : false; }
100
	bool   IsPatch ()		{ return (m_iPackageType == PACKAGETYPE_PATCH) ? true: false; }
102
	bool   IsPatch () const			{ return (m_iPackageType == PACKAGETYPE_PATCH) ? true: false; }
101
	bool   IsLibrary ()		{ return (m_iPackageType == PACKAGETYPE_LIBRARY) ? true: false; }
103
	bool   IsLibrary ()	const		{ return (m_iPackageType == PACKAGETYPE_LIBRARY) ? true: false; }
102
	bool   IsAnotherMod()   { if ( (m_sOtherName.empty()) || (m_sOtherAuthor.empty()) ) return false; return true; }
104
	bool   IsAnotherMod() const		{ if ( (m_sOtherName.empty()) || (m_sOtherAuthor.empty()) ) return false; return true; }
103
	bool   IsForceProfile() { return m_bForceProfile; }
105
	bool   IsForceProfile() const	{ return m_bForceProfile; }
104
	int		GetScriptType() { return m_iScriptType; }
106
	int		GetScriptType() const	{ return m_iScriptType; }
105
	int		GetPackageType() { return m_iPackageType; }
107
	int		GetPackageType() const	{ return m_iPackageType; }
106
 
108
 
107
	// Custom Start
109
	// Custom Start
108
	Utils::String GetCustomStartName();
110
	Utils::String GetCustomStartName() const;
109
 
111
 
110
	// set functions
112
	// set functions
111
	void SetScriptType	 ( const Utils::String &str ) { m_sScriptType = str; m_bChanged = true; }
113
	void SetScriptType	 ( const Utils::String &str ) { m_sScriptType = str; m_bChanged = true; }
112
	void SetAnotherMod   ( const Utils::String &name, const Utils::String &author ) { m_sOtherName = name; m_sOtherAuthor = author; m_bChanged = true; }
114
	void SetAnotherMod   ( const Utils::String &name, const Utils::String &author ) { m_sOtherName = name; m_sOtherAuthor = author; m_bChanged = true; }
113
	void SetForceProfile ( bool p ) { m_bForceProfile = p; m_bChanged = true; }
115
	void SetForceProfile ( bool p ) { m_bForceProfile = p; m_bChanged = true; }
Line 135... Line 137...
135
	virtual bool GeneratePackagerScript(bool wildcard, CyStringList *list, bool datafile = false);
137
	virtual bool GeneratePackagerScript(bool wildcard, CyStringList *list, bool datafile = false);
136
 
138
 
137
	CSpkFile();
139
	CSpkFile();
138
	virtual ~CSpkFile();
140
	virtual ~CSpkFile();
139
 
141
 
140
	bool IsMatchingMod(const Utils::String &mod);
142
	bool IsMatchingMod(const Utils::String &mod) const;
141
 
143
 
142
	/// reading of files
144
	/// reading of files
143
	virtual bool ReadFileToMemory ( C_File *file );
145
	virtual bool ReadFileToMemory ( C_File *file );
144
	virtual bool ParseValueLine ( CyString line );
146
	virtual bool ParseValueLine ( CyString line );
145
 
147
 
Line 157... Line 159...
157
	void ClearWareText(SWares *pWare);
159
	void ClearWareText(SWares *pWare);
158
	void ClearWareText(const Utils::String &sWare);
160
	void ClearWareText(const Utils::String &sWare);
159
	void ClearWares ();
161
	void ClearWares ();
160
	bool AnyWares() const { return !m_lWares.empty(); }
162
	bool AnyWares() const { return !m_lWares.empty(); }
161
 
163
 
162
	int CheckValidCustomStart ();
164
	int CheckValidCustomStart () const;
163
 
165
 
164
	bool UpdateSigned (bool updateFiles);
166
	bool UpdateSigned (bool updateFiles);
165
 
167
 
166
	SSettingType *AddSetting(const Utils::String &key, int type);
168
	SSettingType *AddSetting(const Utils::String &key, int type);
167
	void ClearSettings ();
169
	void ClearSettings ();