summaryrefslogtreecommitdiff
path: root/common/str.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/str.cpp')
-rw-r--r--common/str.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/str.cpp b/common/str.cpp
index cb82ada..304cd88 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -194,6 +194,26 @@ int String::CompareNoCase (const char *string) const
return (((int)*ch) - ((int)*string));
}
+int String::CompareNoCase(const char *string, int count) const
+{
+ char c1, c2, *ch = m_pData;
+
+ while (*ch && *string && count)
+ {
+ c1 = tolower (*ch);
+ c2 = tolower (*string);
+
+ if (c1 != c2)
+ return (c1 - c2);
+
+ ch++;
+ string++;
+ count--;
+ }
+
+ return (((int)*ch) - ((int)*string));
+}
+
void String::MakeUpper ()
{
for (char *cp = m_pData; *cp; ++cp)