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

Side by Side Diff: ui/app_list/search/term_break_iterator.h

Issue 522683003: Move basic string operations to ui/app_list/search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 6 years, 3 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 | « ui/app_list/app_list.gyp ('k') | ui/app_list/search/term_break_iterator.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 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_TERM_BREAK_ITERATOR_H_ 5 #ifndef UI_APP_LIST_SEARCH_TERM_BREAK_ITERATOR_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_TERM_BREAK_ITERATOR_H_ 6 #define UI_APP_LIST_SEARCH_TERM_BREAK_ITERATOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "ui/app_list/app_list_export.h"
11 12
12 namespace base { 13 namespace base {
13 namespace i18n { 14 namespace i18n {
14 class UTF16CharIterator; 15 class UTF16CharIterator;
15 } 16 }
16 } 17 }
17 18
18 namespace app_list { 19 namespace app_list {
19 20
20 // TermBreakIterator breaks terms out of a word. Terms are broken on 21 // TermBreakIterator breaks terms out of a word. Terms are broken on
21 // camel case boundaries and alpha/number boundaries. Numbers are defined 22 // camel case boundaries and alpha/number boundaries. Numbers are defined
22 // as [0-9\.,]+. 23 // as [0-9\.,]+.
23 // e.g. 24 // e.g.
24 // CamelCase -> Camel, Case 25 // CamelCase -> Camel, Case
25 // Python2.7 -> Python, 2.7 26 // Python2.7 -> Python, 2.7
26 class TermBreakIterator { 27 class APP_LIST_EXPORT TermBreakIterator {
27 public: 28 public:
28 // Note that |word| must out live this iterator. 29 // Note that |word| must out live this iterator.
29 explicit TermBreakIterator(const base::string16& word); 30 explicit TermBreakIterator(const base::string16& word);
30 ~TermBreakIterator(); 31 ~TermBreakIterator();
31 32
32 // Advance to the next term. Returns false if at the end of the word. 33 // Advance to the next term. Returns false if at the end of the word.
33 bool Advance(); 34 bool Advance();
34 35
35 // Returns the current term, which is the substr of |word_| in range 36 // Returns the current term, which is the substr of |word_| in range
36 // [prev_, pos_). 37 // [prev_, pos_).
(...skipping 22 matching lines...) Expand all
59 size_t pos_; 60 size_t pos_;
60 61
61 scoped_ptr<base::i18n::UTF16CharIterator> iter_; 62 scoped_ptr<base::i18n::UTF16CharIterator> iter_;
62 State state_; 63 State state_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(TermBreakIterator); 65 DISALLOW_COPY_AND_ASSIGN(TermBreakIterator);
65 }; 66 };
66 67
67 } // namespace app_list 68 } // namespace app_list
68 69
69 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_TERM_BREAK_ITERATOR_H_ 70 #endif // UI_APP_LIST_SEARCH_TERM_BREAK_ITERATOR_H_
OLDNEW
« no previous file with comments | « ui/app_list/app_list.gyp ('k') | ui/app_list/search/term_break_iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698