Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: base/strings/string_util.h

Issue 1226673003: Move MatchPattern to its own header and the base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/strings/pattern_unittest.cc ('k') | base/strings/string_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « base/strings/pattern_unittest.cc ('k') | base/strings/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698