line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Netscape::Bookmarks::Isa; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding utf8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Netscape::Bookmarks::Isa - mixin methods for object identity |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use base qw( Netscape::Bookmarks::Isa ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $bookmarks = Netscape::Bookmarks->new( $bookmarks_file ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
foreach my $element ( $bookmarks->elements ) |
16
|
|
|
|
|
|
|
{ |
17
|
|
|
|
|
|
|
print "Found category!\n" if $element->is_category; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
This module is a base class for Netscape::Bookmarks modules. Each |
23
|
|
|
|
|
|
|
object can respond to queries about its identity. Use this module |
24
|
|
|
|
|
|
|
as a mixin class. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 METHODS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Methods return false unless otherwise noted. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=over 4 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item is_category |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Returns true if the object is a Category. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=item is_link |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Returns true if the object is a Link or alias to a Link. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item is_alias |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Returns true if the object is an Alias. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item is_separator |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Returns true if the object is a Separator. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item is_collection |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Returns true if the object is a Category. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=back |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 AUTHOR |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
brian d foy C<< >> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Copyright © 2002-2018, brian d foy . All rights reserved. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
63
|
|
|
|
|
|
|
it under the terms of the Artistic License 2.0. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SEE ALSO |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
L, |
68
|
|
|
|
|
|
|
L, |
69
|
|
|
|
|
|
|
L, |
70
|
|
|
|
|
|
|
L. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
9
|
|
|
9
|
|
82
|
use strict; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
316
|
|
75
|
9
|
|
|
9
|
|
55
|
use vars qw( $VERSION ); |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
2458
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
$VERSION = "2.303"; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
my $Category = 'Netscape::Bookmarks::Category'; |
80
|
|
|
|
|
|
|
my $Link = 'Netscape::Bookmarks::Link'; |
81
|
|
|
|
|
|
|
my $Alias = 'Netscape::Bookmarks::Alias'; |
82
|
|
|
|
|
|
|
my $Separator = 'Netscape::Bookmarks::Separator'; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub is_category { |
85
|
1
|
|
|
1
|
1
|
655
|
$_[0]->is_something( $Category ); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub is_link { |
89
|
1
|
|
|
1
|
1
|
8
|
$_[0]->is_something( $Link, $Alias ); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub is_alias { |
93
|
1
|
|
|
1
|
1
|
8
|
$_[0]->is_something( $Alias ); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub is_separator { |
97
|
1
|
|
|
1
|
1
|
8
|
$_[0]->is_something( $Separator ); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub is_collection { |
101
|
1
|
|
|
1
|
1
|
6
|
$_[0]->is_something( $Category ); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub is_something { |
105
|
5
|
|
|
5
|
0
|
17
|
my $self = shift; |
106
|
|
|
|
|
|
|
|
107
|
5
|
|
|
|
|
19
|
foreach my $something ( @_ ) { |
108
|
6
|
100
|
|
|
|
62
|
return 1 if UNIVERSAL::isa( $self, $something ); |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
3
|
|
|
|
|
20
|
return 0; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
1; |