NAME

File::VirusScan::Result - Results from a single virus scanner

SYNOPSIS

    use File::VirusScan::Result;

    # It's good
    return File::VirusScan::Result->clean();

    # It's bad
    return File::VirusScan::Result->virus( 'MyDoom' );

    # It's ugly (er, an error)
    return File::VirusScan::Result->error( "Could not execute virus scanner: $!" );

    # And, in the caller....
    if( $result->is_error() ) {
	...
    } elsif ( $result->is_virus() ) {
	...
    }

DESCRIPTION

Encapsulate all return data from a virus scan. Currently, just holds clean/virus/error status, along with a virus name or error message.

CLASS METHODS

clean ( )

Create a new object, with no flags set and no data.

error ( $error_message )

Create a new object with state set to 'error' and data set to $error_message.

virus ( $virusname )

Create a new object with state set to 'virus', and data set to $virusname.

suspicious ( $what )

Create a new object with state set to 'suspicious', and data set to $what.

new ( \%data )

Main constructor.

INSTANCE METHODS

get_state ( )

Return the state of this result object. Valid states are:

clean
error
virus
suspicious

is_clean ( )

Returns true if state is set to 'clean'

is_error ( )

Returns true if state is set to 'error'

is_virus ( )

Returns true if state is set to 'virus'

is_suspicious ( )

Returns true if state is set to 'suspicious'

get_data ( )

Return data value.

AUTHOR

Dave O'Neill (dmo@roaringpenguin.com)

LICENCE AND COPYRIGHT

Copyright (c) 2007 Roaring Penguin Software, Inc.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, or (at your option) any later version.