added: Patterns class (in templates)
ezc patterns are managed by this class added: some work in groupitem plugin (not finished yet) changed: ConfParser can read a string from memory now (need some testing yet) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@757 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
69
templates/changepatterns.h
Executable file
69
templates/changepatterns.h
Executable file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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();
|
||||
|
||||
|
||||
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
|
Reference in New Issue
Block a user