diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-16 12:31:26 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-16 12:31:26 +0000 |
commit | 9b742fbb3a44c7185d94e827b7573d552b9794ec (patch) | |
tree | f79f6894c93a89a0671e6a2ea876a9b4edc5ef9b /base/string_util.h | |
parent | 489199b97c93c1d9d3e82a7bf78b818cd87c4fc2 (diff) | |
download | chromium_src-9b742fbb3a44c7185d94e827b7573d552b9794ec.zip chromium_src-9b742fbb3a44c7185d94e827b7573d552b9794ec.tar.gz chromium_src-9b742fbb3a44c7185d94e827b7573d552b9794ec.tar.bz2 |
Move ToUpperASCII into base namespace, to make it consistent with ToLowerASCII
This mirrors the change made in http://src.chromium.org/viewvc/chrome?view=rev&revision=64879
BUG=None
TEST=everything builds; base unit tests pass
Review URL: http://codereview.chromium.org/5007001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.h')
-rw-r--r-- | base/string_util.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/base/string_util.h b/base/string_util.h index 5466403..498ccc5 100644 --- a/base/string_util.h +++ b/base/string_util.h @@ -122,6 +122,12 @@ template <class Char> inline Char ToLowerASCII(Char c) { return (c >= 'A' && c <= 'Z') ? (c + ('a' - 'A')) : c; } +// ASCII-specific toupper. The standard library's toupper is locale sensitive, +// so we don't want to use it here. +template <class Char> inline Char ToUpperASCII(Char c) { + return (c >= 'a' && c <= 'z') ? (c + ('A' - 'a')) : c; +} + // Function objects to aid in comparing/searching strings. template<typename Char> struct CaseInsensitiveCompare { @@ -295,17 +301,11 @@ template <class str> inline str StringToLowerASCII(const str& s) { return output; } -// ASCII-specific toupper. The standard library's toupper is locale sensitive, -// so we don't want to use it here. -template <class Char> inline Char ToUpperASCII(Char c) { - return (c >= 'a' && c <= 'z') ? (c + ('A' - 'a')) : c; -} - // Converts the elements of the given string. This version uses a pointer to // clearly differentiate it from the non-pointer variant. template <class str> inline void StringToUpperASCII(str* s) { for (typename str::iterator i = s->begin(); i != s->end(); ++i) - *i = ToUpperASCII(*i); + *i = base::ToUpperASCII(*i); } template <class str> inline str StringToUpperASCII(const str& s) { |