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 #ifndef BASE_I18N_RTL_H_ | 5 #ifndef BASE_I18N_RTL_H_ |
6 #define BASE_I18N_RTL_H_ | 6 #define BASE_I18N_RTL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "base/compiler_specific.h" |
9 #include "base/string16.h" | 10 #include "base/string16.h" |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 | 12 |
12 class FilePath; | 13 class FilePath; |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 namespace i18n { | 16 namespace i18n { |
16 | 17 |
17 const char16 kRightToLeftMark = 0x200F; | 18 const char16 kRightToLeftMark = 0x200F; |
18 const char16 kLeftToRightMark = 0x200E; | 19 const char16 kLeftToRightMark = 0x200E; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Wraps file path to get it to display correctly in RTL UI. All filepaths | 129 // Wraps file path to get it to display correctly in RTL UI. All filepaths |
129 // should be passed through this function before display in UI for RTL locales. | 130 // should be passed through this function before display in UI for RTL locales. |
130 void WrapPathWithLTRFormatting(const FilePath& path, | 131 void WrapPathWithLTRFormatting(const FilePath& path, |
131 string16* rtl_safe_path); | 132 string16* rtl_safe_path); |
132 | 133 |
133 // Given the string in |text|, this function returns the adjusted string having | 134 // Given the string in |text|, this function returns the adjusted string having |
134 // LTR directionality for display purpose. Which means that in RTL locale the | 135 // LTR directionality for display purpose. Which means that in RTL locale the |
135 // string is wrapped with LRE (Left-To-Right Embedding) and PDF (Pop | 136 // string is wrapped with LRE (Left-To-Right Embedding) and PDF (Pop |
136 // Directional Formatting) marks and returned. In LTR locale, the string itself | 137 // Directional Formatting) marks and returned. In LTR locale, the string itself |
137 // is returned. | 138 // is returned. |
138 std::wstring GetDisplayStringInLTRDirectionality(std::wstring* text); | 139 string16 GetDisplayStringInLTRDirectionality(const string16& text) |
| 140 WARN_UNUSED_RESULT; |
139 | 141 |
140 // Strip the beginning (U+202A..U+202B, U+202D..U+202E) and/or ending (U+202C) | 142 // Strip the beginning (U+202A..U+202B, U+202D..U+202E) and/or ending (U+202C) |
141 // explicit bidi control characters from |text|, if there are any. Otherwise, | 143 // explicit bidi control characters from |text|, if there are any. Otherwise, |
142 // return the text itself. Explicit bidi control characters display and have | 144 // return the text itself. Explicit bidi control characters display and have |
143 // semantic effect. They can be deleted so they might not always appear in a | 145 // semantic effect. They can be deleted so they might not always appear in a |
144 // pair. | 146 // pair. |
145 const string16 StripWrappingBidiControlCharacters(const string16& text); | 147 const string16 StripWrappingBidiControlCharacters(const string16& text) |
| 148 WARN_UNUSED_RESULT; |
146 | 149 |
147 } // namespace i18n | 150 } // namespace i18n |
148 } // namespace base | 151 } // namespace base |
149 | 152 |
150 #endif // BASE_I18N_RTL_H_ | 153 #endif // BASE_I18N_RTL_H_ |
OLD | NEW |