Subversion Repositories spk

Rev

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

Rev 122 Rev 197
Line 2... Line 2...
2
#define __LANGUAGES_H__
2
#define __LANGUAGES_H__
3
 
3
 
4
#include "Utils\String.h"
4
#include "Utils\WString.h"
5
#include <map>
5
#include <map>
6
#include <vector>
6
#include <vector>
7
 
7
 
8
enum Lang_Section 
8
enum Lang_Section 
9
{ 
9
{ 
Line 24... Line 24...
24
enum Lang_Directory
24
enum Lang_Directory
25
{
25
{
26
	LANGDIR_TITLE	 = 1,
26
	LANGDIR_TITLE	 = 1,
27
};
27
};
28
 
28
 
29
typedef std::map<int, Utils::String> LangPage;
29
typedef std::map<int, Utils::WString> LangPage;
30
typedef std::map<int, LangPage> LangPages;
30
typedef std::map<int, LangPage> LangPages;
31
typedef std::map<int, LangPages> LangTexts;
31
typedef std::map<int, LangPages> LangTexts;
32
 
32
 
33
class SPKEXPORT CLanguages
33
class SPKEXPORT CLanguages
34
{
34
{
35
public:
35
public:
36
	static CLanguages *Instance();
36
	static CLanguages *Instance();
37
	static void Release();
37
	static void Release();
38
 
38
 
39
	void SetLanguage(int lang);
39
	void setLanguage(int lang);
40
 
40
 
41
	Utils::String findText(int section, int id);
41
	Utils::WString findText(int section, int id);
42
 
42
 
43
protected:
43
protected:
44
	CLanguages();
44
	CLanguages();
45
	~CLanguages();
45
	~CLanguages();
46
 
46
 
47
private:
47
private:
48
	void DEBUG_AddDefaultTexts();
48
	void DEBUG_AddDefaultTexts();
49
 
49
 
50
	LangPages *_findLanguageText(int id = -1) const;
50
	LangPages *_findLanguageText(int id = -1) const;
51
	Utils::String _error(int section, int id) const;
51
	Utils::WString _error(int section, int id) const;
52
	bool _findText(LangPages *texts, int section, int id, Utils::String *out) const;
52
	bool _findText(LangPages *texts, int section, int id, Utils::WString *out) const;
53
 
53
 
54
private:
54
private:
55
	static CLanguages *_pInstance;
55
	static CLanguages *_pInstance;
56
 
56
 
57
	int			_iLanguage;
57
	int			_iLanguage;