78 lines
1.1 KiB
C++
Executable File
78 lines
1.1 KiB
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2010-2011, 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 "patterns.h"
|
|
|
|
|
|
|
|
class IndexPatterns
|
|
{
|
|
public:
|
|
|
|
void SetPatterns(Patterns * ppatterns);
|
|
|
|
|
|
/*
|
|
adding a new pattern
|
|
if such a pattern exists the method only unmarks the pattern from deleting
|
|
*/
|
|
void Add(const std::wstring & file);
|
|
|
|
|
|
/*
|
|
returning a pattern
|
|
can return null pointer if there is not such a pattern
|
|
*/
|
|
Ezc::Pattern * Get(const std::wstring & file, size_t lang);
|
|
|
|
|
|
/*
|
|
marking all patterns as ready to delete
|
|
*/
|
|
void MarkAllToDelete();
|
|
|
|
|
|
/*
|
|
delete marked patterns
|
|
if you have called Add(pattern_name) then such a pattern is not deleted
|
|
*/
|
|
void DeleteMarked();
|
|
|
|
|
|
/*
|
|
deleting all patterns
|
|
*/
|
|
void Clear();
|
|
|
|
|
|
private:
|
|
|
|
Patterns * patterns;
|
|
|
|
struct Template
|
|
{
|
|
bool to_delete;
|
|
size_t index;
|
|
};
|
|
|
|
typedef std::map<std::wstring, Template> Tab;
|
|
Tab tab;
|
|
|
|
};
|
|
|
|
|
|
#endif
|