'or' separated field abstraction
This document describes Debian::Copyright::Stanza::OrSeparated version 0.2 .
my $f = Debian::Copyright::Stanza::OrSeparated->new('Artistic'); $f->add('GPL-1+ or BSD'); print $f->as_string; # 'Artistic or GPL-1+ or BSD' print "$f"; # the same $f->sort;
Debian::Copyright::Stanza::OrSeparated abstracts handling of the License fields in Files blocks, which are lists separated by 'or'. It also supports a body field representing the optional extended description of a License field.
The initial values list is parsed and may contain strings that are in fact 'or'-separated lists. These are split appropriately using Text::ParseWords' \*(C`quotewords\*(C' routine.
Returns text representation of the list. A simple join of the elements by \*(C` or \*(C'. The same function is used for overloading the stringification operation.
Natural implementation of the equality function. Adds the given items to the list. Items that are already present are not added, keeping the list unique.
A handy method for sorting the list.
Copyright (C) 2011-12 Nicholas Bamber [email protected]
This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.