Mail::Stats::Record - Perl module for holding stats about a mailbox


MailStats documentation Contained in the MailStats distribution.

Index


Code Index:

NAME

Top

Mail::Stats::Record - Perl module for holding stats about a mailbox

SYNOPSIS

Top

  use Mail::Stats::Record;

DESCRIPTION

Top

AUTHOR

Top

  Sean Dague
  sean@dague.net
  http://dague.net/sean

SEE ALSO

Top

perl(1), Mail::Stats


MailStats documentation Contained in the MailStats distribution.

package Mail::Stats::Record;

use strict;

use vars qw($VERSION);

$VERSION = '0.1';

sub new {
  my $class = shift;
  my $this = {
	      MESSAGES => 0, # Number of messages
	      STATUS => {
			 R => 0,
			},  # Hash of statuses
	      PARSED => 0,   # Has this been parsed yet?
	     };
  
  return bless $this, $class;
}

sub num_read {
  my $this = shift;

  return $this->{STATUS}->{R};
}

sub num_unread {
  my $this = shift;
  
  return $this->{MESSAGES} - $this->{STATUS}->{R};
}

sub num_status {
  my ($this, $status) = @_;

  return $this->{STATUS}->{$status};
}

sub num_not_status {
  my ($this, $status) = @_;

  return $this->{MESSAGES} - $this->{STATUS}->{$status};
}

1;

__END__