OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/utf_offset_string_conversions.h" | 5 #include <stddef.h> |
| 6 #include <string> |
6 | 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/string16.h" |
7 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
8 #include "base/utf_string_conversion_utils.h" | 11 #include "base/utf_string_conversion_utils.h" |
| 12 #include "build/build_config.h" |
9 | 13 |
10 using base::PrepareForUTF16Or32Output; | 14 using base::PrepareForUTF16Or32Output; |
11 using base::ReadUnicodeCharacter; | 15 using base::ReadUnicodeCharacter; |
12 using base::WriteUnicodeCharacter; | 16 using base::WriteUnicodeCharacter; |
13 | 17 |
14 // Generalized Unicode converter ----------------------------------------------- | 18 // Generalized Unicode converter ----------------------------------------------- |
15 | 19 |
16 // Converts the given source Unicode character type to the given destination | 20 // Converts the given source Unicode character type to the given destination |
17 // Unicode character type as a STL string. The given input buffer and size | 21 // Unicode character type as a STL string. The given input buffer and size |
18 // determine the source, and the given output STL string will be replaced by | 22 // determine the source, and the given output STL string will be replaced by |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 116 |
113 std::wstring UTF16ToWideAndAdjustOffset(const string16& utf16, | 117 std::wstring UTF16ToWideAndAdjustOffset(const string16& utf16, |
114 size_t* offset_for_adjustment) { | 118 size_t* offset_for_adjustment) { |
115 std::wstring ret; | 119 std::wstring ret; |
116 UTF16ToWideAndAdjustOffset(utf16.data(), utf16.length(), &ret, | 120 UTF16ToWideAndAdjustOffset(utf16.data(), utf16.length(), &ret, |
117 offset_for_adjustment); | 121 offset_for_adjustment); |
118 return ret; | 122 return ret; |
119 } | 123 } |
120 | 124 |
121 #endif // defined(WCHAR_T_IS_UTF32) | 125 #endif // defined(WCHAR_T_IS_UTF32) |
OLD | NEW |