Subversion Repositories spk

Rev

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

Rev 13 Rev 14
Line 20... Line 20...
20
	int		iTextID;
20
	int		iTextID;
21
	int		iTextPage;
21
	int		iTextPage;
22
	CLinkList<SWaresText> lText;
22
	CLinkList<SWaresText> lText;
23
	int		iUsed;
23
	int		iUsed;
24
} SWares;
24
} SWares;
-
 
25
 
-
 
26
	tstruct SSettingType {
-
 
27
		Utils::String	sKey;
-
 
28
		int		iType;
-
 
29
	} SSettingType;
25
 
30
 
26
 
31
 
27
class SPKEXPORT CSpkFile : public CBaseFile
32
class SPKEXPORT CSpkFile : public CBaseFile
28
{
33
{
29
public:
34
public:
Line 48... Line 53...
48
		SCRIPTTYPE_GENERALMOD,
53
		SCRIPTTYPE_GENERALMOD,
49
		SCRIPTTYPE_TOTAL,
54
		SCRIPTTYPE_TOTAL,
50
		SCRIPTTYPE_WINGCOMMAND,
55
		SCRIPTTYPE_WINGCOMMAND,
51
		SCRIPTTYPE_MAX
56
		SCRIPTTYPE_MAX
52
	};
57
	};
53
 
-
 
54
	tstruct SSettingType {
-
 
55
		Utils::String	sKey;
-
 
56
		int		iType;
-
 
57
	} SSettingType;
-
 
58
 
-
 
59
 
58
 
60
private:
59
private:
61
	enum {
60
	enum {
62
		SETTING_INTEGER,
61
		SETTING_INTEGER,
63
		SETTING_STRING,
62
		SETTING_STRING,
Line 131... Line 130...
131
	void SetCustomStart() { this->SetPackageType(PACKAGETYPE_CUSTOMSTART); }
130
	void SetCustomStart() { this->SetPackageType(PACKAGETYPE_CUSTOMSTART); }
132
	void SetPackageUpdate() { this->SetPackageType(PACKAGETYPE_UPDATE); }
131
	void SetPackageUpdate() { this->SetPackageType(PACKAGETYPE_UPDATE); }
133
	void SetNormalPackage() { this->SetPackageType(PACKAGETYPE_NORMAL); }
132
	void SetNormalPackage() { this->SetPackageType(PACKAGETYPE_NORMAL); }
134
	void SetScriptType(int i) { SetNormalPackage(); m_iScriptType = i; m_bChanged = true; }
133
	void SetScriptType(int i) { SetNormalPackage(); m_iScriptType = i; m_bChanged = true; }
135
 
134
 
136
	virtual bool LoadPackageData(CyString first, CyString rest);
135
	virtual bool LoadPackageData(const Utils::String &sFfirst, const Utils::String &sRest);
137
	virtual bool GeneratePackagerScript(bool wildcard, CyStringList *list, bool datafile = false);
136
	virtual bool GeneratePackagerScript(bool wildcard, CyStringList *list, bool datafile = false);
138
 
137
 
139
	CSpkFile();
138
	CSpkFile();
140
	virtual ~CSpkFile();
139
	virtual ~CSpkFile();
141
 
140
 
142
	bool IsMatchingMod(const Utils::String &mod) const;
141
	bool IsMatchingMod(const Utils::String &mod) const;
143
 
142
 
144
	/// reading of files
143
	/// reading of files
145
	virtual bool ReadFileToMemory ( C_File *file );
144
	virtual bool ReadFileToMemory ( C_File *file );
146
	virtual bool ParseValueLine ( CyString line );
145
	virtual bool ParseValueLine(const Utils::String &line);
147
 
146
 
148
	// writing of files
147
	// writing of files
149
	CyString CreateValuesLine ();
148
	virtual Utils::String CreateValuesLine () const;
150
	bool WriteHeader ( FILE *id, int, int );
149
	bool WriteHeader ( FILE *id, int, int );
151
 
150
 
152
	SWares *FindWare(const Utils::String &id) const;
151
	SWares *FindWare(const Utils::String &id) const;
153
	void AddWare(const Utils::String &sWareLine);
152
	void AddWare(const Utils::String &sWareLine);
154
	void AddWareText(const Utils::String &sText);
153
	void AddWareText(const Utils::String &sText);
Line 187... Line 186...
187
	static CSpkFile *convertFromOld(const Utils::String &sOldFilename);
186
	static CSpkFile *convertFromOld(const Utils::String &sOldFilename);
188
 
187
 
189
protected:
188
protected:
190
	virtual void Delete ();
189
	virtual void Delete ();
191
	virtual void SetDefaults ();
190
	virtual void SetDefaults ();
192
	virtual bool CheckHeader(CyString header);
191
	virtual bool CheckHeader(const Utils::String header) const;
193
 
192
 
194
	// old conversion functions
193
	// old conversion functions
195
	unsigned char *_convert_uncompressFile(const Utils::String &sOldFilename, int *pLen);
194
	unsigned char *_convert_uncompressFile(const Utils::String &sOldFilename, int *pLen);
196
	void _convert_parse(const Utils::String &sCmd, const Utils::String &sRest);
195
	void _convert_parse(const Utils::String &sCmd, const Utils::String &sRest);
197
	Utils::String _convert_fileEndString(const Utils::String &sFile);
196
	Utils::String _convert_fileEndString(const Utils::String &sFile);