mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
Implement: XLineManager::RegisterFactory, UnregisterFactory, GetFactory
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8437 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
3cf7620e91
commit
dcd26f6b56
@ -650,3 +650,37 @@ const char* QLine::Displayable()
|
||||
return nick;
|
||||
}
|
||||
|
||||
bool XLineManager::RegisterFactory(XLineFactory* xlf)
|
||||
{
|
||||
std::map<char, XLineFactory*>::iterator n = line_factory.find(xlf->GetType());
|
||||
|
||||
if (n != line_factory.end())
|
||||
return false;
|
||||
|
||||
line_factory[xlf->GetType()] = xlf;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool XLineManager::UnregisterFactory(XLineFactory* xlf)
|
||||
{
|
||||
std::map<char, XLineFactory*>::iterator n = line_factory.find(xlf->GetType());
|
||||
|
||||
if (n == line_factory.end())
|
||||
return false;
|
||||
|
||||
line_factory.erase(n);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
XLineFactory* XLineManager::GetFactory(const char type)
|
||||
{
|
||||
std::map<char, XLineFactory*>::iterator n = line_factory.find(type);
|
||||
|
||||
if (n != line_factory.end())
|
||||
return NULL;
|
||||
|
||||
return n->second;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user