added: function adduser
changed: errors (removed enum, there are macros now) added: error messages to locales (winix_err_NN) removed: templates: err_abuse.html err_others.html git-svn-id: svn://ttmath.org/publicrep/winix/trunk@593 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
@@ -37,9 +37,12 @@ public:
|
||||
Iterator End();
|
||||
SizeType Size();
|
||||
bool Empty();
|
||||
Iterator PushBack(const Type & type);
|
||||
Iterator PushBack(const Type & type); // can return End() if the user already exists
|
||||
void Clear();
|
||||
|
||||
bool Is(long id);
|
||||
bool Is(const std::string & name);
|
||||
|
||||
Iterator FindId(long id);
|
||||
Iterator FindName(const std::string & name);
|
||||
|
||||
@@ -102,6 +105,9 @@ bool UGContainer<Type>::Empty()
|
||||
template<class Type>
|
||||
typename UGContainer<Type>::Iterator UGContainer<Type>::PushBack(const Type & type)
|
||||
{
|
||||
if( Is(type.id) || Is(type.name) )
|
||||
return End();
|
||||
|
||||
table.push_back(type);
|
||||
log << log2 << "UGCont: added, id: " << type.id << ", name: " << type.name << logend;
|
||||
|
||||
@@ -122,6 +128,31 @@ void UGContainer<Type>::Clear()
|
||||
|
||||
|
||||
|
||||
template<class Type>
|
||||
bool UGContainer<Type>::Is(long id)
|
||||
{
|
||||
typename TableId::iterator i = table_id.find(id);
|
||||
|
||||
if( i == table_id.end() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
bool UGContainer<Type>::Is(const std::string & name)
|
||||
{
|
||||
typename TableName::iterator i = table_name.find(name);
|
||||
|
||||
if( i == table_name.end() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class Type>
|
||||
typename UGContainer<Type>::Iterator UGContainer<Type>::FindId(long id)
|
||||
{
|
||||
|
Reference in New Issue
Block a user