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

Side by Side Diff: base/i18n/string_search.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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/i18n/string_compare.cc ('k') | base/i18n/string_search.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_I18N_STRING_SEARCH_H_
6 #define BASE_I18N_STRING_SEARCH_H_
7
8 #include "base/i18n/base_i18n_export.h"
9 #include "base/strings/string16.h"
10
11 struct UStringSearch;
12
13 namespace base {
14 namespace i18n {
15
16 // Returns true if |in_this| contains |find_this|. If |match_index| or
17 // |match_length| are non-NULL, they are assigned the start position and total
18 // length of the match.
19 //
20 // Only differences between base letters are taken into consideration. Case and
21 // accent differences are ignored. Please refer to 'primary level' in
22 // http://userguide.icu-project.org/collation/concepts for additional details.
23 BASE_I18N_EXPORT
24 bool StringSearchIgnoringCaseAndAccents(const string16& find_this,
25 const string16& in_this,
26 size_t* match_index,
27 size_t* match_length);
28
29 // This class is for speeding up multiple StringSearchIgnoringCaseAndAccents()
30 // with the same |find_this| argument. |find_this| is passed as the constructor
31 // argument, and precomputation for searching is done only at that timing.
32 class BASE_I18N_EXPORT FixedPatternStringSearchIgnoringCaseAndAccents {
33 public:
34 explicit FixedPatternStringSearchIgnoringCaseAndAccents(
35 const string16& find_this);
36 ~FixedPatternStringSearchIgnoringCaseAndAccents();
37
38 // Returns true if |in_this| contains |find_this|. If |match_index| or
39 // |match_length| are non-NULL, they are assigned the start position and total
40 // length of the match.
41 bool Search(const string16& in_this,
42 size_t* match_index,
43 size_t* match_length);
44
45 private:
46 string16 find_this_;
47 UStringSearch* search_;
48 };
49
50 } // namespace i18n
51 } // namespace base
52
53 #endif // BASE_I18N_STRING_SEARCH_H_
OLDNEW
« no previous file with comments | « base/i18n/string_compare.cc ('k') | base/i18n/string_search.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698