Moved CUtils::wildcmp() into CString class

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@251 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-05-08 07:51:46 +00:00
parent 1c5981ee6d
commit 0823b27f37
7 changed files with 10 additions and 50 deletions
-38
View File
@@ -370,44 +370,6 @@ void CUtils::PrintStatus(bool bSuccess, const CString& sMessage) {
}
}
bool CUtils::wildcmp(const CString& sWild, const CString& sString) {
// Written by Jack Handy - jakkhandy@hotmail.com
const char *wild = sWild.c_str(), *CString = sString.c_str();
const char *cp = NULL, *mp = NULL;
while ((*CString) && (*wild != '*')) {
if ((*wild != *CString) && (*wild != '?')) {
return false;
}
wild++;
CString++;
}
while (*CString) {
if (*wild == '*') {
if (!*++wild) {
return true;
}
mp = wild;
cp = CString+1;
} else if ((*wild == *CString) || (*wild == '?')) {
wild++;
CString++;
} else {
wild = mp;
CString = cp++;
}
}
while (*wild == '*') {
wild++;
}
return (*wild == 0);
}
CTable::CTable() {}
CTable::~CTable() {
for (unsigned int a = 0; a < size(); a++) {