Files
winix/plugins/groupitem/groups.h
Tomasz Sowa 5b8a9c0108 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
2011-08-25 23:53:49 +00:00

106 lines
1.6 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2011, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_plugins_groupitem_groups
#define headerfile_winix_plugins_groupitem_groups
#include <map>
#include <vector>
#include <string>
namespace GroupItem
{
class Groups
{
public:
/*
adding a new group
this method returns a group index
*/
size_t AddGroup();
/*
adding a new path to the last group
*/
void AddPath(const std::wstring & path);
/*
finding a group which has the specified path
this method returns a group index
if there is not such a path everywhere then group size is returned
*/
size_t Find(const std::wstring & path);
/*
returning how many groups we have
*/
size_t Size();
/*
returning the size of the specified group
*/
size_t GroupSize(size_t group_index);
/*
returning a path of the specified group and position
or en empty string if indexes are out of ranges
*/
const std::wstring & GroupPath(size_t group_index, size_t path_index);
/*
removing all groups
*/
void Clear();
private:
/*
paths_map[L"path_name"] -> group index
*/
typedef std::map<std::wstring, size_t> PathsMap;
PathsMap paths_map;
/*
groups[group_index] -> index in paths_names
the group consists of elements from
groups_tab[groups_index] to groups_tab[groups_index+1] (without the last one)
*/
typedef std::vector<size_t> GroupsTab;
GroupsTab groups_tab;
/*
paths_names
*/
typedef std::vector<const std::wstring*> PathsNames;
PathsNames paths_names;
const std::wstring empty_str;
};
}
#endif