line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebShortcutUtil; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
23379
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
80
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.21'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# REFERENCES |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# Free Desktop: |
11
|
|
|
|
|
|
|
# http://standards.freedesktop.org/desktop-entry-spec/latest/ (used Version 1.1-draft) |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Windows URL (also applicable to Website): |
14
|
|
|
|
|
|
|
# http://stackoverflow.com/questions/539962/creating-a-web-shortcut-on-user-desktop-programmatically |
15
|
|
|
|
|
|
|
# http://stackoverflow.com/questions/234231/creating-application-shortcut-in-a-directory |
16
|
|
|
|
|
|
|
# http://delphi.about.com/od/internetintranet/a/lnk-shortcut.htm |
17
|
|
|
|
|
|
|
# http://read.pudn.com/downloads3/sourcecode/windows/system/11495/shell/shlwapi/inistr.cpp__.htm |
18
|
|
|
|
|
|
|
# http://epiphany-browser.sourcearchive.com/documentation/2.24.0/plugin_8cpp-source.html |
19
|
|
|
|
|
|
|
# http://epiphany-browser.sourcearchive.com/documentation/2.24.0/plugin_8cpp-source.html |
20
|
|
|
|
|
|
|
# |
21
|
|
|
|
|
|
|
# Webloc / Plist: |
22
|
|
|
|
|
|
|
# http://search.cpan.org/~bdfoy/Mac-PropertyList-1.38/ |
23
|
|
|
|
|
|
|
# or https://github.com/briandfoy/mac-propertylist |
24
|
|
|
|
|
|
|
# http://opensource.apple.com/source/CF/CF-550/CFBinaryPList.c |
25
|
|
|
|
|
|
|
# http://code.google.com/p/cocotron/source/browse/Foundation/NSPropertyList/NSPropertyListReader_binary1.m |
26
|
|
|
|
|
|
|
# http://www.apple.com/DTDs/PropertyList-1.0.dtd |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
WebShortcutUtil - Perl module for reading and writing web shortcut files |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This module is part of the WebShortcutUtil suite. For more details |
36
|
|
|
|
|
|
|
see the main website at http://beckus.github.io/WebShortcutUtil/ . |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
All of the subroutines are contained in the Read and Write submodules. |
39
|
|
|
|
|
|
|
See those submodules for usage information. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
A brief list of the supported shortcut types: |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=over 4 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item * .desktop - Free Desktop shortcut (used by Linux) |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item * .url - Used by Windows |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item * .website - Used by Windows |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item * .webloc - Used by Mac |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=back |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
In order to read/write ".webloc" files, the Mac::PropertyList module (http://search.cpan.org/~bdfoy/Mac-PropertyList/) |
56
|
|
|
|
|
|
|
must be installed. Mac::PropertyList is listed as a dependency, but the the WebShortcutUtil |
57
|
|
|
|
|
|
|
module will still test out and install properly if it is not present. The webloc subroutines will die |
58
|
|
|
|
|
|
|
if the Mac::PropertyList module is not installed. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Note that this module is still beta-quality, and the interface is subject to change. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 SOURCE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
https://github.com/beckus/WebShortcutUtil-Perl |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 FUTURE IDEAS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Some ideas for enhanced functionality: |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=over 4 |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * For ".desktop" files, add logic to extract the names embedded in a shortcut |
73
|
|
|
|
|
|
|
(including all localized versions of the name). Similar logic could also |
74
|
|
|
|
|
|
|
be written for ".website" files. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * Explore unicode functionality for ".webloc" files. Will a Mac open a URL |
77
|
|
|
|
|
|
|
that has unicode characters? |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * Add an ASCII conversion option to the filename creation routines |
80
|
|
|
|
|
|
|
(i.e. to remove unicode characters). |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=back |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 AUTHOR |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Andre Beckus Ebeckus@cpan.orgE |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 SEE ALSO |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=over 4 |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item * Main project website: http://beckus.github.io/WebShortcutUtil/ |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * Read module: http://search.cpan.org/~beckus/WebShortcutUtil/lib/WebShortcutUtil/Read.pm |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * Write module: http://search.cpan.org/~beckus/WebShortcutUtil/lib/WebShortcutUtil/Write.pm |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * Perl module for using Windows shortcuts: http://search.cpan.org/~ishigaki/Win32-InternetShortcut/ |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=back |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Copyright (C) 2013 by Andre Beckus |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
107
|
|
|
|
|
|
|
it under the same terms as the Perl 5 programming language itself. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=cut |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |
113
|
|
|
|
|
|
|
__END__ |