OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
6 | 6 |
7 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversion_utils.h" | 9 #include "base/strings/utf_string_conversion_utils.h" |
10 | 10 |
| 11 #include <algorithm> |
| 12 #include <vector> |
| 13 |
| 14 void foo() { |
| 15 std::vector<int> a; |
| 16 std::sort(a.begin(), a.end(), [](int a, int b) { return a < b; }); |
| 17 } |
| 18 |
11 namespace base { | 19 namespace base { |
12 | 20 |
13 namespace { | 21 namespace { |
14 | 22 |
15 // Generalized Unicode converter ----------------------------------------------- | 23 // Generalized Unicode converter ----------------------------------------------- |
16 | 24 |
17 // Converts the given source Unicode character type to the given destination | 25 // Converts the given source Unicode character type to the given destination |
18 // Unicode character type as a STL string. The given input buffer and size | 26 // Unicode character type as a STL string. The given input buffer and size |
19 // determine the source, and the given output STL string will be replaced by | 27 // determine the source, and the given output STL string will be replaced by |
20 // the result. | 28 // the result. |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 DCHECK(IsStringASCII(ascii)) << ascii; | 226 DCHECK(IsStringASCII(ascii)) << ascii; |
219 return string16(ascii.begin(), ascii.end()); | 227 return string16(ascii.begin(), ascii.end()); |
220 } | 228 } |
221 | 229 |
222 std::string UTF16ToASCII(const string16& utf16) { | 230 std::string UTF16ToASCII(const string16& utf16) { |
223 DCHECK(IsStringASCII(utf16)) << UTF16ToUTF8(utf16); | 231 DCHECK(IsStringASCII(utf16)) << UTF16ToUTF8(utf16); |
224 return std::string(utf16.begin(), utf16.end()); | 232 return std::string(utf16.begin(), utf16.end()); |
225 } | 233 } |
226 | 234 |
227 } // namespace base | 235 } // namespace base |
OLD | NEW |