NAME
SVN::Dumpfile::Node::Headers - Represents the header of a node in a subversion dumpfile.
SYNOPSIS
Objects of this class are used in SVN::Dumpfile::Node objects. For normal dumpfile operations this subclass is an implementation detail. Some scripts however might need to use methods of the class directly.
use SVN::Dumpfile; # or use SVN::Dumpfile::Node:Content;
$df = new SVN::Dumpfile ("filename");
$node = $df->read_node;
my $header = $node->headers;
$header->{'Node-path'} =~ s/old/new/;
# but should be done using:
$node->header('Node-path') =~ s/old/new/;
DESCRIPTION, SEE ALSO, AUTHOR, COPYRIGHT
See SVN::Dumpfile.
METHODS
- new()
-
Returns a new SVN::Dumpfile::Node::Headers object. Headers line can be given as hash reference, as array reference or as list. Array and list must be even and contain key/value pairs like a hash. For internal reasons a single but undefined argument is ignored. The method returns undef if the number or kind of arguments are incorrect.
- number()
-
Returns the number of header lines. Can be taken as bool to check if there are any headers.
- read($filehandle)
-
Reads header lines from the given filehandle. This lines must be in the format 'Name: value' and must be followed by a blank line. The method croaks when a miss-formatted line is found.
- as_string()
- to_string()
-
Returns all header lines as one string without the needed blank line separator which must be added manually. The header lines are always returned in a pre-defined order, unlike properties.
- write($filehandle)
-
Writes all header lines and a blank line as separator to the given filehandle. The header lines are always written in a pre-defined order, unlike properties.
- sanitycheck()
-
Checks the header is consistent, i.e. if the combination of header lines makes sens. This method is work in progress and might not work at all at the moment.