Lines Matching full:items
36 foreach ($ordinals->items(comparator => by_name()) {
88 loaded_contents => [], # Loaded items, if loading there was
91 contents => [], # Items, indexed by number
182 foreach ($self->items(sort => by_number())) {
199 same semantics as for B<< $ordinals->items >> described below, apart
219 same semantics as for B<< $ordinals->items >> described next, apart
235 foreach ($self->items(%opts, sort => by_number())) {
244 =item B<< $ordinals->items >> I<%options>
246 Returns a list of items according to a set of criteria. The criteria is
267 sub items { subroutine
284 croak __PACKAGE__."->items called with invalid filter";
291 croak __PACKAGE__."->items called with invalid filter";
299 # Put an array of items back into the object after having checked consistency
300 # If there are exactly two items:
310 my @items = @_;
312 if (scalar @items < 1 || scalar @items > 2) {
313 croak "Wrong number of items: ", scalar @items, "\n ",
314 join("\n ", map { $_->{source}.": ".$_->name() } @items), "\n";
316 if (scalar @items == 2) {
321 foreach (@items) {
329 # Check that all items we're trying to put back have the same number
330 croak "Items don't have the same numeral: ",
331 join(", ", map { $_->name()." => ".$_->intnum() } @items), "\n"
333 croak "Items don't have the same version: ",
334 join(", ", map { $_->name()." => ".$_->version() } @items), "\n"
337 # Check that both items run with the same features
338 foreach (@items) {
344 $items[0]->name(), " and ", $items[1]->name(), ":",
349 croak "Duplicate entries for ".$items[0]->name()." from ".
350 $items[0]->source()." and ".$items[1]->source()."\n"
351 if $items[0]->name() eq $items[1]->name()
352 && $items[0]->type() eq $items[1]->type()
353 && $items[0]->platforms() eq $items[1]->platforms();
355 # Check that all platforms exist in both items, and have opposite values
356 my @platforms = ( { $items[0]->platforms() },
357 { $items[1]->platforms() } );
366 .$tmp_h{$platform} } @items),
378 $items[0]->name(), " and ", $items[1]->name(), "\n";
381 $self->{contents}->[$items[0]->intnum()] = [ @items ];
466 my @items = $self->items(filter => f_name($name));
467 my $version = @items ? $items[0]->version() : $self->{currversion};
468 my $intnum = @items ? $items[0]->intnum() : ++$self->{maxnum};
469 my $number = @items ? $items[0]->number() : '?';
471 @items ? map { "\t".$_->to_string()."\n" } @items : "No previous items\n",
473 @items = grep { $_->exists() } @items;
489 push @items, $new_item;
490 print STDERR "DEBUG[",__PACKAGE__,"::add] $verbsig\n", map { "\t".$_->to_string()."\n" } @items
492 $self->_putback(@items);
538 my @items = $self->items(filter => $f_byalias);
539 foreach my $item ($self->items(filter => $f_byname)) {
540 push @items, $item unless grep { $_ == $item } @items;
542 @items = grep { $_->exists() } @items;
545 if scalar @items > 1;
546 if (scalar @items == 0) {
556 } elsif (scalar @items == 1) {
560 my %alias_platforms = $items[0]->platforms();
565 $items[0]->{platforms} = { %alias_platforms };
568 $items[0]->number() =~ m|^\?| ? '?+' : $items[0]->number();
572 type => $items[0]->type(),
574 intnum => $items[0]->intnum(),
575 version => $self->_adjust_version($items[0]->version()),
576 exists => $items[0]->exists(),
578 features => [ $items[0]->features() ]
580 push @items, $alias_item;
583 map { "\t".$_->to_string()."\n" } @items
585 $self->_putback(@items);
591 "\t", join(", ", map { $_->name() } @items), "\n";
649 foreach ($self->items(filter => sub { $_[0] eq '*' })) {
965 For the B<< $ordinals->items >> method, there are a few functions to create
1046 It's only useful when passed directly as a filter to B<items>.
1066 It's only useful when passed directly as a filter to B<items>.