| 1 | |||
| 2 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 3 | ▶ | use Class::Generate qw(class); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 3 | class 'Nmap::Scanner::TaskProgress' => { | |
| 6 | qw(task Nmap::Scanner::Task | ||
| 7 | time $ | ||
| 8 | percent $ | ||
| 9 | remaining $ | ||
| 10 | etc $), | ||
| 11 | '&as_xml' => q! | ||
| 12 | |||
| 13 | my $name = $task->name(); | ||
| 14 | |||
| 15 | return qq(<taskprogress task="$name" time="$time"/>) . | ||
| 16 | qq(percent="$percent" remaining="$remaining" etc="$etc"/>\n); | ||
| 17 | |||
| 18 | ! | ||
| 19 | }; | ||
| 20 | |||
| 21 | =pod | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | This class represents Nmap live task status messages; note that the | ||
| 26 | included Nmap::Scanner::Task reference will not have an end_time() | ||
| 27 | attribute as the task has not ended yet ;). | ||
| 28 | |||
| 29 | =head1 PROPERTIES | ||
| 30 | |||
| 31 | =head2 task() | ||
| 32 | |||
| 33 | Reference to Nmap::Scanner::Task instance | ||
| 34 | |||
| 35 | =head2 time() | ||
| 36 | |||
| 37 | Time this progress event occurred. | ||
| 38 | |||
| 39 | =head2 percent() | ||
| 40 | |||
| 41 | Percent of this task done. | ||
| 42 | |||
| 43 | =head2 remaining() | ||
| 44 | |||
| 45 | Percent of this task left to do. | ||
| 46 | |||
| 47 | =head2 etc() | ||
| 48 | |||
| 49 | Estimated time to complete for this task. | ||
| 50 | |||
| 51 | =cut | ||
| 52 | |||
| 53 | 3 | 1; | |