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