| 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 const base::StringPiece& format_string, | 531 const base::StringPiece& format_string, |
| 532 const std::vector<std::string>& subst, | 532 const std::vector<std::string>& subst, |
| 533 std::vector<size_t>* offsets); | 533 std::vector<size_t>* offsets); |
| 534 | 534 |
| 535 // Single-string shortcut for ReplaceStringHolders. |offset| may be NULL. | 535 // Single-string shortcut for ReplaceStringHolders. |offset| may be NULL. |
| 536 BASE_EXPORT base::string16 ReplaceStringPlaceholders( | 536 BASE_EXPORT base::string16 ReplaceStringPlaceholders( |
| 537 const base::string16& format_string, | 537 const base::string16& format_string, |
| 538 const base::string16& a, | 538 const base::string16& a, |
| 539 size_t* offset); | 539 size_t* offset); |
| 540 | 540 |
| 541 // Returns true if the string passed in matches the pattern. The pattern | |
| 542 // string can contain wildcards like * and ? | |
| 543 // The backslash character (\) is an escape character for * and ? | |
| 544 // We limit the patterns to having a max of 16 * or ? characters. | |
| 545 // ? matches 0 or 1 character, while * matches 0 or more characters. | |
| 546 BASE_EXPORT bool MatchPattern(const base::StringPiece& string, | |
| 547 const base::StringPiece& pattern); | |
| 548 BASE_EXPORT bool MatchPattern(const base::string16& string, | |
| 549 const base::string16& pattern); | |
| 550 | |
| 551 #endif // BASE_STRINGS_STRING_UTIL_H_ | 541 #endif // BASE_STRINGS_STRING_UTIL_H_ |
| OLD | NEW |