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

Side by Side Diff: base/i18n/word_iterator.cc

Issue 5718003: Remove ICU header dependencies outside of /i18n directory.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « base/i18n/word_iterator.h ('k') | chrome/browser/history/in_memory_url_index.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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "base/i18n/word_iterator.h" 5 #include "base/i18n/word_iterator.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "unicode/ubrk.h" 8 #include "unicode/ubrk.h"
9 #include "unicode/uchar.h"
9 #include "unicode/ustring.h" 10 #include "unicode/ustring.h"
10 11
11 const size_t npos = -1; 12 const size_t npos = -1;
12 13
13 WordIterator::WordIterator(const string16* str, BreakType break_type) 14 WordIterator::WordIterator(const string16* str, BreakType break_type)
14 : iter_(NULL), 15 : iter_(NULL),
15 string_(str), 16 string_(str),
16 break_type_(break_type), 17 break_type_(break_type),
17 prev_(npos), 18 prev_(npos),
18 pos_(0) { 19 pos_(0) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 62 }
62 63
63 bool WordIterator::IsWord() const { 64 bool WordIterator::IsWord() const {
64 return (ubrk_getRuleStatus(iter_) != UBRK_WORD_NONE); 65 return (ubrk_getRuleStatus(iter_) != UBRK_WORD_NONE);
65 } 66 }
66 67
67 string16 WordIterator::GetWord() const { 68 string16 WordIterator::GetWord() const {
68 DCHECK(prev_ != npos && pos_ != npos); 69 DCHECK(prev_ != npos && pos_ != npos);
69 return string_->substr(prev_, pos_ - prev_); 70 return string_->substr(prev_, pos_ - prev_);
70 } 71 }
OLDNEW
« no previous file with comments | « base/i18n/word_iterator.h ('k') | chrome/browser/history/in_memory_url_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698