NAME

ClearCase::Vob::CanonPath - Reduce an 'explicit path' to a 'canonical path'

VERSION

This document describes version 0.06, released August, 2003.

SYNOPSIS

     use ClearCase::Vob::CanonPath;
or   use ClearCase::Vob::CanonPath  qw( Debug );

     $canonPath = ClearCase::Vob::CanonPath->parse( $explicitPath );

or   $cpathObj  = new ClearCase::Vob::CanonPath;
     $canonPath = $cpathObj->parse( $explicitPath );

     my($stat,$err) = $cpathObj->status;
     $stat and die $err;

DESCRIPTION

Given an 'explicit path' to an element in a ClearCase Vob reduce it to a 'canonical path'

Constructor

new

A constructor is provided for convenience. The methods in this module work as either class or object methods. Adding a Debug parm to the use statement will result in several extra lines of output on STDERR during path parsing.

Example:

    use ClearCase::Vob::CanonPath;
or  use ClearCase::Vob::CanonPath  qw( Debug );

    $cpathObj = new ClearCase::Vob::CanonPath;

Methods

canonpath ( ExplicitPath )
parse ( ExplicitPath )

Reduce an 'explicit path' to a 'canonical path.' The canonpath and parse methods are synonymous.

Examples:

$explicitPath = '/vobTag/users/.@@/main/1/llf/main/12/install/main/1/README/main/2';

$canonPath = ClearCase::Vob::CanonPath->parse( $explicitPath );

$canonPath = $cpathObj->parse( $explicitPath );

Where $canonPath will, in this example, contain the following string.

/vobTag/users/llf/install/README
origpath
fspath
leaf
branch
version
branchver

Obtain various attributes collected during a prior successful call to the canonpath method.

$origpath  = $cpathObj->origpath;     # original "view extended" path
$fspath    = $cpathObj->fspath;       # canonical file system path
$leaf      = $cpathObj->leaf;         # leaf name only from fspath
$branch    = $cpathObj->branch;       # leaf's "/branch" (if any)
$version   = $cpathObj->version;      # leaf's version   (if any)
$branchver = $cpathObj->branchver;    # "/branch/ver"    (if any)
status
stat
err

Determine whether an error occurred during the last call to a method on this object. The stat method returns different values depending on the calling context.

($stat,$err) = $cpathObj->status;

$stat = $cpathObj->stat;
($err)= $cpathObj->stat;

$err = $cpathObj->err;

WARNINGS

This class does not work when an element name contains '@@' chars (which, while valid in ClearCase, is a really dumb thing to do).

Note, however, that this class does successfully handle the case where an element is named 'main'.

INHERITANCE

None currently.

AUTHOR

Douglas B. Robinson, <robinson@cup.hp.com> and Chris Cobb, <chris@ccobb.net>.

COPYRIGHT

Copyright (c) 2003 by Hewlett-Packard. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 317:

'=item' outside of any '=over'

Around line 358:

You forgot a '=back' before '=head1'