Commit | Line | Data |
3fea05b9 |
1 | .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 |
2 | .\" |
3 | .\" Standard preamble: |
4 | .\" ======================================================================== |
5 | .de Sh \" Subsection heading |
6 | .br |
7 | .if t .Sp |
8 | .ne 5 |
9 | .PP |
10 | \fB\\$1\fR |
11 | .PP |
12 | .. |
13 | .de Sp \" Vertical space (when we can't use .PP) |
14 | .if t .sp .5v |
15 | .if n .sp |
16 | .. |
17 | .de Vb \" Begin verbatim text |
18 | .ft CW |
19 | .nf |
20 | .ne \\$1 |
21 | .. |
22 | .de Ve \" End verbatim text |
23 | .ft R |
24 | .fi |
25 | .. |
26 | .\" Set up some character translations and predefined strings. \*(-- will |
27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
28 | .\" double quote, and \*(R" will give a right double quote. | will give a |
29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
32 | .tr \(*W-|\(bv\*(Tr |
33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
34 | .ie n \{\ |
35 | . ds -- \(*W- |
36 | . ds PI pi |
37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
39 | . ds L" "" |
40 | . ds R" "" |
41 | . ds C` "" |
42 | . ds C' "" |
43 | 'br\} |
44 | .el\{\ |
45 | . ds -- \|\(em\| |
46 | . ds PI \(*p |
47 | . ds L" `` |
48 | . ds R" '' |
49 | 'br\} |
50 | .\" |
51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
54 | .\" output yourself in some meaningful fashion. |
55 | .if \nF \{\ |
56 | . de IX |
57 | . tm Index:\\$1\t\\n%\t"\\$2" |
58 | .. |
59 | . nr % 0 |
60 | . rr F |
61 | .\} |
62 | .\" |
63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
64 | .\" way too many mistakes in technical documents. |
65 | .hy 0 |
66 | .if n .na |
67 | .\" |
68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
70 | . \" fudge factors for nroff and troff |
71 | .if n \{\ |
72 | . ds #H 0 |
73 | . ds #V .8m |
74 | . ds #F .3m |
75 | . ds #[ \f1 |
76 | . ds #] \fP |
77 | .\} |
78 | .if t \{\ |
79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
80 | . ds #V .6m |
81 | . ds #F 0 |
82 | . ds #[ \& |
83 | . ds #] \& |
84 | .\} |
85 | . \" simple accents for nroff and troff |
86 | .if n \{\ |
87 | . ds ' \& |
88 | . ds ` \& |
89 | . ds ^ \& |
90 | . ds , \& |
91 | . ds ~ ~ |
92 | . ds / |
93 | .\} |
94 | .if t \{\ |
95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
101 | .\} |
102 | . \" troff and (daisy-wheel) nroff accents |
103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
110 | .ds ae a\h'-(\w'a'u*4/10)'e |
111 | .ds Ae A\h'-(\w'A'u*4/10)'E |
112 | . \" corrections for vroff |
113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
115 | . \" for low resolution devices (crt and lpr) |
116 | .if \n(.H>23 .if \n(.V>19 \ |
117 | \{\ |
118 | . ds : e |
119 | . ds 8 ss |
120 | . ds o a |
121 | . ds d- d\h'-1'\(ga |
122 | . ds D- D\h'-1'\(hy |
123 | . ds th \o'bp' |
124 | . ds Th \o'LP' |
125 | . ds ae ae |
126 | . ds Ae AE |
127 | .\} |
128 | .rm #[ #] #H #V #F C |
129 | .\" ======================================================================== |
130 | .\" |
131 | .IX Title "MIME::Types 3" |
132 | .TH MIME::Types 3 "2009-09-06" "perl v5.8.7" "User Contributed Perl Documentation" |
133 | .SH "NAME" |
134 | MIME::Types \- Definition of MIME types |
135 | .SH "INHERITANCE" |
136 | .IX Header "INHERITANCE" |
137 | .Vb 2 |
138 | \& MIME::Types |
139 | \& is a Exporter |
140 | .Ve |
141 | .SH "SYNOPSIS" |
142 | .IX Header "SYNOPSIS" |
143 | .Vb 4 |
144 | \& use MIME::Types; |
145 | \& my $mimetypes = MIME::Types\->new; |
146 | \& my MIME::Type $plaintext = $mimetypes\->type('text/plain'); |
147 | \& my MIME::Type $imagegif = $mimetypes\->mimeTypeOf('gif'); |
148 | .Ve |
149 | .SH "DESCRIPTION" |
150 | .IX Header "DESCRIPTION" |
151 | \&\s-1MIME\s0 types are used in \s-1MIME\s0 compliant lines, for instance as part |
152 | of e\-mail and \s-1HTTP\s0 traffic, to indicate the type of content which is |
153 | transmitted. Sometimes real knowledge about a mime-type is need. |
154 | .PP |
155 | This module maintains a set of MIME::Type objects, which |
156 | each describe one known mime type. There are many types defined |
157 | by RFCs and vendors, so the list is long but not complete. Please |
158 | don't hestitate to ask to add additional information. |
159 | .PP |
160 | If you wish to get access to the \f(CW\*(C`mime.types\*(C'\fR files, which are |
161 | available on various places in \s-1UNIX\s0 and Linux systems, then have a |
162 | look at File::TypeInfo. |
163 | .SH "METHODS" |
164 | .IX Header "METHODS" |
165 | .Sh "Instantiation" |
166 | .IX Subsection "Instantiation" |
167 | MIME::Types\->\fBnew\fR(\s-1OPTIONS\s0) |
168 | .Sp |
169 | .RS 4 |
170 | Create a new \f(CW\*(C`MIME::Types\*(C'\fR object which manages the data. In the current |
171 | implementation, it does not matter whether you create this object often |
172 | within your program, but in the future this may change. |
173 | .Sp |
174 | .Vb 2 |
175 | \& Option \-\-Default |
176 | \& only_complete <false> |
177 | .Ve |
178 | .Sp |
179 | \&. only_complete => \s-1BOOLEAN\s0 |
180 | .Sp |
181 | .RS 4 |
182 | Only include complete \s-1MIME\s0 type definitions: requires at least one known |
183 | extension. This will reduce the number of entries \-\-and with that the |
184 | amount of memory consumed\*(-- considerably. |
185 | .Sp |
186 | In your program you have to decide: the first time that you call |
187 | the creator (\f(CW\*(C`new\*(C'\fR) determines whether you get the full or the partial |
188 | information. |
189 | .RE |
190 | .RE |
191 | .RS 4 |
192 | .RE |
193 | .Sh "Knowledge" |
194 | .IX Subsection "Knowledge" |
195 | $obj\->\fBaddType\fR(\s-1TYPE\s0, ...) |
196 | .Sp |
197 | .RS 4 |
198 | Add one or more TYPEs to the set of known types. Each \s-1TYPE\s0 is a |
199 | \&\f(CW\*(C`MIME::Type\*(C'\fR which must be experimental: either the main-type or |
200 | the sub-type must start with \f(CW\*(C`x\-\*(C'\fR. |
201 | .Sp |
202 | Please inform the maintainer of this module when registered types |
203 | are missing. Before version MIME::Types version 1.14, a warning |
204 | was produced when an unknown \s-1IANA\s0 type was added. This has been |
205 | removed, because some people need that to get their application |
206 | to work locally... broken applications... |
207 | .RE |
208 | .PP |
209 | $obj\->\fBextensions\fR |
210 | .Sp |
211 | .RS 4 |
212 | Returns a list of all defined extensions. |
213 | .RE |
214 | .PP |
215 | $obj\->\fBmimeTypeOf\fR(\s-1FILENAME\s0) |
216 | .Sp |
217 | .RS 4 |
218 | Returns the \f(CW\*(C`MIME::Type\*(C'\fR object which belongs to the \s-1FILENAME\s0 (or simply |
219 | its filename extension) or \f(CW\*(C`undef\*(C'\fR if the file type is unknown. The extension |
220 | is used, and considered case\-insensitive. |
221 | .Sp |
222 | In some cases, more than one type is known for a certain filename extension. |
223 | In that case, one of the alternatives is chosen at random. |
224 | .Sp |
225 | example: use of \fImimeTypeOf()\fR |
226 | .Sp |
227 | .Vb 2 |
228 | \& my MIME::Types $types = MIME::Types\->new; |
229 | \& my MIME::Type $mime = $types\->mimeTypeOf('gif'); |
230 | .Ve |
231 | .Sp |
232 | .Vb 2 |
233 | \& my MIME::Type $mime = $types\->mimeTypeOf('jpg'); |
234 | \& print $mime\->isBinary; |
235 | .Ve |
236 | .RE |
237 | .PP |
238 | $obj\->\fBtype\fR(\s-1STRING\s0) |
239 | .Sp |
240 | .RS 4 |
241 | Return the \f(CW\*(C`MIME::Type\*(C'\fR which describes the type related to \s-1STRING\s0. One |
242 | type may be described more than once. Different extensions is use for |
243 | this type, and different operating systems may cause more than one |
244 | \&\f(CW\*(C`MIME::Type\*(C'\fR object to be defined. In scalar context, only the first |
245 | is returned. |
246 | .RE |
247 | .PP |
248 | $obj\->\fBtypes\fR |
249 | .Sp |
250 | .RS 4 |
251 | Returns a list of all defined mime-types |
252 | .RE |
253 | .SH "FUNCTIONS" |
254 | .IX Header "FUNCTIONS" |
255 | The next functions are provided for backward compatibility with MIME::Types |
256 | versions 0.06 and below. This code originates from Jeff Okamoto |
257 | \&\fIokamoto@corp.hp.com\fR and others. |
258 | .PP |
259 | \&\fBby_mediatype\fR(\s-1TYPE\s0) |
260 | .Sp |
261 | .RS 4 |
262 | This function takes a media type and returns a list or anonymous array of |
263 | anonymous three-element arrays whose values are the file name suffix used to |
264 | identify it, the media type, and a content encoding. |
265 | .Sp |
266 | \&\s-1TYPE\s0 can be a full type name (contains '/', and will be matched in full), |
267 | a partial type (which is used as regular expression) or a real regular |
268 | expression. |
269 | .RE |
270 | .PP |
271 | \&\fBby_suffix\fR(FILENAME|SUFFIX) |
272 | .Sp |
273 | .RS 4 |
274 | Like \f(CW\*(C`mimeTypeOf\*(C'\fR, but does not return an \f(CW\*(C`MIME::Type\*(C'\fR object. If the file |
275 | +type is unknown, both the returned media type and encoding are empty strings. |
276 | .Sp |
277 | example: use of function \fIby_suffix()\fR |
278 | .Sp |
279 | .Vb 2 |
280 | \& use MIME::Types 'by_suffix'; |
281 | \& my ($mediatype, $encoding) = by_suffix 'image.gif'; |
282 | .Ve |
283 | .Sp |
284 | .Vb 2 |
285 | \& my $refdata = by_suffix 'image.gif'; |
286 | \& my ($mediatype, $encoding) = @$refdata; |
287 | .Ve |
288 | .RE |
289 | .PP |
290 | \&\fBimport_mime_types\fR |
291 | .Sp |
292 | .RS 4 |
293 | This method has been removed: mime-types are only useful if understood |
294 | by many parties. Therefore, the \s-1IANA\s0 assigns names which can be used. |
295 | In the table kept by this \f(CW\*(C`MIME::Types\*(C'\fR module all these names, plus |
296 | the most often used termporary names are kept. When names seem to be |
297 | missing, please contact the maintainer for inclussion. |
298 | .RE |
299 | .SH "SEE ALSO" |
300 | .IX Header "SEE ALSO" |
301 | This module is part of MIME-Types distribution version 1.28, |
302 | built on September 07, 2009. Website: \fIhttp://perl.overmeer.net/mimetypes/\fR |
303 | .SH "LICENSE" |
304 | .IX Header "LICENSE" |
305 | Copyrights 1999,2001\-2009 by Mark Overmeer. For other contributors see ChangeLog. |
306 | .PP |
307 | This program is free software; you can redistribute it and/or modify it |
308 | under the same terms as Perl itself. |
309 | See \fIhttp://www.perl.com/perl/misc/Artistic.html\fR |