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

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

Issue 878723002: Upgrade ICU to 54.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add en-GB display name test Created 5 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 | « DEPS ('k') | base/i18n/time_formatting_unittest.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) 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/source/common/unicode/ubrk.h" 8 #include "third_party/icu/source/common/unicode/ubrk.h"
9 #include "third_party/icu/source/common/unicode/uchar.h" 9 #include "third_party/icu/source/common/unicode/uchar.h"
10 #include "third_party/icu/source/common/unicode/ustring.h" 10 #include "third_party/icu/source/common/unicode/ustring.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 NOTREACHED() << "ubrk_openRules failed to parse rule string at line " 67 NOTREACHED() << "ubrk_openRules failed to parse rule string at line "
68 << parse_error.line << ", offset " << parse_error.offset; 68 << parse_error.line << ", offset " << parse_error.offset;
69 } 69 }
70 } else { 70 } else {
71 iter_ = ubrk_open(break_type, 71 iter_ = ubrk_open(break_type,
72 NULL, 72 NULL,
73 string_.data(), 73 string_.data(),
74 static_cast<int32_t>(string_.size()), 74 static_cast<int32_t>(string_.size()),
75 &status); 75 &status);
76 if (U_FAILURE(status)) { 76 if (U_FAILURE(status)) {
77 NOTREACHED() << "ubrk_open failed"; 77 NOTREACHED() << "ubrk_open failed for type " << break_type
78 << " with error " << status;
78 } 79 }
79 } 80 }
80 81
81 if (U_FAILURE(status)) { 82 if (U_FAILURE(status)) {
82 return false; 83 return false;
83 } 84 }
84 85
85 // Move the iterator to the beginning of the string. 86 // Move the iterator to the beginning of the string.
86 ubrk_first(static_cast<UBreakIterator*>(iter_)); 87 ubrk_first(static_cast<UBreakIterator*>(iter_));
87 return true; 88 return true;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return GetStringPiece().as_string(); 177 return GetStringPiece().as_string();
177 } 178 }
178 179
179 StringPiece16 BreakIterator::GetStringPiece() const { 180 StringPiece16 BreakIterator::GetStringPiece() const {
180 DCHECK(prev_ != npos && pos_ != npos); 181 DCHECK(prev_ != npos && pos_ != npos);
181 return string_.substr(prev_, pos_ - prev_); 182 return string_.substr(prev_, pos_ - prev_);
182 } 183 }
183 184
184 } // namespace i18n 185 } // namespace i18n
185 } // namespace base 186 } // namespace base
OLDNEW
« no previous file with comments | « DEPS ('k') | base/i18n/time_formatting_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698