Apache::CVS::PlainFile - class that implements a file in CVS


Apache-CVS documentation Contained in the Apache-CVS distribution.

Index


Code Index:

NAME

Top

Apache::CVS::PlainFile - class that implements a file in CVS

SYNOPSIS

Top

 use Apache::CVS::PlainFile();

 $file = Apache::CVS::PlainFile->new($path);

 $path = $file->path();
 $name = $file->name();

DESCRIPTION

Top

The Apache::CVS::PlainFile class implements a base file that resides in a CVS repository. A versioned file is implemented by the class Apache::CVS::VersionPlainFile.

$file = Apache::CVS::PlainFile->new($path)

Construct a new Apache::CVS::PlainFile object with the given path.

$file->path()

Returns the full path of this file.

$file->name()

Returns just the filename of this file.

SEE ALSO

Top

Apache::CVS, Apache::CVS::File, Apache::CVS::Directory

AUTHOR

Top

John Barbee <barbee@veribox.net>

COPYRIGHT

Top


Apache-CVS documentation Contained in the Apache-CVS distribution.
# $Id: PlainFile.pm,v 1.2 2002/04/23 04:19:05 barbee Exp $

package Apache::CVS::PlainFile;

use strict;

$Apache::CVS::PlainFile::VERSION = $Apache::CVS::VERSION;

sub new {
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self = {};

    $self->{path} = shift;

    bless ($self, $class);
    return $self;
}

sub path {
    my $self = shift;
    $self->{path} = shift if scalar @_;
    return $self->{path};
}

sub name {
    my $self = shift;
    $self->{path} =~ m#\/([^\/]*)$#;
    return $1;
}

1;