From acd557f9472c711fe92b9c158ec336abf688bf7b Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Tue, 3 Nov 2009 10:18:25 -0700 Subject: Remove more _SUPPORT ifdefs and do some cleanup --- src/utils/stringutils.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/utils/stringutils.cpp') diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 64d928d6..adcedaa1 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -117,3 +117,20 @@ std::string removeColors(std::string msg) } return msg; } + +int compareStrI(const std::string &a, const std::string &b) +{ + std::string::const_iterator itA = a.begin(); + std::string::const_iterator endA = a.end(); + std::string::const_iterator itB = b.begin(); + std::string::const_iterator endB = b.end(); + + for (; itA < endA, itB < endB; ++itA, ++itB) + { + int comp = tolower(*itA) - tolower(*itB); + if (comp) + return comp; + } + + return 0; +} -- cgit v1.2.3-70-g09d2