/* * 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 #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 Value; typedef std::map PatTab; PatTab pat_tab; }; #endif