Subversion Repositories spk

Rev

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

Rev 204 Rev 206
Line 75... Line 75...
75
	_iRecommended = iRec;
75
	_iRecommended = iRec;
76
	_iGameChanging = iChanging;
76
	_iGameChanging = iChanging;
77
	_iEaseOfUse = iEase;
77
	_iEaseOfUse = iEase;
78
}
78
}
79
 
79
 
80
void CCorePackage::_parseDescription(const Utils::String &sDesc)
80
void CCorePackage::_parseDescription(const Utils::WString &sDesc)
81
{
81
{
82
	_sDescription = sDesc;
82
	_sDescription = sDesc;
83
	//_sDescription.RemoveFirstChar('\n');
83
	//_sDescription.RemoveFirstChar('\n');
84
	//_sDescription.RemoveFirstChar('\r');
84
	//_sDescription.RemoveFirstChar('\r');
85
	_sDescription.removeFirstSpace();
85
	_sDescription.removeFirstSpace();
86
	_sDescription = _sDescription.findReplace(""", "\"");
86
	_sDescription = _sDescription.findReplace(L""", L"\"");
87
	_sDescription = _sDescription.findReplace(">", ">");
87
	_sDescription = _sDescription.findReplace(L">", L">");
88
	_sDescription = _sDescription.findReplace("&lt;", "<");
88
	_sDescription = _sDescription.findReplace(L"&lt;", L"<");
89
	_sDescription = _sDescription.findReplace("&amp;", "&");
89
	_sDescription = _sDescription.findReplace(L"&amp;", L"&");
90
	_sDescription = _sDescription.findReplace("<newline>", "\n");
90
	_sDescription = _sDescription.findReplace(L"<newline>", L"\n");
91
	_sDescription = _sDescription.findReplace("<br>", "\n");
91
	_sDescription = _sDescription.findReplace(L"<br>", L"\n");
92
 
92
 
93
	if ( _sDescription.left(6).Compare("<html>") ) {
93
	if ( _sDescription.left(6).Compare(L"<html>") ) {
94
		int foundFirst = -1;
94
		int foundFirst = -1;
95
		int pos = 0;
95
		int pos = 0;
96
		while ( foundFirst == -1 )
96
		while ( foundFirst == -1 )
97
		{
97
		{
98
			pos = _sDescription.findPos(">", pos);
98
			pos = _sDescription.findPos(L">", pos);
99
 
99
 
100
			pos++;
100
			pos++;
101
			if ( pos >= (int)_sDescription.length() )
101
			if ( pos >= (int)_sDescription.length() )
102
				break;
102
				break;
103
			char c = _sDescription[pos];
103
			char c = _sDescription[pos];
Line 105... Line 105...
105
			if ( c != '<' )
105
			if ( c != '<' )
106
				foundFirst = pos;
106
				foundFirst = pos;
107
		}
107
		}
108
 
108
 
109
		if ( foundFirst == -1 )
109
		if ( foundFirst == -1 )
110
			_sDescription = "";
110
			_sDescription = L"";
111
		else
111
		else
112
		{
112
		{
113
			Utils::String firstStr = _sDescription.left(foundFirst).findRemove("<br />").findRemove("<br/>");
113
			Utils::WString firstStr = _sDescription.left(foundFirst).findRemove(L"<br />").findRemove(L"<br/>");
114
			Utils::String lastStr = _sDescription.right(_sDescription.length() - foundFirst);
114
			Utils::WString lastStr = _sDescription.right(_sDescription.length() - foundFirst);
115
 
115
 
116
			_sDescription = firstStr + lastStr;
116
			_sDescription = firstStr + lastStr;
117
		}
117
		}
118
	}
118
	}
119
 
119
 
Line 136... Line 136...
136
	_sForumLink		= pPackage->forumLink();
136
	_sForumLink		= pPackage->forumLink();
137
	_sCreationDate	= pPackage->creationDate();
137
	_sCreationDate	= pPackage->creationDate();
138
	_sVersion		= pPackage->version();
138
	_sVersion		= pPackage->version();
139
}
139
}
140
 
140
 
141
void CCorePackage::addAutoExtract(unsigned int game, const Utils::String &dir)
141
void CCorePackage::addAutoExtract(unsigned int game, const Utils::WString &dir)
142
{
142
{
143
	if (!_pAutoExtract)
143
	if (!_pAutoExtract)
144
		_pAutoExtract = new std::map<unsigned int, Utils::String>();
144
		_pAutoExtract = new std::map<unsigned int, Utils::WString>();
145
	(*_pAutoExtract)[game] = dir;
145
	(*_pAutoExtract)[game] = dir;
146
}
146
}
147
 
147
 
148
void CCorePackage::addAutoExport(unsigned int game, const Utils::String &file)
148
void CCorePackage::addAutoExport(unsigned int game, const Utils::WString &file)
149
{
149
{
150
	if (!_pAutoExport)
150
	if (!_pAutoExport)
151
		_pAutoExport = new std::map<unsigned int, Utils::String>();
151
		_pAutoExport = new std::map<unsigned int, Utils::WString>();
152
	(*_pAutoExport)[game] = file;
152
	(*_pAutoExport)[game] = file;
153
}
153
}
154
 
154
 
155
void CCorePackage::clearAutoExport()
155
void CCorePackage::clearAutoExport()
156
{
156
{
Line 212... Line 212...
212
 
212
 
213
///////////////////////////////////////////////////////////////////////////////////////////////
213
///////////////////////////////////////////////////////////////////////////////////////////////
214
//	Install/Uninstall Texts
214
//	Install/Uninstall Texts
215
///////
215
///////
216
 
216
 
217
Utils::String CCorePackage::installText(int iLang, bool bBefore, bool bIncludeDefault) const
217
Utils::WString CCorePackage::installText(int iLang, bool bBefore, bool bIncludeDefault) const
218
{
218
{
219
	return _installText(iLang, bBefore, bIncludeDefault, _pInstallText);
219
	return _installText(iLang, bBefore, bIncludeDefault, _pInstallText);
220
}
220
}
221
 
221
 
222
Utils::String CCorePackage::uninstallText(int iLang, bool bBefore, bool bIncludeDefault) const
222
Utils::WString CCorePackage::uninstallText(int iLang, bool bBefore, bool bIncludeDefault) const
223
{
223
{
224
	return _installText(iLang, bBefore, bIncludeDefault, _pUninstallText);
224
	return _installText(iLang, bBefore, bIncludeDefault, _pUninstallText);
225
}
225
}
226
 
226
 
227
void CCorePackage::addInstallText(int iLang, bool bBefore, const Utils::String &sText) 
227
void CCorePackage::addInstallText(int iLang, bool bBefore, const Utils::WString &sText) 
228
{
228
{
229
	_addInstallText(iLang, bBefore, sText, _pInstallText);
229
	_addInstallText(iLang, bBefore, sText, _pInstallText);
230
}
230
}
231
 
231
 
232
void CCorePackage::addUninstallText(int iLang, bool bBefore, const Utils::String &sText)
232
void CCorePackage::addUninstallText(int iLang, bool bBefore, const Utils::WString &sText)
233
{
233
{
234
	_addInstallText(iLang, bBefore, sText, _pUninstallText);
234
	_addInstallText(iLang, bBefore, sText, _pUninstallText);
235
}
235
}
236
 
236
 
237
void CCorePackage::removeInstallText(int iLang, bool bInstall)
237
void CCorePackage::removeInstallText(int iLang, bool bInstall)
238
{
238
{
239
	if ( bInstall ) _pInstallText->remove(iLang);
239
	if ( bInstall ) _pInstallText->remove(iLang);
240
	else			_pUninstallText->remove(iLang);
240
	else			_pUninstallText->remove(iLang);
241
}
241
}
242
 
242
 
243
Utils::String CCorePackage::_installText(int iLang, bool bBefore, bool bIncludeDefault, const CInstallText *pText) const
243
Utils::WString CCorePackage::_installText(int iLang, bool bBefore, bool bIncludeDefault, const CInstallText *pText) const
244
{
244
{
245
	return (bBefore) ? pText->getBefore(iLang, bIncludeDefault) : pText->getAfter(iLang, bIncludeDefault);
245
	return (bBefore) ? pText->getBefore(iLang, bIncludeDefault) : pText->getAfter(iLang, bIncludeDefault);
246
}
246
}
247
 
247
 
248
void CCorePackage::_addInstallText(int iLang, bool bBefore, const Utils::String &sText, CInstallText *pText)
248
void CCorePackage::_addInstallText(int iLang, bool bBefore, const Utils::WString &sText, CInstallText *pText)
249
{
249
{
250
	if ( bBefore ) pText->addBefore(iLang, sText);
250
	if ( bBefore ) pText->addBefore(iLang, sText);
251
	else pText->addAfter(iLang, sText);
251
	else pText->addAfter(iLang, sText);
252
}
252
}
253
 
253