| SWISH-Prog documentation | Contained in the SWISH-Prog distribution. |
SWISH::Prog::InvIndex::Meta - read/write InvIndex metadata
use SWISH::Prog::InvIndex; my $index = SWISH::Prog::InvIndex->new(path => 'path/to/index'); print $index->meta; # prints $index->meta->as_string
A SWISH::Prog::InvIndex::Meta object represents the metadata for an
InvIndex. It supports the Swish3 swish.xml header file format only
at this time.
Read and initialize the swish.xml header file.
The full path to the swish.xml file. This is a read-only accessor.
The SWISH::Prog::InvIndex object which the SWISH::Prog::InvIndex::Meta object represents.
Peter Karman, <perl@peknet.com>
Please report any bugs or feature requests to bug-swish-prog at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SWISH-Prog.
I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc SWISH::Prog
You can also look for information at:
Copyright 2008-2009 by Peter Karman
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| SWISH-Prog documentation | Contained in the SWISH-Prog distribution. |
package SWISH::Prog::InvIndex::Meta; use strict; use warnings; use base qw( SWISH::Prog::Class ); use Carp; use XML::Simple; our $VERSION = '0.51'; __PACKAGE__->mk_accessors(qw( invindex )); __PACKAGE__->mk_ro_accessors(qw( file )); # index metadata. read/write libswish3 file xml format. # sub init { my $self = shift; $self->SUPER::init(@_); $self->{file} ||= $self->invindex->path->file('swish.xml'); $self->{data} = XMLin("$self->{file}"); #warn Data::Dump::dump( $self->{data} ); } sub AUTOLOAD { my $self = shift; my $method = our $AUTOLOAD; $method =~ s/.*://; return if $method eq 'DESTROY'; if ( exists $self->{data}->{$method} ) { return $self->{data}->{$method}; } croak "no such Meta key: $method"; } 1; __END__