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

NAME

VCS::LibCVS::Datum - a piece of CVS data

SYNOPSIS

 $mode = VCS::LibCVS::Datum::Mode->new("u=rw,g=rw,o=r");
 $rq = VCS::LibCVS::Client::Request::Modified->new(["file",$mode,$file]);

DESCRIPTION

Datum represents a single piece of CVS data, such as an entries line, a file mode or a tag spec. It has subclasses for each type of CVS data. Datum should not to be instantiated, instead its subclasses should be instantiated.

To access the contained data see the accessors for each subclass.

CLASS ROUTINES

new()

$data = Datum::Subclass->new($data)

Only call this on subclasses of Datum. Some subclasses override this constructor.

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

An IO::Handle object from which the Datum will be read. Most Datum are line oriented, so they will read one or more lines from the IO::handle.

option 2: scalar

If the Datum consists of a single line, it can be passed as a scalar.

option 3: \@array ref

If the Datum consists of one or more lines, they can be passed as an array ref.

option 4: Datum::Subclass

If the argument is an object of the type which is being constructed, the argument itself will be returned. It will not be copied.

This is used by the Client::Request constructor which blindly passes its args to the Datum constructor. That way the user has the freedom to construct their own Datum and pass it to the Client::Request constructor.

Construct a new Datum. The IO::Handle option is used for reading a Datum from the server, the others when constructing it locally.

INSTANCE ROUTINES

as_string()

$datum_string = $datum->as_string()

return type: string scalar

Returns the Datum as a string.

protocol_print()

$datum->protocol_print($file_handle)

return type: undef
argument 1 type: IO::Handle

Prints the Datum to the IO::Handle. The output will be formatted for sending to the cvs server, including the placement of newlines.

as_protocol_string()

$datum_string = $datum->as_protocol_string()

return type: string scalar

Returns the Datum as a string suitable for being sent to the server, including the placement of newlines.

equals()

if ($datum1->equals($datum2)) {

return type: boolean
argument 1 type: VCS::LibCVS::Datum

Returns true if the data contain the same information (and are of the same type)

SEE ALSO

  VCS::LibCVS::Datum::DirectoryName
  VCS::LibCVS::Datum::Entry
  VCS::LibCVS::Datum::FileContents
  VCS::LibCVS::Datum::FileMode
  VCS::LibCVS::Datum::FileName
  VCS::LibCVS::Datum::PathName
  VCS::LibCVS::Datum::Root
  VCS::LibCVS::Datum::String
  VCS::LibCVS::Datum::TagSpec
  VCS::LibCVS::Datum::Time