Chromium Code Reviews| Index: sdk/lib/internal/internal.dart |
| diff --git a/sdk/lib/internal/internal.dart b/sdk/lib/internal/internal.dart |
| index 10b961312a021eacd49e1f84b2f652af6eb02821..3eda7caf55b4869b81c973dcfa585edd50bae76f 100644 |
| --- a/sdk/lib/internal/internal.dart |
| +++ b/sdk/lib/internal/internal.dart |
| @@ -45,3 +45,18 @@ const POWERS_OF_TEN = const [ |
| 1000000000000000000000.0, |
| 10000000000000000000000.0, |
| ]; |
| + |
| +/** |
| + * An [Iterable] of the UTF-16 code units of a [String] in index order. |
| + */ |
| +class CodeUnits extends UnmodifiableListBase<int> { |
| + /** The string that this is the code units of. */ |
| + final String _string; |
| + |
| + CodeUnits(this._string); |
|
srdjan
2015/01/29 17:35:16
Can this be a const constructor?
Lasse Reichstein Nielsen
2015/01/30 09:42:54
Sadly not. The UnmodifiableListBase super-class do
|
| + |
| + int get length => _string.length; |
| + int operator[](int i) => _string.codeUnitAt(i); |
| + |
| + static String stringOf(CodeUnits u) => u._string; |
| +} |