The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

VCS::LibCVS::Datum::FileContents - File contents for use in CVS

SYNOPSIS

 $fc = VCS::LibCVS::Datum::FileContents->new("/cvs/dir/new.c");
 $rq = VCS::LibCVS::Client::Request::Modified->new(["new.c",$mode,$fc]);

DESCRIPTION

Datum::FileContents presents the contents of a file in a way which is suitable for the various purposes of LibCVS. Important aspects are the transmission of the length of the file before the contents of the file itself, and the conversion of line terminators.

A Datum::FileContents does not consist of a group of lines, so it is handled differently from the others and it overrides most of the class routines.

SUPERCLASS

  VCS::LibCVS::Datum

CLASS ROUTINES

new()

$arg = Datum::FileContents->new($data)

return type: Datum::FileContents
argument 1 type: ...
option 1: IO::Handle

An IO::Handle object from which the file data will be read. The file data must arrive over the IO::Handle in the same manner as the CVS protocol, ie. a file length in bytes followed by newline followed by the file transmission.

option 2: scalar

The name of a file in the local file system. This file will not be read until the Datum is accessed, so if it changes results may be unpredictable.

option 3: Datum::FileContents

If the argument is already a Datum::FileContents object, it will be returned. It will not be copied.

option 4: \%hash ref

If the hash ref contains a parameter named 'scalar', it will be used as the entire contents of the file.

Construct a new Datum::FileContents. The IO::Handle option is generally used when reading responses from the server, the others when constructing requests.

INSTANCE ROUTINES

as_string()

$datum->as_string()

return type: scalar string

Returns the file contents as a scalar, which should not be modified.

as_protocol_string()

$file_contents = $datum->as_protocol_string()

return type: string scalar

Returns the Datum::FileContents as a string suitable for being sent to the server: filelength, newline, filecontents.

SEE ALSO

  VCS::LibCVS::Datum