| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/i18n/case_conversion.h" | 5 #include "base/i18n/case_conversion.h" |
| 6 | 6 |
| 7 #include "base/string16.h" |
| 7 #include "unicode/unistr.h" | 8 #include "unicode/unistr.h" |
| 8 | 9 |
| 9 namespace base { | 10 namespace base { |
| 10 namespace i18n { | 11 namespace i18n { |
| 11 | 12 |
| 12 string16 ToLower(const string16& string) { | 13 string16 ToLower(const StringPiece16& string) { |
| 13 icu::UnicodeString unicode_string(string.c_str(), string.size()); | 14 icu::UnicodeString unicode_string(string.data(), string.size()); |
| 14 unicode_string.toLower(); | 15 unicode_string.toLower(); |
| 15 return string16(unicode_string.getBuffer(), unicode_string.length()); | 16 return string16(unicode_string.getBuffer(), unicode_string.length()); |
| 16 } | 17 } |
| 17 | 18 |
| 18 string16 ToUpper(const string16& string) { | 19 string16 ToUpper(const StringPiece16& string) { |
| 19 icu::UnicodeString unicode_string(string.c_str(), string.size()); | 20 icu::UnicodeString unicode_string(string.data(), string.size()); |
| 20 unicode_string.toUpper(); | 21 unicode_string.toUpper(); |
| 21 return string16(unicode_string.getBuffer(), unicode_string.length()); | 22 return string16(unicode_string.getBuffer(), unicode_string.length()); |
| 22 } | 23 } |
| 23 | 24 |
| 24 } // namespace i18n | 25 } // namespace i18n |
| 25 } // namespace base | 26 } // namespace base |
| OLD | NEW |