diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 01:05:27 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 01:05:27 +0000 |
commit | 7be0e1710c92420e5b15b3d0d1850a09848cf217 (patch) | |
tree | 2e78a8d47b62abcf752b502aeefe3ca01cade638 /base | |
parent | 7912282690d4ec3a0a408af669febb4db0930119 (diff) | |
download | chromium_src-7be0e1710c92420e5b15b3d0d1850a09848cf217.zip chromium_src-7be0e1710c92420e5b15b3d0d1850a09848cf217.tar.gz chromium_src-7be0e1710c92420e5b15b3d0d1850a09848cf217.tar.bz2 |
Retry r16006.
Review URL: http://codereview.chromium.org/113369
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/string_util.cc | 6 | ||||
-rw-r--r-- | base/string_util.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/base/string_util.cc b/base/string_util.cc index 2e6f7b3..3a71ba4 100644 --- a/base/string_util.cc +++ b/base/string_util.cc @@ -734,6 +734,12 @@ bool LowerCaseEqualsASCII(const wchar_t* a_begin, return DoLowerCaseEqualsASCII(a_begin, a_end, b); } +bool EqualsASCII(const string16& a, const StringPiece& b) { + if (a.length() != b.length()) + return false; + return std::equal(b.begin(), b.end(), a.begin()); +} + bool StartsWithASCII(const std::string& str, const std::string& search, bool case_sensitive) { diff --git a/base/string_util.h b/base/string_util.h index c32bef3..84cb6e5 100644 --- a/base/string_util.h +++ b/base/string_util.h @@ -316,6 +316,10 @@ bool LowerCaseEqualsASCII(const wchar_t* a_begin, const wchar_t* a_end, const char* b); +// Performs a case-sensitive string compare. The behavior is undefined if both +// strings are not ASCII. +bool EqualsASCII(const string16& a, const StringPiece& b); + // Returns true if str starts with search, or false otherwise. bool StartsWithASCII(const std::string& str, const std::string& search, |