OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_STRING16_H_ | 5 #ifndef BASE_STRINGS_STRING16_H_ |
6 #define BASE_STRINGS_STRING16_H_ | 6 #define BASE_STRINGS_STRING16_H_ |
7 | 7 |
8 // WHAT: | 8 // WHAT: |
9 // 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 |
10 // 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 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 static size_t length(const char_type* s) { | 88 static size_t length(const char_type* s) { |
89 return c16len(s); | 89 return c16len(s); |
90 } | 90 } |
91 | 91 |
92 static const char_type* find(const char_type* s, size_t n, | 92 static const char_type* find(const char_type* s, size_t n, |
93 const char_type& a) { | 93 const char_type& a) { |
94 return c16memchr(s, a, n); | 94 return c16memchr(s, a, n); |
95 } | 95 } |
96 | 96 |
97 static char_type* move(char_type* s1, const char_type* s2, int_type n) { | 97 static char_type* move(char_type* s1, const char_type* s2, size_t n) { |
98 return c16memmove(s1, s2, n); | 98 return c16memmove(s1, s2, n); |
99 } | 99 } |
100 | 100 |
101 static char_type* copy(char_type* s1, const char_type* s2, size_t n) { | 101 static char_type* copy(char_type* s1, const char_type* s2, size_t n) { |
102 return c16memcpy(s1, s2, n); | 102 return c16memcpy(s1, s2, n); |
103 } | 103 } |
104 | 104 |
105 static char_type* assign(char_type* s, size_t n, char_type a) { | 105 static char_type* assign(char_type* s, size_t n, char_type a) { |
106 return c16memset(s, a, n); | 106 return c16memset(s, a, n); |
107 } | 107 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // boundaries, such as in statically-linked executables. | 175 // boundaries, such as in statically-linked executables. |
176 // | 176 // |
177 // TODO(mark): File this bug with Apple and update this note with a bug number. | 177 // TODO(mark): File this bug with Apple and update this note with a bug number. |
178 | 178 |
179 extern template | 179 extern template |
180 class BASE_EXPORT std::basic_string<base::char16, base::string16_char_traits>; | 180 class BASE_EXPORT std::basic_string<base::char16, base::string16_char_traits>; |
181 | 181 |
182 #endif // WCHAR_T_IS_UTF32 | 182 #endif // WCHAR_T_IS_UTF32 |
183 | 183 |
184 #endif // BASE_STRINGS_STRING16_H_ | 184 #endif // BASE_STRINGS_STRING16_H_ |
OLD | NEW |