OLD | NEW |
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 patch class String { | 5 patch class String { |
6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) { | 6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) { |
7 return _StringBase.createFromCharCodes(charCodes); | 7 return _StringBase.createFromCharCodes(charCodes); |
8 } | 8 } |
9 } | 9 } |
10 | 10 |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 } | 619 } |
620 | 620 |
621 List<String> groups(List<int> groups) { | 621 List<String> groups(List<int> groups) { |
622 List<String> result = new List<String>(); | 622 List<String> result = new List<String>(); |
623 for (int g in groups) { | 623 for (int g in groups) { |
624 result.add(group(g)); | 624 result.add(group(g)); |
625 } | 625 } |
626 return result; | 626 return result; |
627 } | 627 } |
628 | 628 |
629 // TODO(12843): Remove when grace period is over. | |
630 String get str => input; | |
631 | |
632 final int start; | 629 final int start; |
633 final String input; | 630 final String input; |
634 final String pattern; | 631 final String pattern; |
635 } | 632 } |
636 | 633 |
637 /** | 634 /** |
638 * An [Iterable] of the UTF-16 code units of a [String] in index order. | 635 * An [Iterable] of the UTF-16 code units of a [String] in index order. |
639 */ | 636 */ |
640 class _CodeUnits extends Object with ListMixin<int>, | 637 class _CodeUnits extends Object with ListMixin<int>, |
641 UnmodifiableListMixin<int> { | 638 UnmodifiableListMixin<int> { |
642 /** The string that this is the code units of. */ | 639 /** The string that this is the code units of. */ |
643 String _string; | 640 String _string; |
644 | 641 |
645 _CodeUnits(this._string); | 642 _CodeUnits(this._string); |
646 | 643 |
647 int get length => _string.length; | 644 int get length => _string.length; |
648 int operator[](int i) => _string.codeUnitAt(i); | 645 int operator[](int i) => _string.codeUnitAt(i); |
649 } | 646 } |
OLD | NEW |