| Net-FCP documentation | view source | Contained in the Net-FCP distribution. |
Net::FCP::Metadata - metadata utility class.
use Net::FCP::Metadata;
Creates a new metadata Object from the given string or reference. The object is overloaded and will stringify into the corresponding string form (which might be slightly different than the string it was created from).
If no arguments is given, creates a new metadata object with just a
version part.
The object is implemented as a hash reference. See parse_metadata,
below, for info on it's structure.
Returns the string form of the metadata data.
Add a simple redirection to the document section to the given
target. All extra arguments will be added to the info subsection and
often contains description and format fields.
Internal utility function, do not use directly!
Parse a metadata string and return it.
The metadata will be a hashref with key version (containing the
mandatory version header entries) and key raw containing the original
metadata string.
All other headers are represented by arrayrefs (they can be repeated).
Since this description is confusing, here is a rather verbose example of a parsed manifest:
(
raw => "Version...",
version => { revision => 1 },
document => [
{
info => { format" => "image/jpeg" },
name => "background.jpg",
redirect => { target => "freenet:CHK\@ZcagI,ra726bSw" },
},
{
info => { format" => "text/html" },
name => ".next",
redirect => { target => "freenet:SSK\@ilUPAgM/TFEE/3" },
},
{
info => { format" => "text/html" },
redirect => { target => "freenet:CHK\@8M8Po8ucwI,8xA" },
}
]
)
Internal utility function, do not use directly!
Takes a hash reference as returned by Net::FCP::parse_metadata and
returns the corresponding string form. If a string is given, it's returned
as is.
Not heavily tested.
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/
| Net-FCP documentation | view source | Contained in the Net-FCP distribution. |