ePages 6.17.52 - DE_EPAGES/Core/API/Object/ProgressMonitor.pm

Package DE_EPAGES::Core::API::Object::ProgressMonitor

This module implements a progress monitor for command line.

Example
use DE_EPAGES::Core::API::Object::ProgressMonitor;

my $Progress = DE_EPAGES::Core::API::Object::ProgressMonitor->new(
    'ContentTemplate' => "%4d of %4d products exported.\n",
    'Total'          => 50,
    'Current'        => 0,
);
for (my $i=1;$i<=50;$i++) {
    $Progress->set('Current', $i);
    $Progress->write;
}

Functions

incCurrent
new
reset
write

incCurrent

return the current exported element

Syntax
$Current = $self->incCurrent;
Return
$Current (integer)
current status

new

starts the progress monitor for command line requests

Syntax
$ProgressMonitor = __PACKAGE__->new(%options);
Input
%options (hash)
following keys are used :
  • ContentTemplate - template for printf (optional) - string
  • Total - 100 percent (optional) - int
  • Current - current state (optional default=0) - int
Return
$ProgressMonitor (object)
monitor

reset

resets the monitor sets internal Current = 0 and StartTime to now.

Syntax
$Monitor->reset;

write

write the monitor content

Syntax
$ProgressMonitor->write;