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

Side by Side Diff: runtime/lib/string_base.dart

Issue 12261009: Added implementation of String.codeUnits. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typos Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_collection_dev/iterable.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 * [_StringBase] contains common methods used by concrete String 6 * [_StringBase] contains common methods used by concrete String
7 * implementations, e.g., _OneByteString. 7 * implementations, e.g., _OneByteString.
8 */ 8 */
9 class _StringBase { 9 class _StringBase {
10 10
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 426
427 List<int> get charCodes { 427 List<int> get charCodes {
428 int len = this.length; 428 int len = this.length;
429 final result = new List<int>.fixedLength(len); 429 final result = new List<int>.fixedLength(len);
430 for (int i = 0; i < len; i++) { 430 for (int i = 0; i < len; i++) {
431 result[i] = this.charCodeAt(i); 431 result[i] = this.charCodeAt(i);
432 } 432 }
433 return result; 433 return result;
434 } 434 }
435 435
436 Iterable<int> get codeUnits { 436 Iterable<int> get codeUnits => new CodeUnits(this);
437 throw new UnimplementedError("String.codeUnits");
438 }
439 437
440 Runes get runes => new Runes(this); 438 Runes get runes => new Runes(this);
441 439
442 String toUpperCase() native "String_toUpperCase"; 440 String toUpperCase() native "String_toUpperCase";
443 441
444 String toLowerCase() native "String_toLowerCase"; 442 String toLowerCase() native "String_toLowerCase";
445 443
446 // Implementations of Strings methods follow below. 444 // Implementations of Strings methods follow below.
447 static String join(Iterable<String> strings, String separator) { 445 static String join(Iterable<String> strings, String separator) {
448 bool first = true; 446 bool first = true;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 for (int g in groups) { 620 for (int g in groups) {
623 result.add(group(g)); 621 result.add(group(g));
624 } 622 }
625 return result; 623 return result;
626 } 624 }
627 625
628 final int start; 626 final int start;
629 final String str; 627 final String str;
630 final String pattern; 628 final String pattern;
631 } 629 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_collection_dev/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698