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_STRING16_H_ | 5 #ifndef BASE_STRING16_H_ |
6 #define BASE_STRING16_H_ | 6 #define BASE_STRING16_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // WHAT: | 9 // WHAT: |
10 // A version of std::basic_string that provides 2-byte characters even when | 10 // A version of std::basic_string that provides 2-byte characters even when |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // char16 versions of the functions required by string16_char_traits; these | 47 // char16 versions of the functions required by string16_char_traits; these |
48 // are based on the wide character functions of similar names ("w" or "wcs" | 48 // are based on the wide character functions of similar names ("w" or "wcs" |
49 // instead of "c16"). | 49 // instead of "c16"). |
50 BASE_EXPORT int c16memcmp(const char16* s1, const char16* s2, size_t n); | 50 BASE_EXPORT int c16memcmp(const char16* s1, const char16* s2, size_t n); |
51 BASE_EXPORT size_t c16len(const char16* s); | 51 BASE_EXPORT size_t c16len(const char16* s); |
52 BASE_EXPORT const char16* c16memchr(const char16* s, char16 c, size_t n); | 52 BASE_EXPORT const char16* c16memchr(const char16* s, char16 c, size_t n); |
53 BASE_EXPORT char16* c16memmove(char16* s1, const char16* s2, size_t n); | 53 BASE_EXPORT char16* c16memmove(char16* s1, const char16* s2, size_t n); |
54 BASE_EXPORT char16* c16memcpy(char16* s1, const char16* s2, size_t n); | 54 BASE_EXPORT char16* c16memcpy(char16* s1, const char16* s2, size_t n); |
55 BASE_EXPORT char16* c16memset(char16* s, char16 c, size_t n); | 55 BASE_EXPORT char16* c16memset(char16* s, char16 c, size_t n); |
56 | 56 |
57 struct string16_char_traits { | 57 struct BASE_EXPORT string16_char_traits { |
58 typedef char16 char_type; | 58 typedef char16 char_type; |
59 typedef int int_type; | 59 typedef int int_type; |
60 | 60 |
61 // int_type needs to be able to hold each possible value of char_type, and in | 61 // int_type needs to be able to hold each possible value of char_type, and in |
62 // addition, the distinct value of eof(). | 62 // addition, the distinct value of eof(). |
63 COMPILE_ASSERT(sizeof(int_type) > sizeof(char_type), unexpected_type_width); | 63 COMPILE_ASSERT(sizeof(int_type) > sizeof(char_type), unexpected_type_width); |
64 | 64 |
65 typedef std::streamoff off_type; | 65 typedef std::streamoff off_type; |
66 typedef mbstate_t state_type; | 66 typedef mbstate_t state_type; |
67 typedef std::fpos<state_type> pos_type; | 67 typedef std::fpos<state_type> pos_type; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 typedef std::basic_string<char16, base::string16_char_traits> string16; | 169 typedef std::basic_string<char16, base::string16_char_traits> string16; |
170 | 170 |
171 namespace base { | 171 namespace base { |
172 BASE_EXPORT extern std::ostream& operator<<(std::ostream& out, | 172 BASE_EXPORT extern std::ostream& operator<<(std::ostream& out, |
173 const string16& str); | 173 const string16& str); |
174 } | 174 } |
175 | 175 |
176 #endif // WCHAR_T_IS_UTF32 | 176 #endif // WCHAR_T_IS_UTF32 |
177 | 177 |
178 #endif // BASE_STRING16_H_ | 178 #endif // BASE_STRING16_H_ |
OLD | NEW |