winix/templates/changepatterns.h

82 lines
1.3 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2011-2014, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_templates_changepatterns
#define headerfile_winix_templates_changepatterns
#include <map>
#include "patterns.h"
namespace Winix
{
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();
/*
deleting all patterns
*/
void Clear();
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;
};
} // namespace Winix
#endif