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

Side by Side Diff: lib/utf/utf_core.dart

Issue 11263040: Make String.charCodes a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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 | « lib/utf/utf16.dart ('k') | pkg/intl/lib/number_format.dart » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Provide a list of Unicode codepoints for a given string. 6 * Provide a list of Unicode codepoints for a given string.
7 */ 7 */
8 List<int> stringToCodepoints(String str) { 8 List<int> stringToCodepoints(String str) {
9 List<int> codepoints; 9 List<int> codepoints;
10 // TODO _is16BitCodeUnit() is used to work around a bug with dart2js 10 // TODO _is16BitCodeUnit() is used to work around a bug with dart2js
11 // (http://code.google.com/p/dart/issues/detail?id=1357). Consider 11 // (http://code.google.com/p/dart/issues/detail?id=1357). Consider
12 // removing after this issue is resolved. 12 // removing after this issue is resolved.
13 if (_is16BitCodeUnit()) { 13 if (_is16BitCodeUnit()) {
14 codepoints = _utf16CodeUnitsToCodepoints(str.charCodes()); 14 codepoints = _utf16CodeUnitsToCodepoints(str.charCodes);
15 } else { 15 } else {
16 codepoints = str.charCodes(); 16 codepoints = str.charCodes;
17 } 17 }
18 return codepoints; 18 return codepoints;
19 } 19 }
20 20
21 /** 21 /**
22 * Generate a string from the provided Unicode codepoints. 22 * Generate a string from the provided Unicode codepoints.
23 */ 23 */
24 String codepointsToString(List<int> codepoints) { 24 String codepointsToString(List<int> codepoints) {
25 // TODO _is16BitCodeUnit() is used to work around a bug with dart2js 25 // TODO _is16BitCodeUnit() is used to work around a bug with dart2js
26 // (http://code.google.com/p/dart/issues/detail?id=1357). Consider 26 // (http://code.google.com/p/dart/issues/detail?id=1357). Consider
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 _offset -= by; 266 _offset -= by;
267 } 267 }
268 268
269 int get remaining => _end - _offset; 269 int get remaining => _end - _offset;
270 270
271 void skip([int count = 1]) { 271 void skip([int count = 1]) {
272 _offset += count; 272 _offset += count;
273 } 273 }
274 } 274 }
275 275
OLDNEW
« no previous file with comments | « lib/utf/utf16.dart ('k') | pkg/intl/lib/number_format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698