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 // This file defines utility functions for working with strings. | 5 // This file defines utility functions for working with strings. |
6 | 6 |
7 #ifndef BASE_STRINGS_STRING_UTIL_H_ | 7 #ifndef BASE_STRINGS_STRING_UTIL_H_ |
8 #define BASE_STRINGS_STRING_UTIL_H_ | 8 #define BASE_STRINGS_STRING_UTIL_H_ |
9 | 9 |
10 #include <ctype.h> | 10 #include <ctype.h> |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 const char* b); | 318 const char* b); |
319 | 319 |
320 // Performs a case-sensitive string compare. The behavior is undefined if both | 320 // Performs a case-sensitive string compare. The behavior is undefined if both |
321 // strings are not ASCII. | 321 // strings are not ASCII. |
322 BASE_EXPORT bool EqualsASCII(const base::string16& a, const base::StringPiece& b
); | 322 BASE_EXPORT bool EqualsASCII(const base::string16& a, const base::StringPiece& b
); |
323 | 323 |
324 // Returns true if str starts with search, or false otherwise. | 324 // Returns true if str starts with search, or false otherwise. |
325 BASE_EXPORT bool StartsWithASCII(const std::string& str, | 325 BASE_EXPORT bool StartsWithASCII(const std::string& str, |
326 const std::string& search, | 326 const std::string& search, |
327 bool case_sensitive); | 327 bool case_sensitive); |
| 328 BASE_EXPORT bool StartsWith(const std::string& str, |
| 329 const std::string& search, |
| 330 bool case_sensitive); |
328 BASE_EXPORT bool StartsWith(const base::string16& str, | 331 BASE_EXPORT bool StartsWith(const base::string16& str, |
329 const base::string16& search, | 332 const base::string16& search, |
330 bool case_sensitive); | 333 bool case_sensitive); |
331 | 334 |
332 // Returns true if str ends with search, or false otherwise. | 335 // Returns true if str ends with search, or false otherwise. |
333 BASE_EXPORT bool EndsWith(const std::string& str, | 336 BASE_EXPORT bool EndsWith(const std::string& str, |
334 const std::string& search, | 337 const std::string& search, |
335 bool case_sensitive); | 338 bool case_sensitive); |
336 BASE_EXPORT bool EndsWith(const base::string16& str, | 339 BASE_EXPORT bool EndsWith(const base::string16& str, |
337 const base::string16& search, | 340 const base::string16& search, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 #elif defined(WCHAR_T_IS_UTF32) | 526 #elif defined(WCHAR_T_IS_UTF32) |
524 typedef uint32 Unsigned; | 527 typedef uint32 Unsigned; |
525 #endif | 528 #endif |
526 }; | 529 }; |
527 template<> | 530 template<> |
528 struct ToUnsigned<short> { | 531 struct ToUnsigned<short> { |
529 typedef unsigned short Unsigned; | 532 typedef unsigned short Unsigned; |
530 }; | 533 }; |
531 | 534 |
532 #endif // BASE_STRINGS_STRING_UTIL_H_ | 535 #endif // BASE_STRINGS_STRING_UTIL_H_ |
OLD | NEW |