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

Side by Side Diff: sdk/lib/io/string_transformer.dart

Issue 12441003: Rename String.concat to operator+. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 9 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 | « sdk/lib/core/string.dart ('k') | tests/compiler/dart2js_extra/bailout_test.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) 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.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * String encodings. 8 * String encodings.
9 */ 9 */
10 class Encoding { 10 class Encoding {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 class LineTransformer extends StreamEventTransformer<String, String> { 211 class LineTransformer extends StreamEventTransformer<String, String> {
212 const int _LF = 10; 212 const int _LF = 10;
213 const int _CR = 13; 213 const int _CR = 13;
214 214
215 StringBuffer _buffer = new StringBuffer(); 215 StringBuffer _buffer = new StringBuffer();
216 String _carry; 216 String _carry;
217 217
218 void _handle(String data, EventSink<String> sink, bool isClosing) { 218 void _handle(String data, EventSink<String> sink, bool isClosing) {
219 if (_carry != null) { 219 if (_carry != null) {
220 data = _carry.concat(data); 220 data = _carry + data;
221 _carry = null; 221 _carry = null;
222 } 222 }
223 int startPos = 0; 223 int startPos = 0;
224 int pos = 0; 224 int pos = 0;
225 while (pos < data.length) { 225 while (pos < data.length) {
226 int skip = 0; 226 int skip = 0;
227 int char = data.codeUnitAt(pos); 227 int char = data.codeUnitAt(pos);
228 if (char == _LF) { 228 if (char == _LF) {
229 skip = 1; 229 skip = 1;
230 } else if (char == _CR) { 230 } else if (char == _CR) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 361
362 // Utility class for decoding Windows current code page data delivered 362 // Utility class for decoding Windows current code page data delivered
363 // as a stream of bytes. 363 // as a stream of bytes.
364 class _WindowsCodePageDecoder extends StreamEventTransformer<List<int>, String> { 364 class _WindowsCodePageDecoder extends StreamEventTransformer<List<int>, String> {
365 void handleData(List<int> data, EventSink<String> sink) { 365 void handleData(List<int> data, EventSink<String> sink) {
366 sink.add(_decodeBytes(data)); 366 sink.add(_decodeBytes(data));
367 } 367 }
368 368
369 external static String _decodeBytes(List<int> bytes); 369 external static String _decodeBytes(List<int> bytes);
370 } 370 }
OLDNEW
« no previous file with comments | « sdk/lib/core/string.dart ('k') | tests/compiler/dart2js_extra/bailout_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698