| 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 * 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * Clears the string buffer. | 66 * Clears the string buffer. |
| 67 */ | 67 */ |
| 68 void clear() { | 68 void clear() { |
| 69 _contents = ""; | 69 _contents = ""; |
| 70 } | 70 } |
| 71 | 71 |
| 72 /// Returns the contents of buffer as a concatenated string. | 72 /// Returns the contents of buffer as a concatenated string. |
| 73 String toString() => Primitives.flattenString(_contents); | 73 String toString() => Primitives.flattenString(_contents); |
| 74 |
| 75 String _contents; |
| 76 |
| 77 void _writeString(str) { |
| 78 _contents = Primitives.stringConcatUnchecked(_contents, str); |
| 79 } |
| 74 } | 80 } |
| OLD | NEW |