Progress class abstract
central class that provides progress information about a running process.
Constructors
- Progress(LineAction stdout, {LineAction stderr = devNull, bool captureStdout = false, bool captureStderr = false, Encoding encoding = utf8})
-
Creates a Progress that allows you to individually control what
output is sent to each of the LineActions and what is captured
to the lines array.
You must provide a stdout LineAction but stderr are sent to devNull
unless you pass a
stderrLineAction By default no output is captured to the lines array unless you setcaptureStdoutorcaptureStderrto true. Useencodingto control how output bytes are decoded into strings.factory - Progress.both(LineAction both, {Encoding encoding = utf8})
-
redirect both stdout and stderr to the same LineAction
Note: to capture stderr you must pass 'throws: false' to
the start process method.
Use
encodingto control how output bytes are decoded into strings.factory - Progress.capture({bool captureStdout = true, bool captureStderr = true, Encoding encoding = utf8})
-
Captures the output of the called process to a list which
can be obtained by calling Progress.lines once
the process completes.
By default both stdout and stderr are captured.
Set
captureStdoutto false to suppress capturing of stdout. SetcaptureStderrto false to suppress capturing of stderr. Useencodingto control how output bytes are decoded into strings.factory - Progress.devNull({Encoding encoding = utf8})
-
Use this progress to have both stdout and stderr output
suppressed.
Use
encodingto control how output bytes are decoded into strings.factory - Progress.print({bool capture = false, Encoding encoding = utf8})
-
Use this progress to print both stdout and stderr.
If
captureis true (defaults to false) the output to stdout and stderr is also captured and will be available in lines once the process completes. Useencodingto control how output bytes are decoded into strings.factory - Progress.printStdErr({bool capture = false, Encoding encoding = utf8})
-
Use this progress to only output data sent to stderr.
If
captureis true (defaults to false) the output to stderr is also captured and will be available in lines once the process completes. Useencodingto control how output bytes are decoded into strings.factory - Progress.printStdOut({bool capture = false, Encoding encoding = utf8})
-
Use this progress to only output data sent to stdout.
If
captureis true (defaults to false) the output to stdout is also captured and will be available in lines once the process completes. Useencodingto control how output bytes are decoded into strings.factory - Progress.stream({bool includeStderr = false, Encoding encoding = utf8})
-
factory
Properties
- exitCode → int?
-
no setter
- firstLine → String?
-
Returns the first line from the command or
null if no lines where generated
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
lines
→ List<
String> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
List< int> > -
no setter
Methods
-
forEach(
void print(String line)) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toList(
) → List< String> -
toParagraph(
) → String -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited