Subversion Repositories spk

Rev

Rev 46 | Rev 50 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
46 cycrow 1
#pragma once
2
 
3
#include "Utils/String.h"
4
#include "lists.h"
5
 
6
namespace SPK {
7
namespace Package {
8
 
9
class SPKEXPORT CInstallText
10
{
48 cycrow 11
private:
46 cycrow 12
	typedef struct SInstallText {
13
		int				iLanguage;
14
		Utils::String	sBefore;
15
		Utils::String	sAfter;
16
	} SInstallText;
17
 
48 cycrow 18
public:
19
	typedef CLinkList<SInstallText> TextList;
20
	typedef CListNode<SInstallText>* TextNode;
21
 
46 cycrow 22
	friend class CInstallText;
23
 
24
private:
48 cycrow 25
	TextList _lTexts;
46 cycrow 26
 
27
public:
28
	CInstallText(void);
29
	virtual ~CInstallText(void);
30
 
31
	void add(int iLang, const Utils::String &sBefore, const Utils::String &sAfter);
32
	void addBefore(int iLang, const Utils::String &sBefore);
33
	void addAfter(int iLang, const Utils::String &sAfter);
34
 
35
	void remove(int iLang);
36
	void removeBefore(int iLang);
37
	void removeAfter(int iLang);
38
 
39
	Utils::String getBefore(int iLang, bool bIncludeDefault = true) const;
40
	Utils::String getAfter(int iLang, bool bIncludeDefault = true) const;
41
	bool	any() const;
42
 
43
	void merge(const CInstallText *pText);
44
	unsigned int count() const;
45
	int language(unsigned int iPos) const;
46
 
47
private:
48
	SInstallText *_find(int iLang) const;
49
	SInstallText *_new(int iLang);
50
 
51
	void _purge();
52
	SInstallText *_default() const;
53
	SInstallText *_getAt(int iIdx) const;
54
};
55
 
56
}}//NAMESPACE