]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add XLineManager::DelAll to delete all lines of a given type.
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 12 Jul 2008 10:53:31 +0000 (10:53 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 12 Jul 2008 10:53:31 +0000 (10:53 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9975 e03df62e-2008-0410-955e-edbf42e46eb7

include/xline.h
src/xline.cpp

index d1fe0e8826fb29b33de789b44b00669b95754a0d..4be5922d096543e6a095193696165297f06279a8 100644 (file)
@@ -517,6 +517,10 @@ class CoreExport XLineManager : public classbase
         */
        XLineLookup* GetAll(const std::string &type);
 
+       /** Remove all lines of a certain type.
+        */
+       void DelAll(const std::string &type);
+
        /** Return all known types of line currently stored by the XLineManager.
         * @return A vector containing all known line types currently stored in the main list.
         */
index 5d5a95516b27ec8e3a998c3d9d6b3610163f437e..0878ec286e5c412bde4d87bd66d4d74ab5b8c0d8 100644 (file)
@@ -116,6 +116,22 @@ XLineLookup* XLineManager::GetAll(const std::string &type)
        return &(n->second);
 }
 
+void XLineManager::DelAll(const std::string &type)
+{
+       ContainerIter n = lookup_lines.find(type);
+
+       if (n == lookup_lines.end())
+               return;
+
+       LookupIter x;
+
+       /* Delete all of a given type (this should probably use DelLine, but oh well) */
+       while ((x = n->second.begin()) != n->second.end())
+       {
+               ExpireLine(n, x);
+       }
+}
+
 std::vector<std::string> XLineManager::GetAllTypes()
 {
        std::vector<std::string> items;