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 IS AN ABANDONED MODULE. THERE IS NO SUPPORT. YOU CAN ADOPT IT |
23
|
|
|
|
|
|
|
IF YOU LIKE: https://pause.perl.org/pause/query?ACTION=pause_04about#takeover |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
This module is a base class for Netscape::Bookmarks modules. Each |
26
|
|
|
|
|
|
|
object can respond to queries about its identity. Use this module |
27
|
|
|
|
|
|
|
as a mixin class. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 METHODS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Methods return false unless otherwise noted. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=over 4 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=item is_category |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Returns true if the object is a Category. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item is_link |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Returns true if the object is a Link or alias to a Link. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item is_alias |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Returns true if the object is an Alias. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item is_separator |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Returns true if the object is a Separator. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item is_collection |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Returns true if the object is a Category. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=back |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 AUTHOR |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
brian d foy C<< >> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Copyright © 2002-2019, brian d foy . All rights reserved. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
66
|
|
|
|
|
|
|
it under the terms of the Artistic License 2.0. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 SEE ALSO |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
L, |
71
|
|
|
|
|
|
|
L, |
72
|
|
|
|
|
|
|
L, |
73
|
|
|
|
|
|
|
L. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
9
|
|
|
9
|
|
62
|
use strict; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
231
|
|
78
|
9
|
|
|
9
|
|
38
|
use vars qw( $VERSION ); |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
1816
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$VERSION = "2.304"; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
my $Category = 'Netscape::Bookmarks::Category'; |
83
|
|
|
|
|
|
|
my $Link = 'Netscape::Bookmarks::Link'; |
84
|
|
|
|
|
|
|
my $Alias = 'Netscape::Bookmarks::Alias'; |
85
|
|
|
|
|
|
|
my $Separator = 'Netscape::Bookmarks::Separator'; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub is_category { |
88
|
1
|
|
|
1
|
1
|
601
|
$_[0]->is_something( $Category ); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub is_link { |
92
|
1
|
|
|
1
|
1
|
6
|
$_[0]->is_something( $Link, $Alias ); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub is_alias { |
96
|
1
|
|
|
1
|
1
|
6
|
$_[0]->is_something( $Alias ); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub is_separator { |
100
|
1
|
|
|
1
|
1
|
4
|
$_[0]->is_something( $Separator ); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub is_collection { |
104
|
1
|
|
|
1
|
1
|
3
|
$_[0]->is_something( $Category ); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub is_something { |
108
|
5
|
|
|
5
|
0
|
10
|
my $self = shift; |
109
|
|
|
|
|
|
|
|
110
|
5
|
|
|
|
|
10
|
foreach my $something ( @_ ) { |
111
|
6
|
100
|
|
|
|
36
|
return 1 if UNIVERSAL::isa( $self, $something ); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
3
|
|
|
|
|
11
|
return 0; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
1; |