#!/usr/local/bin/perl
# $Id: entry.pm,v 1.4 2000/03/21 07:17:32 stephensk Exp $

package ion::_cvs::entry;

#print STDERR "ion::_cvs::entry\n";

@map = ( 'type', 'file', 'revision', 'date', 'extra', 'sticky', 'path', 'Repository', 'Filepath' );
%map = ();

foreach $_ ( 0 .. $#map ) {
    my($s) = $map[$_];
    my($c) = substr($s, 0, 1);
    die "Check @map" if ( $map{$c} );
    $map{$c} = $_;
    $map{$s} = $_;
}

sub type {
    $_[0]->[0];
}
sub isFile {
    $_[0]->type() ne 'D';
}
sub isDirectory {
    $_[0]->type() eq 'D';
}
sub name {
    $_[0]->[1];
}
sub version {
    $_[0]->[2];
}
sub revision { # alias
    $_[0]->[2];
}
sub date {
    $_[0]->[3];
}
sub other {
    $_[0]->[4];
}
sub sticky {
    $_[0]->[5];
}
sub path {
    $_[0]->[6];
}
sub repository {
    $_[0]->[7];
}
sub fullpath {
    $_[0]->[8];
}

sub rlog {
    if ( ! defined $_[0]->[9] ) {
	eval 'use ion::_cvs::rlog;';
	$_[0]->[9] = ion::_cvs::rlog($_[0]->repository, ($_[1] ? $_[1] : $ion::_cvs::rlog::options));
    }
}
sub clear_rlog {
    $_[0]->[9] = undef;
}

sub make {
    my($x) = @_;
    bless $x;
}

1;
