Subversion Repositories spk

Rev

Rev 53 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 53 Rev 206
Line 11... Line 11...
11
CInstallText::~CInstallText(void)
11
CInstallText::~CInstallText(void)
12
{
12
{
13
	_lTexts.clear(true);
13
	_lTexts.clear(true);
14
}
14
}
15
 
15
 
16
void CInstallText::add(int iLang, const Utils::String &sBefore, const Utils::String &sAfter)
16
void CInstallText::add(int iLang, const Utils::WString &sBefore, const Utils::WString &sAfter)
17
{
17
{
18
	SInstallText *text = _find(iLang);
18
	SInstallText *text = _find(iLang);
19
	if ( !text ) {
19
	if ( !text ) {
20
	}
20
	}
21
 
21
 
22
	text->sBefore = sBefore;
22
	text->sBefore = sBefore;
23
	text->sAfter = sAfter;
23
	text->sAfter = sAfter;
24
}
24
}
25
 
25
 
26
void CInstallText::addBefore(int iLang, const Utils::String &sBefore)
26
void CInstallText::addBefore(int iLang, const Utils::WString &sBefore)
27
{
27
{
28
	SInstallText *text = _find(iLang);
28
	SInstallText *text = _find(iLang);
29
	if ( !text ) text = _new(iLang);
29
	if ( !text ) text = _new(iLang);
30
	text->sBefore = sBefore;
30
	text->sBefore = sBefore;
31
}
31
}
32
 
32
 
33
void CInstallText::addAfter(int iLang, const Utils::String &sAfter)
33
void CInstallText::addAfter(int iLang, const Utils::WString &sAfter)
34
{
34
{
35
	SInstallText *text = _find(iLang);
35
	SInstallText *text = _find(iLang);
36
	if ( !text ) text = _new(iLang);
36
	if ( !text ) text = _new(iLang);
37
	text->sAfter = sAfter;
37
	text->sAfter = sAfter;
38
}
38
}
Line 46... Line 46...
46
void CInstallText::removeBefore(int iLang)
46
void CInstallText::removeBefore(int iLang)
47
{
47
{
48
	SInstallText *text = _find(iLang);
48
	SInstallText *text = _find(iLang);
49
	if ( text ) {
49
	if ( text ) {
50
		if ( text->sAfter.empty() ) remove(iLang);
50
		if ( text->sAfter.empty() ) remove(iLang);
51
		else text->sBefore = "";
51
		else text->sBefore = L"";
52
	}
52
	}
53
}
53
}
54
 
54
 
55
void CInstallText::removeAfter(int iLang)
55
void CInstallText::removeAfter(int iLang)
56
{
56
{
57
	SInstallText *text = _find(iLang);
57
	SInstallText *text = _find(iLang);
58
	if ( text ) {
58
	if ( text ) {
59
		if ( text->sBefore.empty() ) remove(iLang);
59
		if ( text->sBefore.empty() ) remove(iLang);
60
		else text->sAfter = "";
60
		else text->sAfter = L"";
61
	}
61
	}
62
}
62
}
63
 
63
 
64
Utils::String CInstallText::getBefore(int iLang, bool bIncludeDefault) const
64
Utils::WString CInstallText::getBefore(int iLang, bool bIncludeDefault) const
65
{
65
{
66
	SInstallText *text = _find(iLang);
66
	SInstallText *text = _find(iLang);
67
	if ( !text && bIncludeDefault ) text = _default();
67
	if ( !text && bIncludeDefault ) text = _default();
68
	if ( text ) return text->sBefore;
68
	if ( text ) return text->sBefore;
69
	return "";
69
	return L"";
70
}
70
}
71
 
71
 
72
Utils::String CInstallText::getAfter(int iLang, bool bIncludeDefault) const
72
Utils::WString CInstallText::getAfter(int iLang, bool bIncludeDefault) const
73
{
73
{
74
	SInstallText *text = _find(iLang);
74
	SInstallText *text = _find(iLang);
75
	if ( !text && bIncludeDefault ) text = _default();
75
	if ( !text && bIncludeDefault ) text = _default();
76
	if ( text ) return text->sAfter;
76
	if ( text ) return text->sAfter;
77
	return "";
77
	return L"";
78
}
78
}
79
 
79
 
80
bool CInstallText::any() const
80
bool CInstallText::any() const
81
{
81
{
82
	return !_lTexts.empty();
82
	return !_lTexts.empty();