Subversion Repositories spk

Rev

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

Rev 94 Rev 101
Line 20... Line 20...
20
 
20
 
21
void CTextDB::parseTextFile(int iFromPage, int iToPage, const Utils::String &sFile, int iLang)
21
void CTextDB::parseTextFile(int iFromPage, int iToPage, const Utils::String &sFile, int iLang)
22
{
22
{
23
	// open and read the text file
23
	// open and read the text file
24
	CFileIO File(sFile);
24
	CFileIO File(sFile);
25
	//CyStringList *lines = File.ReadLinesStr();
-
 
26
	if ( File.startRead() ) {
25
	if ( File.startRead() ) {
27
		while ( !File.atEnd() ) {
26
		while ( !File.atEnd() ) {
28
			this->_parseFileLine(iFromPage, iToPage, iLang, File.readEndOfLine());
27
			this->_parseFileLine(iFromPage, iToPage, iLang, File.readEndOfLine());
29
		}
28
		}
30
		File.close();
29
		File.close();
Line 55... Line 54...
55
Utils::String CTextDB::get(int iLang, int iPage, int iID) const
54
Utils::String CTextDB::get(int iLang, int iPage, int iID) const
56
{
55
{
57
	TextListItr itr = m_pTexts->find(_mapID(iLang, iPage, iID));
56
	TextListItr itr = m_pTexts->find(_mapID(iLang, iPage, iID));
58
	if ( itr != m_pTexts->end() ) return _parseText(iLang, itr->second);
57
	if ( itr != m_pTexts->end() ) return _parseText(iLang, itr->second);
59
	return "";	
58
	return "";	
-
 
59
}
-
 
60
 
-
 
61
bool CTextDB::anyTextLoaded() const
-
 
62
{
-
 
63
	return !m_pTexts->empty();
60
}
64
}
61
 
65
 
62
Utils::String CTextDB::_parseText(int iLang, const Utils::String &sText, const Utils::String &sReplace) const
66
Utils::String CTextDB::_parseText(int iLang, const Utils::String &sText, const Utils::String &sReplace) const
63
{
67
{
64
	Utils::String::size_type pos = sReplace.find_first_of(",", 0);
68
	Utils::String::size_type pos = sReplace.find_first_of(",", 0);