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 #ifndef BASE_STRINGS_UTF_STRING_CONVERSIONS_H_ | 5 #ifndef BASE_STRINGS_UTF_STRING_CONVERSIONS_H_ |
6 #define BASE_STRINGS_UTF_STRING_CONVERSIONS_H_ | 6 #define BASE_STRINGS_UTF_STRING_CONVERSIONS_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/base_export.h" | 12 #include "base/base_export.h" |
11 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
12 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
13 | 15 |
14 namespace base { | 16 namespace base { |
15 | 17 |
16 // These convert between UTF-8, -16, and -32 strings. They are potentially slow, | 18 // These convert between UTF-8, -16, and -32 strings. They are potentially slow, |
17 // so avoid unnecessary conversions. The low-level versions return a boolean | 19 // so avoid unnecessary conversions. The low-level versions return a boolean |
(...skipping 25 matching lines...) Expand all Loading... |
43 // string. | 45 // string. |
44 BASE_EXPORT string16 ASCIIToUTF16(StringPiece ascii); | 46 BASE_EXPORT string16 ASCIIToUTF16(StringPiece ascii); |
45 | 47 |
46 // Converts to 7-bit ASCII by truncating. The result must be known to be ASCII | 48 // Converts to 7-bit ASCII by truncating. The result must be known to be ASCII |
47 // beforehand. | 49 // beforehand. |
48 BASE_EXPORT std::string UTF16ToASCII(StringPiece16 utf16); | 50 BASE_EXPORT std::string UTF16ToASCII(StringPiece16 utf16); |
49 | 51 |
50 } // namespace base | 52 } // namespace base |
51 | 53 |
52 #endif // BASE_STRINGS_UTF_STRING_CONVERSIONS_H_ | 54 #endif // BASE_STRINGS_UTF_STRING_CONVERSIONS_H_ |
OLD | NEW |