OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of "dart:convert"; | 5 part of dart.convert; |
6 | 6 |
7 // Character constants. | 7 // Character constants. |
8 const int _LF = 10; | 8 const int _LF = 10; |
9 const int _CR = 13; | 9 const int _CR = 13; |
10 | 10 |
11 /** | 11 /** |
12 * A [StreamTransformer] that splits a [String] into individual lines. | 12 * A [StreamTransformer] that splits a [String] into individual lines. |
13 * | 13 * |
14 * A line is terminated by either a CR (U+000D), a LF (U+000A), a | 14 * A line is terminated by either a CR (U+000D), a LF (U+000A), a |
15 * CR+LF sequence (DOS line ending), | 15 * CR+LF sequence (DOS line ending), |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 final EventSink<String> _eventSink; | 169 final EventSink<String> _eventSink; |
170 | 170 |
171 _LineSplitterEventSink(EventSink<String> eventSink) | 171 _LineSplitterEventSink(EventSink<String> eventSink) |
172 : _eventSink = eventSink, | 172 : _eventSink = eventSink, |
173 super(new StringConversionSink.from(eventSink)); | 173 super(new StringConversionSink.from(eventSink)); |
174 | 174 |
175 void addError(Object o, [StackTrace stackTrace]) { | 175 void addError(Object o, [StackTrace stackTrace]) { |
176 _eventSink.addError(o, stackTrace); | 176 _eventSink.addError(o, stackTrace); |
177 } | 177 } |
178 } | 178 } |
OLD | NEW |