SVN::Dumpfile::Node::Content - Represents the content of a node in a subversion dumpfile.
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 $content = $node->content; # Saves or loads content to file: $content->load('filename'); $content->save('filename');
The stringification operator '""' is overloaded to call as_string(). So the following two lines give identical results:
"text " . $content->as_string() . " text" "text $content text"
Please note that the content can include binary elements.
Returns a new SVN::Dumpfile::Node::Content object. A initial content can be given as argument.
Returns true if there is a defined, not empty content.
Deletes the content of the object (but not the object itself). Don't forget to remove the corresponding header lines by mark the node changed().
- value("new value")
- value()= "new value"
Returns or sets the content which is returned as lvalue.
Returns the content as one string. Please note that the string can contain binary elements. This is identical to call value() without an argument and not using it as lvalue.
- read($filehandle, $length)
Reads <length> bytes from the given filehandle and stores them as content. Returns true if successful.
Writes the content to the given filehandle. Returns true if successful. Returns true if successful.
Saves the content in the given file which is created when given as name. This is used to export the content and so differs from write(). Returns true if successful.
Loads the content from a given file. The whole file is taken as content. This is used to import content from an external file and so differs from read(). Returns the number of bytes of the loaded content if successful, undef otherwise.
Returns the number of line breaks (NL, "\012") in the content. This can be used to keep track of the current line number of the dumpfile for warning or error messages, etc..
Returns the length in bytes of the content. To check if there is any content use exists().