now winix is using 'pikotools' (confparser, utf8, mainparser)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@792 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010-2011, Tomasz Sowa
|
||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <algorithm>
|
||||
#include "locale.h"
|
||||
#include "core/log.h"
|
||||
#include "utf8.h"
|
||||
#include "utf8/utf8.h"
|
||||
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ bool read = false;
|
||||
loc_parser.UTF8(input_as_utf8);
|
||||
loc_parser.SetSpace(space);
|
||||
|
||||
if( loc_parser.Parse(file_name) == ConfParser::ok )
|
||||
if( loc_parser.Parse(file_name) == PT::ConfParser::ok )
|
||||
{
|
||||
read = true;
|
||||
AddLocale(lang);
|
||||
@@ -86,14 +86,14 @@ return read;
|
||||
|
||||
void Locale::AddLocale(size_t lang)
|
||||
{
|
||||
Space::TableSingle::iterator i = space.table_single.begin();
|
||||
PT::Space::TableSingle::iterator i = space.table_single.begin();
|
||||
|
||||
for( ; i != space.table_single.end() ; ++i)
|
||||
loc_tab[lang][i->first] = i->second;
|
||||
|
||||
|
||||
// lists
|
||||
Space::Table::iterator i2 = space.table.begin();
|
||||
PT::Space::Table::iterator i2 = space.table.begin();
|
||||
|
||||
for( ; i2 != space.table.end() ; ++i2)
|
||||
loc_tab_multi[lang][i2->first] = i2->second;
|
||||
@@ -130,7 +130,7 @@ bool read = false;
|
||||
loc_parser.SplitSingle(true);
|
||||
loc_parser.UTF8(input_as_utf8);
|
||||
|
||||
if( loc_parser.Parse(file_name) == ConfParser::ok )
|
||||
if( loc_parser.Parse(file_name) == PT::ConfParser::ok )
|
||||
{
|
||||
read = true;
|
||||
CreateSubstVector(subst_url, space.table_single[L"url_original"], space.table_single[L"url_changeto"]);
|
||||
@@ -171,7 +171,7 @@ void Locale::Read(const char * dir, const char * dir_def)
|
||||
{
|
||||
for(size_t i=0 ; i<locale_files.size() ; ++i)
|
||||
{
|
||||
Ezc::WideToUTF8(locale_files[i], locale_filea);
|
||||
PT::WideToUTF8(locale_files[i], locale_filea);
|
||||
ReadFile(dir, dir_def, i, locale_filea.c_str());
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ void Locale::Read(const std::string & dir, const std::string & dir_def)
|
||||
|
||||
void Locale::Read(const wchar_t * dir, const wchar_t * dir_def)
|
||||
{
|
||||
Ezc::WideToUTF8(dir, adir1);
|
||||
PT::WideToUTF8(dir, adir1);
|
||||
|
||||
if( !dir_def )
|
||||
{
|
||||
@@ -198,7 +198,7 @@ void Locale::Read(const wchar_t * dir, const wchar_t * dir_def)
|
||||
}
|
||||
else
|
||||
{
|
||||
Ezc::WideToUTF8(dir_def, adir2);
|
||||
PT::WideToUTF8(dir_def, adir2);
|
||||
Read(adir1.c_str(), adir2.c_str());
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ bool Locale::IsKey(const std::wstring & key, size_t lang) const
|
||||
return false;
|
||||
|
||||
// looking in the 'lang' language
|
||||
Space::TableSingle::const_iterator i = loc_tab[lang].find(key);
|
||||
PT::Space::TableSingle::const_iterator i = loc_tab[lang].find(key);
|
||||
|
||||
if( i != loc_tab[lang].end() )
|
||||
return true;
|
||||
@@ -312,7 +312,7 @@ bool Locale::IsKeyLang(const std::wstring & key, size_t lang) const
|
||||
return false;
|
||||
|
||||
// looking in the 'lang' language
|
||||
Space::TableSingle::const_iterator i = loc_tab[lang].find(key);
|
||||
PT::Space::TableSingle::const_iterator i = loc_tab[lang].find(key);
|
||||
|
||||
return i != loc_tab[lang].end();
|
||||
}
|
||||
@@ -347,7 +347,7 @@ const std::wstring & Locale::Get(const std::wstring & key, size_t lang) const
|
||||
return empty;
|
||||
|
||||
// looking in the 'lang' language
|
||||
Space::TableSingle::const_iterator i = loc_tab[lang].find(key);
|
||||
PT::Space::TableSingle::const_iterator i = loc_tab[lang].find(key);
|
||||
|
||||
if( i != loc_tab[lang].end() )
|
||||
return i->second;
|
||||
@@ -384,7 +384,7 @@ bool Locale::IsKeyLangList(const std::wstring & key, size_t lang) const
|
||||
return false;
|
||||
|
||||
// looking in the 'lang' language
|
||||
Space::Table::const_iterator i = loc_tab_multi[lang].find(key);
|
||||
PT::Space::Table::const_iterator i = loc_tab_multi[lang].find(key);
|
||||
|
||||
return i != loc_tab_multi[lang].end();
|
||||
}
|
||||
@@ -402,7 +402,7 @@ const std::vector<std::wstring> & Locale::GetList(const std::wstring & key, size
|
||||
return empty_list;
|
||||
|
||||
// looking in the 'lang' language
|
||||
Space::Table::const_iterator i = loc_tab_multi[lang].find(key);
|
||||
PT::Space::Table::const_iterator i = loc_tab_multi[lang].find(key);
|
||||
|
||||
if( i != loc_tab_multi[lang].end() )
|
||||
return i->second;
|
||||
|
Reference in New Issue
Block a user