mirror of
https://github.com/znc/znc.git
synced 2026-08-06 08:52:57 +02:00
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:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user