| Index: sdk/lib/core/string_buffer.dart
|
| diff --git a/sdk/lib/core/string_buffer.dart b/sdk/lib/core/string_buffer.dart
|
| index 2de49498aa19b29b68fdef0356aed9e8fba78711..d8b393583952238a7e66027ba20d0b45b86179e4 100644
|
| --- a/sdk/lib/core/string_buffer.dart
|
| +++ b/sdk/lib/core/string_buffer.dart
|
| @@ -9,77 +9,29 @@ part of dart.core;
|
| * efficiently. Only on a call to [toString] are the strings
|
| * concatenated to a single String.
|
| */
|
| -class StringBuffer implements StringSink {
|
| +abstract class StringBuffer {
|
|
|
| /// Creates the string buffer with an initial content.
|
| - external StringBuffer([Object content = ""]);
|
| + external factory StringBuffer([Object content = ""]);
|
|
|
| /// Returns the length of the buffer.
|
| - external int get length;
|
| + int get length;
|
|
|
| - /// Returns whether the buffer is empty.
|
| - bool get isEmpty => length == 0;
|
| + // Returns whether the buffer is empty.
|
| + bool get isEmpty;
|
|
|
| - /**
|
| - * Converts [obj] to a string and adds it to the buffer.
|
| - *
|
| - * *Deprecated*. Use [write] instead.
|
| - */
|
| - @deprecated
|
| - void add(Object obj) => write(obj);
|
| -
|
| - void write(Object obj) {
|
| - // TODO(srdjan): The following four lines could be replaced by
|
| - // '$obj', but apparently this is too slow on the Dart VM.
|
| - String str = obj.toString();
|
| - if (str is! String) {
|
| - throw new ArgumentError('toString() did not return a string');
|
| - }
|
| - if (str.isEmpty) return;
|
| - _write(str);
|
| - }
|
| -
|
| -
|
| - void print(Object obj) {
|
| - write(obj);
|
| - _write("\n");
|
| - }
|
| -
|
| - /**
|
| - * Adds the string representation of [charCode] to the buffer.
|
| - *
|
| - * *Deprecated* Use [writeCharCode] instead.
|
| - */
|
| - @deprecated
|
| - void addCharCode(int charCode) {
|
| - writeCharCode(charCode);
|
| - }
|
| + /// Converts [obj] to a string and adds it to the buffer.
|
| + void add(Object obj);
|
|
|
| /// Adds the string representation of [charCode] to the buffer.
|
| - void writeCharCode(int charCode) {
|
| - _write(new String.fromCharCode(charCode));
|
| - }
|
| + void addCharCode(int charCode);
|
|
|
| - /**
|
| - * Adds all items in [objects] to the buffer.
|
| - *
|
| - * *Deprecated*. Use [:objects.forEach(buffer.write):] instead.
|
| - */
|
| - @deprecated
|
| - void addAll(Iterable objects) {
|
| - for (Object obj in objects) write(obj);
|
| - }
|
| + /// Adds all items in [objects] to the buffer.
|
| + void addAll(Iterable objects);
|
|
|
| - /**
|
| - * Clears the string buffer.
|
| - *
|
| - * *Deprecated*.
|
| - */
|
| - @deprecated
|
| - external void clear();
|
| + /// Clears the string buffer.
|
| + void clear();
|
|
|
| /// Returns the contents of buffer as a concatenated string.
|
| - external String toString();
|
| -
|
| - external void _write(String str);
|
| + String toString();
|
| }
|
|
|