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 // This file defines utility functions for working with strings. | 5 // This file defines utility functions for working with strings. |
6 | 6 |
7 #ifndef BASE_STRING_UTIL_H_ | 7 #ifndef BASE_STRING_UTIL_H_ |
8 #define BASE_STRING_UTIL_H_ | 8 #define BASE_STRING_UTIL_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <ctype.h> | 11 #include <ctype.h> |
12 #include <stdarg.h> // va_list | 12 #include <stdarg.h> // va_list |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/base_export.h" | 17 #include "base/base_export.h" |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
19 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
20 #include "base/string16.h" | 20 #include "base/string16.h" |
21 #include "base/string_piece.h" // For implicit conversions. | 21 #include "base/string_piece.h" // For implicit conversions. |
22 | 22 |
23 // TODO(brettw) remove this dependency. Previously StringPrintf lived in this | |
24 // file. We need to convert the callers over to using stringprintf.h instead | |
25 // and then remove this. | |
26 #include "base/stringprintf.h" | |
27 | |
28 // Safe standard library wrappers for all platforms. | 23 // Safe standard library wrappers for all platforms. |
29 | 24 |
30 namespace base { | 25 namespace base { |
31 | 26 |
32 // C standard-library functions like "strncasecmp" and "snprintf" that aren't | 27 // C standard-library functions like "strncasecmp" and "snprintf" that aren't |
33 // cross-platform are provided as "base::strncasecmp", and their prototypes | 28 // cross-platform are provided as "base::strncasecmp", and their prototypes |
34 // are listed below. These functions are then implemented as inline calls | 29 // are listed below. These functions are then implemented as inline calls |
35 // to the platform-specific equivalents in the platform-specific headers. | 30 // to the platform-specific equivalents in the platform-specific headers. |
36 | 31 |
37 // Compares the two strings s1 and s2 without regard to case using | 32 // Compares the two strings s1 and s2 without regard to case using |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 #elif defined(WCHAR_T_IS_UTF32) | 539 #elif defined(WCHAR_T_IS_UTF32) |
545 typedef uint32 Unsigned; | 540 typedef uint32 Unsigned; |
546 #endif | 541 #endif |
547 }; | 542 }; |
548 template<> | 543 template<> |
549 struct ToUnsigned<short> { | 544 struct ToUnsigned<short> { |
550 typedef unsigned short Unsigned; | 545 typedef unsigned short Unsigned; |
551 }; | 546 }; |
552 | 547 |
553 #endif // BASE_STRING_UTIL_H_ | 548 #endif // BASE_STRING_UTIL_H_ |
OLD | NEW |