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_STRING_UTIL_WIN_H_ | 5 #ifndef BASE_STRINGS_STRING_UTIL_WIN_H_ |
6 #define BASE_STRINGS_STRING_UTIL_WIN_H_ | 6 #define BASE_STRINGS_STRING_UTIL_WIN_H_ |
7 | 7 |
8 #include <stdio.h> | |
9 #include <string.h> | 8 #include <string.h> |
10 #include <wchar.h> | |
11 | |
12 #include "base/strings/string16.h" | |
13 | 9 |
14 namespace base { | 10 namespace base { |
15 | 11 |
16 // Chromium code style is to not use malloc'd strings; this is only for use | 12 // Chromium code style is to not use malloc'd strings; this is only for use |
17 // for interaction with APIs that require it. | 13 // for interaction with APIs that require it. |
18 inline char* strdup(const char* str) { | 14 inline char* strdup(const char* str) { |
19 return _strdup(str); | 15 return _strdup(str); |
20 } | 16 } |
21 | 17 |
22 inline int strcasecmp(const char* s1, const char* s2) { | 18 inline int strcasecmp(const char* s1, const char* s2) { |
23 return _stricmp(s1, s2); | 19 return _stricmp(s1, s2); |
24 } | 20 } |
25 | 21 |
26 inline int strncasecmp(const char* s1, const char* s2, size_t count) { | 22 inline int strncasecmp(const char* s1, const char* s2, size_t count) { |
27 return _strnicmp(s1, s2, count); | 23 return _strnicmp(s1, s2, count); |
28 } | 24 } |
29 | 25 |
30 inline int strncmp16(const char16* s1, const char16* s2, size_t count) { | |
31 return wcsncmp(s1, s2, count); | |
32 } | |
33 | |
34 } // namespace base | 26 } // namespace base |
35 | 27 |
36 #endif // BASE_STRINGS_STRING_UTIL_WIN_H_ | 28 #endif // BASE_STRINGS_STRING_UTIL_WIN_H_ |
OLD | NEW |