2008-12-21 22:17:09 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2008-12-21 22:17:09 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2012-03-09 03:36:25 +01:00
|
|
|
* Copyright (c) 2008-2012, Tomasz Sowa
|
2008-12-21 22:17:09 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
#ifndef headerfile_winix_core_groups
|
|
|
|
#define headerfile_winix_core_groups
|
2008-12-21 22:17:09 +01:00
|
|
|
|
|
|
|
#include <map>
|
2009-04-21 22:50:55 +02:00
|
|
|
|
2008-12-21 22:17:09 +01:00
|
|
|
#include "group.h"
|
|
|
|
#include "ugcontainer.h"
|
2010-09-18 02:51:12 +02:00
|
|
|
#include "db/db.h"
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2008-12-21 22:17:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Groups
|
|
|
|
{
|
|
|
|
typedef UGContainer<Group> Table;
|
|
|
|
|
|
|
|
Table table;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
typedef Table::Iterator Iterator;
|
|
|
|
typedef Table::SizeType SizeType;
|
|
|
|
|
|
|
|
Groups();
|
|
|
|
void Clear();
|
2010-08-10 18:12:50 +02:00
|
|
|
void ReadGroups(Db * db);
|
2008-12-21 22:17:09 +01:00
|
|
|
Group * GetGroup(long group_id);
|
2010-11-21 01:19:17 +01:00
|
|
|
Group * GetGroup(const std::wstring & name);
|
|
|
|
long GetGroupId(const std::wstring & name);
|
2008-12-21 22:17:09 +01:00
|
|
|
Iterator Begin();
|
|
|
|
Iterator End();
|
|
|
|
SizeType Size();
|
2012-03-09 03:36:25 +01:00
|
|
|
bool Remove(long group_id);
|
2008-12-21 22:17:09 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|