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

Side by Side Diff: tool/input_sdk/lib/core/string_buffer.dart

Issue 1957633002: Upgrade StringBuffer, identical (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/patch/core_patch.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * A class for concatenating strings efficiently. 8 * A class for concatenating strings efficiently.
9 * 9 *
10 * Allows for the incremental building of a string using write*() methods. 10 * Allows for the incremental building of a string using write*() methods.
(...skipping 19 matching lines...) Expand all
30 * operation. 30 * operation.
31 */ 31 */
32 bool get isNotEmpty => !isEmpty; 32 bool get isNotEmpty => !isEmpty;
33 33
34 /// Adds the contents of [obj], converted to a string, to the buffer. 34 /// Adds the contents of [obj], converted to a string, to the buffer.
35 external void write(Object obj); 35 external void write(Object obj);
36 36
37 /// Adds the string representation of [charCode] to the buffer. 37 /// Adds the string representation of [charCode] to the buffer.
38 external void writeCharCode(int charCode); 38 external void writeCharCode(int charCode);
39 39
40 void writeAll(Iterable objects, [String separator = ""]) { 40 external void writeAll(Iterable objects, [String separator = ""]);
41 Iterator iterator = objects.iterator;
42 if (!iterator.moveNext()) return;
43 if (separator.isEmpty) {
44 do {
45 write(iterator.current);
46 } while (iterator.moveNext());
47 } else {
48 write(iterator.current);
49 while (iterator.moveNext()) {
50 write(separator);
51 write(iterator.current);
52 }
53 }
54 }
55 41
56 void writeln([Object obj = ""]) { 42 external void writeln([Object obj = ""]);
57 write(obj);
58 write("\n");
59 }
60 43
61 /** 44 /**
62 * Clears the string buffer. 45 * Clears the string buffer.
63 */ 46 */
64 external void clear(); 47 external void clear();
65 48
66 /// Returns the contents of buffer as a concatenated string. 49 /// Returns the contents of buffer as a concatenated string.
67 external String toString(); 50 external String toString();
68 } 51 }
OLDNEW
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/patch/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698