2011-08-26 01:53:49 +02:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef headerfile_winix_templates_changepatterns
|
|
|
|
#define headerfile_winix_templates_changepatterns
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include "patterns.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ChangePatterns
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
void SetPatterns(Patterns * ppatterns);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
adding a new pattern
|
|
|
|
if such a pattern exists the method only unmarks the pattern from deleting
|
|
|
|
*/
|
|
|
|
void Add(long mount_dir_id, const std::wstring & old_pattern_name, const std::wstring & new_pattern_name);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
returning a pattern (if exists)
|
|
|
|
can return a null pointer
|
|
|
|
*/
|
|
|
|
Ezc::Pattern * Get(long mount_dir_id, const std::wstring & old_pattern_name, size_t locale_index);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
marking all patterns as ready to delete
|
|
|
|
*/
|
|
|
|
void MarkAllToDelete();
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
delete marked patterns
|
|
|
|
if you have called Add() then such a pattern is not deleted
|
|
|
|
*/
|
|
|
|
void DeleteMarked();
|
|
|
|
|
|
|
|
|
2011-08-27 05:12:33 +02:00
|
|
|
/*
|
|
|
|
deleting all patterns
|
|
|
|
*/
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
|
2011-08-26 01:53:49 +02:00
|
|
|
private:
|
|
|
|
|
|
|
|
Patterns * patterns;
|
|
|
|
|
|
|
|
struct Template
|
|
|
|
{
|
|
|
|
bool to_delete;
|
|
|
|
size_t index; // pattern index in 'patterns' object
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::map<std::wstring, Template> Value;
|
|
|
|
typedef std::map<long, Value> PatTab;
|
|
|
|
PatTab pat_tab;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|