RIFF/List.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod 50.0% 1 / 2 totaltotal 71.4% 10 / 14 CC 1 SCAR 2.9
CC
1
Cov
78%
read
2.0
BEGIN
1.0
new
1.0
CRAP 1.3
« RIFF/Container.pm ↑ Summary
1 package File::Format::RIFF::List;
2 3 ▶use base File::Format::RIFF::Container;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4  
5 3 our $VERSION = '0.08';
6  
7  
8 sub new
9 3 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod documented
10 3 my ( $proto, $type, $data ) = @_;
11 3 return $proto->SUPER::new( $type, 'LIST', $data );
12 }
13  
14  
15 sub read
16 0 ▶{
Subroutine read: not called CC=1 SCAR=6.9
Pod undocumented
17 0 my ( $proto, $fh ) = @_;
18 0 return $proto->SUPER::read( 'LIST', $fh );
19 }
20  
21  
22 3 1;
23  
24  
25 =pod
26  
27 =head1 NAME
28  
29 File::Format::RIFF::List - a single RIFF list
30  
31 =head1 SYNOPSIS
32  
33 use File::Format::RIFF;
34 my ( $list ) = new File::Format::RIFF::List;
35 $list->type( 'stuf' );
36 $list->addChunk( abcd => 'a bunch of data' );
37 $list->addList( 'alst' )->addChunk( xyzw => 'more data' );
38 print $list->numChunks, "\n";
39  
40 ... some $container ...
41  
42 $container->push( $list );
43  
44 =head1 DESCRIPTION
45  
46 A C<File::Format::RIFF::List> is a list of data in a RIFF file. It has an
47 identifier, a type, and an array of data. The id is always 'LIST'. The
48 type must be a four character code, and the data is an array of other RIFF
49 lists and/or RIFF chunks.
50  
51 =head1 CONSTRUCTOR
52  
53 =over 4
54  
55 =item $list = new File::Format::RIFF::List( $type, $data );
56  
57 Creates a new File::Format::RIFF::List object. C<$type> is a four character
58 code that identifies the type of this RIFF list. If C<$type> is not
59 specified, it defaults to C<' '> (four spaces). C<$data> must be an
60 array reference containing some number of RIFF lists and/or RIFF chunks.
61 If C<$data> is C<undef> or not specified, then the new list object is
62 initialized empty.
63  
64 =back
65  
66 =head1 SEE ALSO
67  
68 =over 4
69  
70 C<File::Format::RIFF::List> inherits from C<File::Format::RIFF::Container>,
71 so all methods available for Containers can be used on RIFF lists. A
72 Container essentially contains an array of RIFF lists and/or RIFF chunks.
73 See the L<File::Format::RIFF::Container> man page for more information.
74  
75 =back
76  
77 =head1 AUTHOR
78  
79 Paul Sturm E<lt>I<sturm@branewave.com>E<gt>
80  
81 =cut
« RIFF/Container.pm ↑ Summary