VCS-CMSynergy

 view release on metacpan or  search on metacpan

lib/VCS/CMSynergy.pod  view on Meta::CPAN

C<@keywords>.  If the value of a keyword is undefined, C<undef> is returned
(whereas B<ccm properties> would print it as the string C<< "<void>" >>).

=head1 MISCELLANEOUS METHODS

=head2 cat_object

  $contents = $ccm->cat_object($object);
  $ccm->cat_object($object, $destination);

Retrieves the contents (the "source" in Synergy terminology)
of an object without the need for a workarea using B<ccm cat>. 

For both forms above, C<$object> must be a C<VCS::CMSynergy::Object>.
The first form returns the object's contents as a string (and
C<undef> on error). The second form "writes" the object's contents
to C<$destination> which can be any of the following:

=over 4

=item scalar

the contents will be written into a file named C<$destination>

=item SCALAR reference

the contents will be written into the buffer (string) C<$$destination> 

=item file handle or GLOB reference

the contents will be written (C<print>ed) onto the file handle

=back

Note the following difference from B<ccm cat>:

=over 4

=item *

C<cat_object> only accepts a single C<VCS::CMSynergy::Object>
as argument

=back

=head2 types

  @types = $ccm->types;

Returns an array of types using B<ccm show -types>.

=head2 migrate_auto_rules

  @mars = $ccm->migrate_auto_rules;

Uses B<ccm show -migrate_auto_rules> to return an array
of arrays (of three elements each), e.g.

  @mars = (
    [ 'MAP_FILE_TO_TYPE',   '.*\\.xml$',       'xml'             ],
    [ 'MAP_FILE_TO_TYPE',   '.*\\.o$',         'relocatable_obj' ],
    [ 'MAP_TYPE_TO_IGNORE', 'relocatable_obj', 'TRUE'            ],
    ...);

=head2 ls

  $aref = $ccm->ls(@args);

Executes the B<ccm ls> command with the given C<@args> as parameters.
The output (as formatted by the C<-format> option) is split into lines.
These are L<chomp|perlfunc/chomp>ed and a reference to the resulting array
of strings is returned. 

If there was an error, C<undef> is returned.

Note that you must pass every B<ccm ls> argument or option as a single
Perl argument. 

If you are interested to obtain the value of several attributes,
you should look at the L</ls_arrayref>
and L</ls_hashref> methods that return this information in 
structured form. If you are only interested in the identity of
the listed objects, you should look at the L</ls_object> method.

=head2 ls_object

  $aref = $ccm->ls_object($file_spec, @keywords);

Lists information about a file or the contents of a directory
using the work area name C<$file_spec>.
Returns a reference to an array of corresponding C<VCS::CMSynergy::Object>s.

Calling C<ls_object> with an optional list of C<@keywords> 
is only useful when L</:cached_attributes> is in effect. 
In this case the returned C<VCS::CMSynergy::Object>s have their attribute caches
primed for the attributes listed in C<@keywords>.

=head2 ls_arrayref

  $aref = $ccm->ls_arrayref($file_spec, @keywords);

Lists the values of the built-in keywords or attributes supplied
in C<@keywords> for a file or the contents of a directory
Returns a reference to an array of references,
one per result row. Each reference points to an array containing
the values of the keywords for that particular object
(in the order given by C<@keywords>). 

If there was an error, C<undef> is returned.

If the value of a keyword or an attribute is undefined or
the attribute is not present, the actual value of the corresponding
array element is C<undef> (whereas B<ccm ls> would print it as
the string C<< "<void>" >>).

Note that the keyword or attribute names given in C<@keywords> should I<not>
contain a leading C<%>. Example:

  my $result = $ccm->ls('foo', qw(displayname type modify_time);
  foreach my $row (@$result)
  {
    my ($displayname, $type, $modify_time) = @$row;



( run in 1.030 second using v1.01-cache-2.11-cpan-71847e10f99 )