Added CString::Equals()

This new function can be used to replace the old (CaseCmp() == 0) statements.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1232 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
kroimon
2008-09-30 12:58:34 +00:00
parent 195681d7d7
commit f40b3e78d7
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -186,6 +186,13 @@ int CString::StrCmp(const CString& s, unsigned long uLen) const {
return strcmp(c_str(), s.c_str());
}
bool CString::Equals(const CString& s, bool bCaseSensitive, unsigned long uLen) const {
if (bCaseSensitive)
return (StrCmp(s, uLen) == 0);
else
return (CaseCmp(s, uLen) == 0);
}
bool CString::WildCmp(const CString& sWild, const CString& sString) {
// Written by Jack Handy - jakkhandy@hotmail.com
const char *wild = sWild.c_str(), *CString = sString.c_str();