| 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 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 BASE_API extern const wchar_t kWhitespaceWide[]; | 174 BASE_API extern const wchar_t kWhitespaceWide[]; |
| 175 BASE_API extern const char16 kWhitespaceUTF16[]; | 175 BASE_API extern const char16 kWhitespaceUTF16[]; |
| 176 BASE_API extern const char kWhitespaceASCII[]; | 176 BASE_API extern const char kWhitespaceASCII[]; |
| 177 | 177 |
| 178 BASE_API extern const char kUtf8ByteOrderMark[]; | 178 BASE_API extern const char kUtf8ByteOrderMark[]; |
| 179 | 179 |
| 180 // Removes characters in remove_chars from anywhere in input. Returns true if | 180 // Removes characters in remove_chars from anywhere in input. Returns true if |
| 181 // any characters were removed. | 181 // any characters were removed. |
| 182 // NOTE: Safe to use the same variable for both input and output. | 182 // NOTE: Safe to use the same variable for both input and output. |
| 183 BASE_API bool RemoveChars(const std::wstring& input, | |
| 184 const wchar_t remove_chars[], | |
| 185 std::wstring* output); | |
| 186 BASE_API bool RemoveChars(const string16& input, | 183 BASE_API bool RemoveChars(const string16& input, |
| 187 const char16 remove_chars[], | 184 const char16 remove_chars[], |
| 188 string16* output); | 185 string16* output); |
| 189 BASE_API bool RemoveChars(const std::string& input, | 186 BASE_API bool RemoveChars(const std::string& input, |
| 190 const char remove_chars[], | 187 const char remove_chars[], |
| 191 std::string* output); | 188 std::string* output); |
| 192 | 189 |
| 193 // Removes characters in trim_chars from the beginning and end of input. | 190 // Removes characters in trim_chars from the beginning and end of input. |
| 194 // NOTE: Safe to use the same variable for both input and output. | 191 // NOTE: Safe to use the same variable for both input and output. |
| 195 BASE_API bool TrimString(const std::wstring& input, | 192 BASE_API bool TrimString(const std::wstring& input, |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 #elif defined(WCHAR_T_IS_UTF32) | 555 #elif defined(WCHAR_T_IS_UTF32) |
| 559 typedef uint32 Unsigned; | 556 typedef uint32 Unsigned; |
| 560 #endif | 557 #endif |
| 561 }; | 558 }; |
| 562 template<> | 559 template<> |
| 563 struct ToUnsigned<short> { | 560 struct ToUnsigned<short> { |
| 564 typedef unsigned short Unsigned; | 561 typedef unsigned short Unsigned; |
| 565 }; | 562 }; |
| 566 | 563 |
| 567 #endif // BASE_STRING_UTIL_H_ | 564 #endif // BASE_STRING_UTIL_H_ |
| OLD | NEW |