| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_STRING16_H_ | 5 #ifndef BASE_STRING16_H_ |
| 6 #define BASE_STRING16_H_ | 6 #define BASE_STRING16_H_ |
| 7 #pragma once | |
| 8 | 7 |
| 9 // WHAT: | 8 // WHAT: |
| 10 // A version of std::basic_string that provides 2-byte characters even when | 9 // A version of std::basic_string that provides 2-byte characters even when |
| 11 // wchar_t is not implemented as a 2-byte type. You can access this class as | 10 // wchar_t is not implemented as a 2-byte type. You can access this class as |
| 12 // string16. We also define char16, which string16 is based upon. | 11 // string16. We also define char16, which string16 is based upon. |
| 13 // | 12 // |
| 14 // WHY: | 13 // WHY: |
| 15 // On Windows, wchar_t is 2 bytes, and it can conveniently handle UTF-16/UCS-2 | 14 // On Windows, wchar_t is 2 bytes, and it can conveniently handle UTF-16/UCS-2 |
| 16 // data. Plenty of existing code operates on strings encoded as UTF-16. | 15 // data. Plenty of existing code operates on strings encoded as UTF-16. |
| 17 // | 16 // |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 BASE_EXPORT extern std::ostream& operator<<(std::ostream& out, | 172 BASE_EXPORT extern std::ostream& operator<<(std::ostream& out, |
| 174 const string16& str); | 173 const string16& str); |
| 175 | 174 |
| 176 // This is required by googletest to print a readable output on test failures. | 175 // This is required by googletest to print a readable output on test failures. |
| 177 BASE_EXPORT extern void PrintTo(const string16& str, std::ostream* out); | 176 BASE_EXPORT extern void PrintTo(const string16& str, std::ostream* out); |
| 178 } | 177 } |
| 179 | 178 |
| 180 #endif // WCHAR_T_IS_UTF32 | 179 #endif // WCHAR_T_IS_UTF32 |
| 181 | 180 |
| 182 #endif // BASE_STRING16_H_ | 181 #endif // BASE_STRING16_H_ |
| OLD | NEW |