| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 9 |
| 10 #include <stdarg.h> // va_list | 10 #include <stdarg.h> // va_list |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // any and all uses of "std::string()" as nicer-looking sugar. | 126 // any and all uses of "std::string()" as nicer-looking sugar. |
| 127 // These functions are threadsafe. | 127 // These functions are threadsafe. |
| 128 const std::string& EmptyString(); | 128 const std::string& EmptyString(); |
| 129 const std::wstring& EmptyWString(); | 129 const std::wstring& EmptyWString(); |
| 130 const string16& EmptyString16(); | 130 const string16& EmptyString16(); |
| 131 | 131 |
| 132 extern const wchar_t kWhitespaceWide[]; | 132 extern const wchar_t kWhitespaceWide[]; |
| 133 extern const char16 kWhitespaceUTF16[]; | 133 extern const char16 kWhitespaceUTF16[]; |
| 134 extern const char kWhitespaceASCII[]; | 134 extern const char kWhitespaceASCII[]; |
| 135 | 135 |
| 136 extern const char kUtf8ByteOrderMark[]; |
| 137 |
| 136 // Removes characters in trim_chars from the beginning and end of input. | 138 // Removes characters in trim_chars from the beginning and end of input. |
| 137 // NOTE: Safe to use the same variable for both input and output. | 139 // NOTE: Safe to use the same variable for both input and output. |
| 138 bool TrimString(const std::wstring& input, | 140 bool TrimString(const std::wstring& input, |
| 139 const wchar_t trim_chars[], | 141 const wchar_t trim_chars[], |
| 140 std::wstring* output); | 142 std::wstring* output); |
| 141 bool TrimString(const string16& input, | 143 bool TrimString(const string16& input, |
| 142 const char16 trim_chars[], | 144 const char16 trim_chars[], |
| 143 string16* output); | 145 string16* output); |
| 144 bool TrimString(const std::string& input, | 146 bool TrimString(const std::string& input, |
| 145 const char trim_chars[], | 147 const char trim_chars[], |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 #elif defined(WCHAR_T_IS_UTF32) | 628 #elif defined(WCHAR_T_IS_UTF32) |
| 627 typedef uint32 Unsigned; | 629 typedef uint32 Unsigned; |
| 628 #endif | 630 #endif |
| 629 }; | 631 }; |
| 630 template<> | 632 template<> |
| 631 struct ToUnsigned<short> { | 633 struct ToUnsigned<short> { |
| 632 typedef unsigned short Unsigned; | 634 typedef unsigned short Unsigned; |
| 633 }; | 635 }; |
| 634 | 636 |
| 635 #endif // BASE_STRING_UTIL_H_ | 637 #endif // BASE_STRING_UTIL_H_ |
| OLD | NEW |