2010-01-28 16:39:01 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2010-01-28 16:39:01 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2012-06-27 01:19:19 +02:00
|
|
|
* Copyright (c) 2010-2012, Tomasz Sowa
|
2010-01-28 16:39:01 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
#ifndef headerfile_winix_templates_localefilter
|
|
|
|
#define headerfile_winix_templates_localefilter
|
2010-01-28 16:39:01 +01:00
|
|
|
|
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
#include "locale.h"
|
2010-01-28 16:39:01 +01:00
|
|
|
#include "ezc.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LocaleFilter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
LocaleFilter();
|
2012-06-27 01:19:19 +02:00
|
|
|
|
|
|
|
// lang_index is an internal index from Locale <0, Size()-1>
|
|
|
|
void Filter(Ezc::Pattern & pattern, const Locale & locale, size_t lang_index);
|
2010-01-28 16:39:01 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void ReadKey();
|
2010-11-21 01:19:17 +01:00
|
|
|
void FilterText(Ezc::Item & item);
|
|
|
|
void Parse(std::wstring & str);
|
2010-01-28 16:39:01 +01:00
|
|
|
|
2010-11-21 01:19:17 +01:00
|
|
|
wchar_t open_mark; // default '{'
|
|
|
|
wchar_t closing_mark; // default '}'
|
2010-01-28 16:39:01 +01:00
|
|
|
|
|
|
|
const Locale * plocale;
|
2011-02-24 18:06:12 +01:00
|
|
|
size_t lang;
|
2010-11-21 01:19:17 +01:00
|
|
|
std::wstring res;
|
|
|
|
std::wstring key;
|
|
|
|
std::wstring value;
|
|
|
|
const wchar_t * pchar;
|
2010-01-28 16:39:01 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|