643
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
|
|
12 |
|
|
13 |
"
|
|
14 |
|
|
15 |
Object subclass:#MIMETypes
|
|
16 |
instanceVariableNames:''
|
|
17 |
classVariableNames:'TypeToImageReaderClassMapping FileSuffixToTypeMapping
|
|
18 |
FileSuffixToImageReaderClassMapping'
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'System-Documentation'
|
|
21 |
!
|
|
22 |
|
|
23 |
!MIMETypes class methodsFor:'documentation'!
|
|
24 |
|
|
25 |
copyright
|
|
26 |
"
|
|
27 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
28 |
All Rights Reserved
|
|
29 |
|
|
30 |
This software is furnished under a license and may be used
|
|
31 |
only in accordance with the terms of that license and with the
|
|
32 |
inclusion of the above copyright notice. This software may not
|
|
33 |
be provided or otherwise made available to, or used by, any
|
|
34 |
other person. No title to or ownership of the software is
|
|
35 |
hereby transferred.
|
|
36 |
|
|
37 |
|
|
38 |
"
|
|
39 |
!
|
|
40 |
|
|
41 |
documentation
|
|
42 |
"
|
|
43 |
just a place to keep MIME information
|
|
44 |
(avoid spreading things at many places)
|
|
45 |
|
|
46 |
[author:]
|
|
47 |
Claus Gittinger
|
|
48 |
"
|
|
49 |
! !
|
|
50 |
|
|
51 |
!MIMETypes class methodsFor:'initialization'!
|
|
52 |
|
|
53 |
initialize
|
|
54 |
TypeToImageReaderClassMapping isNil ifTrue:[TypeToImageReaderClassMapping := Dictionary new].
|
|
55 |
FileSuffixToTypeMapping isNil ifTrue:[FileSuffixToTypeMapping := Dictionary new].
|
|
56 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[FileSuffixToImageReaderClassMapping := Dictionary new].
|
|
57 |
|
|
58 |
"
|
|
59 |
self initialize
|
|
60 |
"
|
|
61 |
|
|
62 |
"Modified: 30.6.1997 / 21:58:47 / cg"
|
|
63 |
! !
|
|
64 |
|
|
65 |
!MIMETypes class methodsFor:'accessing'!
|
|
66 |
|
|
67 |
fileSuffixToImageReaderMapping
|
|
68 |
^ FileSuffixToImageReaderClassMapping ? #()
|
|
69 |
|
|
70 |
"Modified: 30.6.1997 / 22:06:11 / cg"
|
|
71 |
!
|
|
72 |
|
|
73 |
imageFileSuffixes
|
|
74 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[^ #()].
|
|
75 |
^ FileSuffixToImageReaderClassMapping keys
|
|
76 |
|
|
77 |
"Modified: 30.6.1997 / 21:51:39 / cg"
|
|
78 |
"Created: 30.6.1997 / 22:04:48 / cg"
|
|
79 |
!
|
|
80 |
|
|
81 |
imageReaderClasses
|
|
82 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[^ #()].
|
|
83 |
^ FileSuffixToImageReaderClassMapping values
|
|
84 |
|
|
85 |
"Modified: 30.6.1997 / 21:51:39 / cg"
|
|
86 |
"Created: 30.6.1997 / 22:03:42 / cg"
|
|
87 |
!
|
|
88 |
|
|
89 |
imageReaderForSuffix:aSuffix
|
|
90 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[^ nil].
|
|
91 |
^ FileSuffixToImageReaderClassMapping at:aSuffix asLowercase ifAbsent:nil
|
|
92 |
|
|
93 |
"Modified: 30.6.1997 / 21:51:39 / cg"
|
|
94 |
"Created: 30.6.1997 / 21:59:11 / cg"
|
|
95 |
!
|
|
96 |
|
|
97 |
imageReaderForSuffix:aSuffix put:aReaderClass
|
|
98 |
FileSuffixToImageReaderClassMapping isNil ifTrue:[
|
|
99 |
FileSuffixToImageReaderClassMapping := Dictionary new.
|
|
100 |
].
|
|
101 |
FileSuffixToImageReaderClassMapping at:aSuffix asLowercase put:aReaderClass
|
|
102 |
|
|
103 |
"Modified: 30.6.1997 / 21:51:44 / cg"
|
|
104 |
"Created: 30.6.1997 / 21:59:43 / cg"
|
|
105 |
!
|
|
106 |
|
|
107 |
imageReaderForType:mimeTypeString
|
|
108 |
TypeToImageReaderClassMapping isNil ifTrue:[^ nil].
|
|
109 |
^ TypeToImageReaderClassMapping at:mimeTypeString asLowercase ifAbsent:nil
|
|
110 |
|
|
111 |
"Modified: 30.6.1997 / 21:51:39 / cg"
|
|
112 |
"Created: 30.6.1997 / 21:56:01 / cg"
|
|
113 |
!
|
|
114 |
|
|
115 |
imageReaderForType:mimeTypeString put:aReaderClass
|
|
116 |
TypeToImageReaderClassMapping isNil ifTrue:[
|
|
117 |
TypeToImageReaderClassMapping := Dictionary new.
|
|
118 |
].
|
|
119 |
TypeToImageReaderClassMapping at:mimeTypeString asLowercase put:aReaderClass
|
|
120 |
|
|
121 |
"Modified: 30.6.1997 / 21:51:44 / cg"
|
|
122 |
"Created: 30.6.1997 / 21:56:11 / cg"
|
|
123 |
!
|
|
124 |
|
|
125 |
mimeTypeForSuffix:suffix
|
|
126 |
^ FileSuffixToTypeMapping at:suffix asLowercase ifAbsent:nil
|
|
127 |
|
|
128 |
"Created: 30.6.1997 / 21:55:51 / cg"
|
|
129 |
"Modified: 30.6.1997 / 21:58:13 / cg"
|
|
130 |
!
|
|
131 |
|
|
132 |
mimeTypeForSuffix:suffix put:mimeType
|
|
133 |
FileSuffixToTypeMapping isNil ifTrue:[
|
|
134 |
FileSuffixToTypeMapping := Dictionary new
|
|
135 |
].
|
|
136 |
FileSuffixToTypeMapping at:suffix put:mimeType asLowercase
|
|
137 |
|
|
138 |
"Created: 30.6.1997 / 21:56:20 / cg"
|
|
139 |
"Modified: 30.6.1997 / 21:58:19 / cg"
|
|
140 |
! !
|
|
141 |
|
|
142 |
!MIMETypes class methodsFor:'documentation'!
|
|
143 |
|
|
144 |
version
|
|
145 |
^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.1 1997-06-30 20:08:32 cg Exp $'
|
|
146 |
! !
|
|
147 |
MIMETypes initialize!
|