OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/break_iterator.h" | 5 #include "base/i18n/break_iterator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/icu/public/common/unicode/ubrk.h" | 8 #include "third_party/icu/source/common/unicode/ubrk.h" |
9 #include "third_party/icu/public/common/unicode/uchar.h" | 9 #include "third_party/icu/source/common/unicode/uchar.h" |
10 #include "third_party/icu/public/common/unicode/ustring.h" | 10 #include "third_party/icu/source/common/unicode/ustring.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 namespace i18n { | 13 namespace i18n { |
14 | 14 |
15 const size_t npos = -1; | 15 const size_t npos = -1; |
16 | 16 |
17 BreakIterator::BreakIterator(const string16& str, BreakType break_type) | 17 BreakIterator::BreakIterator(const string16& str, BreakType break_type) |
18 : iter_(NULL), | 18 : iter_(NULL), |
19 string_(str), | 19 string_(str), |
20 break_type_(break_type), | 20 break_type_(break_type), |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 return (!!boundary && next_status != UBRK_WORD_NONE); | 117 return (!!boundary && next_status != UBRK_WORD_NONE); |
118 } | 118 } |
119 | 119 |
120 string16 BreakIterator::GetString() const { | 120 string16 BreakIterator::GetString() const { |
121 DCHECK(prev_ != npos && pos_ != npos); | 121 DCHECK(prev_ != npos && pos_ != npos); |
122 return string_.substr(prev_, pos_ - prev_); | 122 return string_.substr(prev_, pos_ - prev_); |
123 } | 123 } |
124 | 124 |
125 } // namespace i18n | 125 } // namespace i18n |
126 } // namespace base | 126 } // namespace base |
OLD | NEW |