NAME

SVN::Dumpfile::Node::Properties - Represents the properties of a node in a Subversion dumpfile.

SYNOPSIS

Objects of this class are used in SVN::Dumpfile::Node objects, but can also be used independently for manipulating Subversion revision property files.

use SVN::Dumpfile::Node:Properties;
my $prop = new SVN::Dumpfile::Node::Properties;
$prop->load('filename');
...
$prop->save('filename');

DESCRIPTION, SEE ALSO, AUTHOR, COPYRIGHT

See SVN::Dumpfile.

METHODS

new()

Returns a new SVN::Dumpfile::Node::Properties object. Properties can be given as hash reference, array reference or as a list. Array or list must be even an hold key/value pairs and must be used if the order of the given properties should be maintained.

number()

Returns the number of properties.

add('property', $value)
add('property', $value, $position)

Adds the property with the given value at given position or at the end. Order of properties is maintained to support the creation of identical output files.

del('property')

Deletes a property from the instance. Note if the properties are written in differential form the property will retrain its value from the last changed revision when not written. Use mark_deleted() to mark the property as deleted in this case.

mark_deleted('property')

Marks a property as deleted. This is for differential property blocks which are only supported in dumpfile version 3 or later. It automatically calls del() on the property.

unmark_deleted('property')

Unmarks a property as deleted. This is for differential property blocks which are only supported in dumpfile version 3 or later. The property is not added to the node, use add() to do this.

is_deleted('property')

Returns if a property is marked as deleted. See also mark_deleted().

list_deleted()

Returns an array of all properties currently marked as deleted. See also mark_deleted.

parse($stringref)

Internal method to parse single property format element from string. The element is removed from the string and returned as (ID, value) pair.

from_string('string')

Reads the properties from string by repeatly calling parse().

read($filehandle, $length)

Reads <length> bytes from filehandle and parses them as properties by calling from_string().

write($filehandle)

Writes the properties in subversion dumpfile format to the given filehandle.

load($filename)
load($filehandle)

Loads the properties from a subversion revision property file.

save($filename)
save($filehandle)

Saves the properties to a subversion revision property file.

length()

Returns the length of the string returned by as_string().

as_string()
as_string(1)
to_string()
to_string(1)

Returns all properties as one string formatted in the format needed for subversion dumpfiles. If a true value is given as argument the format is that of subversion revision property files is used ('END' instead of 'PROPS-END').