line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CatalystX::CRUD::Iterator::File; |
2
|
1
|
|
|
1
|
|
1147
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
239
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.58'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
CatalystX::CRUD::Iterator::File - simple iterator for CXCO::File objects |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $iterator = $c->model('MyFile')->iterator; |
15
|
|
|
|
|
|
|
while (my $file = $iterator->next) |
16
|
|
|
|
|
|
|
{ |
17
|
|
|
|
|
|
|
# $file is a CatalystX::CRUD::Object::File |
18
|
|
|
|
|
|
|
# ... |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
CatalystX::CRUD::Iterator::File is a simple iterator to fulfull the |
25
|
|
|
|
|
|
|
CatalystX::CRUD::Model::File API. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 METHODS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 new( I<files> ) |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Returns an iterator for I<files>. I<files> should be an array ref. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub new { |
38
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
39
|
0
|
0
|
|
|
|
|
my $files = shift or croak "need files array"; |
40
|
0
|
|
|
|
|
|
return bless( $files, $class ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 next |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Returns the next File object or undef if no more files remain. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub next { |
50
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
51
|
0
|
|
|
|
|
|
return shift(@$self); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 finish |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Sets the array ref to empty. Always returns 1. This method is |
57
|
|
|
|
|
|
|
generally useless but implemented for completeness' sake. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub finish { |
62
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
63
|
0
|
|
|
|
|
|
my $class = ref $self; |
64
|
0
|
|
|
|
|
|
$self = bless( [], $class ); |
65
|
0
|
|
|
|
|
|
return 1; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Peter Karman, C<< <perl at peknet.com> >> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 BUGS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
79
|
|
|
|
|
|
|
C<bug-catalystx-crud at rt.cpan.org>, or through the web interface at |
80
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CatalystX-CRUD>. |
81
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
82
|
|
|
|
|
|
|
your bug as I make changes. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 SUPPORT |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
perldoc CatalystX::CRUD |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
You can also look for information at: |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=over 4 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L<http://annocpan.org/dist/CatalystX-CRUD> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * CPAN Ratings |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/CatalystX-CRUD> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=CatalystX-CRUD> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * Search CPAN |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/CatalystX-CRUD> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=back |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Copyright 2007 Peter Karman, all rights reserved. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
117
|
|
|
|
|
|
|
under the same terms as Perl itself. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |