diff options
author | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-09-08 17:55:52 +0000 |
---|---|---|
committer | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-09-08 17:55:52 +0000 |
commit | a2b1a8556ea64014606d78b09333d9c522430a25 (patch) | |
tree | a4f4a88d89b4f957655a479bba3f33908572fcb5 /include/gtest/internal/gtest-string.h | |
parent | 0c5a66245b8c5939b36b2aad6f4d5ab89b724b1a (diff) | |
download | googletest-a2b1a8556ea64014606d78b09333d9c522430a25.tar.gz googletest-a2b1a8556ea64014606d78b09333d9c522430a25.tar.bz2 googletest-a2b1a8556ea64014606d78b09333d9c522430a25.zip |
Adds support for type-parameterized tests (by Zhanyong Wan); also adds case-insensitive wide string comparison to the String class (by Vlad Losev).
Diffstat (limited to 'include/gtest/internal/gtest-string.h')
-rw-r--r-- | include/gtest/internal/gtest-string.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-string.h b/include/gtest/internal/gtest-string.h index 612b6cef..b37ff4f4 100644 --- a/include/gtest/internal/gtest-string.h +++ b/include/gtest/internal/gtest-string.h @@ -167,6 +167,21 @@ class String { static bool CaseInsensitiveCStringEquals(const char* lhs, const char* rhs); + // Compares two wide C strings, ignoring case. Returns true iff they + // have the same content. + // + // Unlike wcscasecmp(), this function can handle NULL argument(s). + // A NULL C string is considered different to any non-NULL wide C string, + // including the empty string. + // NB: The implementations on different platforms slightly differ. + // On windows, this method uses _wcsicmp which compares according to LC_CTYPE + // environment variable. On GNU platform this method uses wcscasecmp + // which compares according to LC_CTYPE category of the current locale. + // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the + // current locale. + static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, + const wchar_t* rhs); + // Formats a list of arguments to a String, using the same format // spec string as for printf. // @@ -218,6 +233,10 @@ class String { return CStringEquals(c_str_, c_str); } + // Returns true iff this String is less than the given C string. A NULL + // string is considered less than "". + bool operator<(const String& rhs) const { return Compare(rhs) < 0; } + // Returns true iff this String doesn't equal the given C string. A NULL // string and a non-NULL string are considered not equal. bool operator!=(const char* c_str) const { |