diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/string_util.h | 5 | ||||
-rw-r--r-- | base/string_util_posix.h | 4 | ||||
-rw-r--r-- | base/string_util_win.h | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/base/string_util.h b/base/string_util.h index 69ac608..8c28f3b 100644 --- a/base/string_util.h +++ b/base/string_util.h @@ -23,6 +23,11 @@ namespace base { // are listed below. These functions are then implemented as inline calls // to the platform-specific equivalents in the platform-specific headers. +// Compare the two strings s1 and s2 without regard to case using +// the current locale; returns 0 if they are equal, 1 if s1 > s2, and -1 if +// s2 > s1 according to a lexicographic comparison. +int strcasecmp(const char* s1, const char* s2); + // Compare up to count characters of s1 and s2 without regard to case using // the current locale; returns 0 if they are equal, 1 if s1 > s2, and -1 if // s2 > s1 according to a lexicographic comparison. diff --git a/base/string_util_posix.h b/base/string_util_posix.h index 3db654c..f9c3597 100644 --- a/base/string_util_posix.h +++ b/base/string_util_posix.h @@ -14,6 +14,10 @@ namespace base { +inline int strcasecmp(const char* string1, const char* string2) { + return ::strcasecmp(string1, string2); +} + inline int strncasecmp(const char* string1, const char* string2, size_t count) { return ::strncasecmp(string1, string2, count); } diff --git a/base/string_util_win.h b/base/string_util_win.h index 6042efd..a8e6e5a 100644 --- a/base/string_util_win.h +++ b/base/string_util_win.h @@ -14,6 +14,10 @@ namespace base { +inline int strcasecmp(const char* s1, const char* s2) { + return _stricmp(s1, s2); +} + inline int strncasecmp(const char* s1, const char* s2, size_t count) { return _strnicmp(s1, s2, count); } |