OLD | NEW |
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 * The StringBuffer class is useful for concatenating strings | 8 * The StringBuffer class is useful for concatenating strings |
9 * efficiently. Only on a call to [toString] are the strings | 9 * efficiently. Only on a call to [toString] are the strings |
10 * concatenated to a single String. | 10 * concatenated to a single String. |
(...skipping 15 matching lines...) Expand all Loading... |
26 /// Adds the contents of [obj], converted to a string, to the buffer. | 26 /// Adds the contents of [obj], converted to a string, to the buffer. |
27 external void write(Object obj); | 27 external void write(Object obj); |
28 | 28 |
29 /// Adds the string representation of [charCode] to the buffer. | 29 /// Adds the string representation of [charCode] to the buffer. |
30 external void writeCharCode(int charCode); | 30 external void writeCharCode(int charCode); |
31 | 31 |
32 void writeAll(Iterable objects) { | 32 void writeAll(Iterable objects) { |
33 for (Object obj in objects) write(obj); | 33 for (Object obj in objects) write(obj); |
34 } | 34 } |
35 | 35 |
36 void writeln(Object obj) { | 36 void writeln([Object obj = ""]) { |
37 write(obj); | 37 write(obj); |
38 write("\n"); | 38 write("\n"); |
39 } | 39 } |
40 | 40 |
41 /** | 41 /** |
42 * Clears the string buffer. | 42 * Clears the string buffer. |
43 */ | 43 */ |
44 external void clear(); | 44 external void clear(); |
45 | 45 |
46 /// Returns the contents of buffer as a concatenated string. | 46 /// Returns the contents of buffer as a concatenated string. |
47 external String toString(); | 47 external String toString(); |
48 } | 48 } |
OLD | NEW |