NAME

ProgressMonitor::Stringify::ToEscStatus - monitor printing in EscStatus form

SYNOPSIS

use PerlIO::via::ToEscStatus;
binmode (STDOUT, ':via(EscStatus)') or die;

use ProgressMonitor::Stringify::ToEscStatus;
my $mon = ProgressMonitor::Stringify::ToEscStatus->new
  ({ fields => [
       ProgressMonitor::Stringify::Fields::Spinner->new
  ]});

$mon->prepare;
$mon->begin;
$mon->tick; $mon->tick; ...
$mon->end;

CLASS HIERARCHY

ToEscStatus is a subclass of AbstractMonitor,

ProgressMonitor
  ProgressMonitor::AbstractStatefulMonitor
    ProgressMonitor::Stringify::AbstractMonitor
      ProgressMonitor::Stringify::ToEscStatus

DESCRIPTION

ToEscStatus implements a ProgressMonitor which prints status lines in EscStatus form, ready to be shown by an EscStatus layer on the output stream.

Basically where ProgressMonitor::Stringify::ToStream would do something like print "\rStatus line", ToEscStatus instead does

print make_status("Status line")

giving the output string form EscStatus uses. The contents of the status line are built by configured ProgressMonitor field objects in the usual way. See examples/progressmonitor.pl in the EscStatus sources for a demo.

FUNCTIONS

ProgressMonitor::Stringify::ToEscStatus->new({key=>value,...})

Create and return a new ToEscStatus progress monitor object. Configuration parameters are taken in usual Moose style as a single hashref argument. This will normally at least include a fields array of objects to do the rendering.

See ProgressMonitor::Stringify::AbstractMonitor for the base configuration parameters. ToEscStatus has the following additional parameters

stream (default STDOUT)

A file handle to write to. The default is standard output, ie. \*STDOUT (like ProgressMonitor::Stringify::ToStream uses).

ToEscStatus doesn't check what layers are on the stream. If for instance you're printing to tty then it's your responsibility to push a PerlIO::via::EscStatus. Similarly it's your responsibility to set :utf8 mode (or not) if desired.

SEE ALSO

ProgressMonitor, PerlIO::via::EscStatus, Moose

HOME PAGE

http://www.geocities.com/user42_kevin/perlio-via-escstatus/index.html

LICENSE

Copyright 2008 Kevin Ryde

PerlIO-via-EscStatus is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

PerlIO-via-EscStatus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PerlIO-via-EscStatus. If not, see http://www.gnu.org/licenses/.