NAME
slackget10::List - This class is a general List class.
VERSION
Version 0.9.0
SYNOPSIS
This class is a container of slackget10::Package object, and allow you to perform some operations on this packages list. As the Package class, it is a slack-get's internal representation of data.
use slackget10::List;
my $list = slackget10::List->new();
$list->add($element);
$list->get($index);
my $element = $list->Shift();
CONSTRUCTOR
new
This class constructor take the followings arguments :
* list_type. You must provide a string which will specialize your list. Ex:
For a slackget10::Package list :
my $packagelist = new slackget10::List (list_type => 'slackget10::Package') ;
* root-tag : the root tag of the XML generated by the to_XML method.
For a slackget10::Package list :
my $packagelist = new slackget10::List ('root-tag' => 'packagelist') ;
* no-root-tag : to disabling the root tag in the generated XML output.
For a slackget10::Package list :
my $packagelist = new slackget10::List ('no-root-tag' => 1) ;
A traditionnal constructor is :
my $speciallist = new slackget10::List (
'list_type' => 'slackget10::Special',
'root-tag' => 'special-list'
);
But look at special class slackget10::*List before creating your own list : maybe I have already do the work :)
FUNCTIONS
add
Add the element passed in argument to the list. The argument must be an object of the list_type type.
$list->add($element);
get
return the $index -nth object in the list
$list->get($index);
get_all
return a reference on an array containing all packages.
$arrayref = $list->get_all();
Shift
Same as the Perl shift. Shifts of and return the first object of the slackget10::List;
$element = $list->Shift();
If a numerical index is passed shift and return the given index.
to_XML
return an XML encoded string.
$xml = $list->to_XML();
to_HTML
return an HTML encoded string.
$xml = $list->to_HTML();
to_string
Alias for to_XML()
Length
Return the length (the number of element) of the current list. If you are interest by the size in memory you have to multiply by yourself the number returned by this method by the size of a single object.
$list->Length ;
empty
Empty the list
$list->empty ;
AUTHOR
DUPUIS Arnaud, <a.dupuis@infinityperl.org>
BUGS
Please report any bugs or feature requests to bug-slackget10@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=slackget10. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc slackget10
You can also look for information at:
Infinity Perl website
slack-get specific website
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
Thanks to Bertrand Dupuis (yes my brother) for his contribution to the documentation.
SEE ALSO
COPYRIGHT & LICENSE
Copyright 2005 DUPUIS Arnaud, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.