Files
winix/templates/indexpatterns.h
Tomasz Sowa ba63c8c661 changed: removed Languages::Land enum
now we set the languages in the config file: option locale_files, sample:
  locale_files = ( en, pl )
it represents the name of locale files (those from locale_dir directory)
renamed config option: locale to locale_default


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@722 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-02-24 17:06:12 +00:00

69 lines
1.5 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_templates_indexpatterns
#define headerfile_winix_templates_indexpatterns
#include <string>
#include <vector>
#include <map>
#include "ezc.h"
#include "misc.h"
#include "localefilter.h"
#include "locale.h"
#include "core/config.h"
class IndexPatterns
{
public:
IndexPatterns();
void SetConfig(Config * pconfig);
void SetEzcFunctions(TemplatesFunctions::EzcFun * fun);
// can return null pointer if there is not such a pattern
Ezc::Pattern * GetPattern(const std::wstring & file, size_t lang);
void AddPattern(const std::wstring & file, Locale & locale, LocaleFilter & locale_filter, bool delete_white);
void AddPatternIfNotExists(const std::wstring & file, Locale & locale, LocaleFilter & locale_filter, bool delete_white);
// adding a file name without reading the pattern
// the pattern will be read during ReloadPatterns()
void AddFileName(const std::wstring & file);
void ReloadPatterns(Locale & locale, LocaleFilter & locale_filter, bool delete_white);
void MarkAllToDelete();
void DeleteMarked();
private:
Config * config;
// can be null (not set directly)
TemplatesFunctions::EzcFun * ezc_fun;
struct Template
{
bool to_delete;
// table[lang]
std::vector<Ezc::Pattern> patterns;
};
typedef std::map<std::wstring, Template> Tab;
Tab tab;
void ReadPattern(Tab::iterator & i, Locale & locale, LocaleFilter & locale_filter, bool delete_white);
};
#endif