-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
string_sink.dart
49 lines (43 loc) · 1.65 KB
/
string_sink.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of dart.core;
// Examples can assume:
// late StringSink sink;
abstract interface class StringSink {
/// Writes the string representation of [object].
///
/// Converts [object] to a string using `object.toString()`.
///
/// Notice that calling `sink.write(null)` will will write the `"null"`
/// string.
void write(Object? object);
/// Writes the elements of [objects] separated by [separator].
///
/// Writes the string representation of every element of [objects],
/// in iteration order, and writes [separator] between any two elements.
///
/// ```dart
/// sink.writeAll(["Hello", "World"], " Beautiful ");
/// ```
/// is equivalent to:
/// ```dart
/// sink
/// ..write("Hello");
/// ..write(" Beautiful ");
/// ..write("World");
/// ```
void writeAll(Iterable<dynamic> objects, [String separator = ""]);
/// Writes the string representation of [object] followed by a newline.
///
/// Equivalent to `buffer.write(object)` followed by `buffer.write("\n")`.
///
/// Notice that calling `buffer.writeln(null)` will write the `"null"` string
/// before the newline. Omitting the argument, or explicitly passing an empty
/// string, is the recommended way to emit just the newline.
void writeln([Object? object = ""]);
/// Writes a string containing the character with code point [charCode].
///
/// Equivalent to `write(String.fromCharCode(charCode))`.
void writeCharCode(int charCode);
}