added: two tables to locales/substitute: smallleters, capitalics

added: locale.ToSmall(wchar_t), locale.ToCapital(wchar_t)
       now we are able to recognize other than ASCII characters
added: static/basic/winix.css with basic styles
removed: [include "item_options.html"] from html templates (fun_cat.html and others)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@760 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-08-29 22:23:54 +00:00
parent b984475e49
commit 8c01b0f6c0
10 changed files with 626 additions and 54 deletions

View File

@@ -89,19 +89,32 @@ public:
// default: false
void UTF8(bool utf);
// substitution characters
// !! w przyszlosci bedzie zmiana nazw tych metod i bedzie ich wiecej
// !! bedzie zmiana do url, do wielkosci liter (male/duze) i moze inne
wchar_t Subst(wchar_t c);
void Subst(std::wstring & str);
// url substitution characters
wchar_t UrlSubst(wchar_t c);
void UrlSubst(std::wstring & str);
// changing to small/capital letters
wchar_t ToSmall(wchar_t c);
void ToSmall(std::wstring & str);
wchar_t ToCapital(wchar_t c);
void ToCapital(std::wstring & str);
private:
// struct to used for substitution
struct SubstItem
{
wchar_t from, to;
bool operator<(const SubstItem & arg) const { return from < arg.from; }
};
void AddLocale(size_t lang);
void ReadFile(const char * dir, const char * dir_def, size_t lang, const char * file);
bool ReadFile(const char * dir, size_t lang, const char * file);
void ReadSubstTable(const char * dir, const char * dir_def);
bool ReadSubstTable(const char * dir);
void CreateSubstVector(std::vector<SubstItem> & vect, const std::wstring & tab1, const std::wstring & tab2);
wchar_t SubstFind(const std::vector<SubstItem> & vect, wchar_t val);
// locale files
// we have at least one item "en"
@@ -115,9 +128,10 @@ private:
// this table has the same size as locale_files (at least one item)
std::vector<ConfParser::Table> loc_tab_multi;
// these tables are used to change url characters
std::wstring subst_original;
std::wstring subst_changeto;
// vectors of characters substitution (sort by 'from')
std::vector<SubstItem> subst_url;
std::vector<SubstItem> subst_smalllet; // changing from small to capital
std::vector<SubstItem> subst_capitallet; // changing from capital to small
ConfParser loc_parser;