Subversion Repositories spk

Rev

Rev 35 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
35 cycrow 1
#pragma once
2
 
3
#include <map>
4
#include "Utils/String.h"
5
 
6
namespace SPK {
7
class CTextDB
8
{
9
public:
10
	typedef std::map<std::string, std::string> TextList;
11
	typedef std::map<std::string, std::string>::iterator TextListItr;
12
 
13
private:
14
	int			 m_iLang;
15
	int			 m_iInPage;
16
	TextList	*m_pTexts;
17
 
18
public:
19
	CTextDB(void);
20
	virtual ~CTextDB(void);
21
 
22
	void parseTextFile(int iFromPage, int iToPage, const Utils::String &sFile, int iLang);
23
	Utils::String get(int iLang, int iPage, int iID) const;
24
	bool exists(int iLang, int iPage, int iID) const;
25
	Utils::String get(int iPage, int iID) const;
26
	bool exists(int iPage, int iID) const;
27
 
28
	void setLanguage(int iLang);
29
 
30
private:
31
	Utils::String _parseText(int iLang, const Utils::String &sText, const Utils::String &sReplace) const;
32
	Utils::String _parseText(int iLang, const Utils::String &sText) const;
33
	void _parsePage(int iLang, const Utils::String &sLine);
34
	void _parseFileLine(int iFromPage, int iToPage, int iLang, const Utils::String &sLine);
35
	void _addText(int iLang, int iID, const Utils::String &sText);
36
	Utils::String _mapID(int iLang, int iPage, int iID) const;
37
};
38
 
39
} //NAMESPACE