2223 "Modified: 10.2.1996 / 12:50:11 / cg" |
2223 "Modified: 10.2.1996 / 12:50:11 / cg" |
2224 ! ! |
2224 ! ! |
2225 |
2225 |
2226 !Class methodsFor:'fileOut'! |
2226 !Class methodsFor:'fileOut'! |
2227 |
2227 |
2228 basicFileOutDefinitionOn:aStream |
2228 basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace |
2229 "append an expression on aStream, which defines myself." |
2229 "append an expression on aStream, which defines myself." |
2230 |
2230 |
2231 |s owner ns nsName fullName| |
2231 |s owner ns nsName fullName| |
2232 |
2232 |
2233 owner := self owningClass. |
2233 owner := self owningClass. |
2234 ns := self nameSpace. |
2234 |
2235 |
2235 owner isNil ifTrue:[ |
|
2236 ns := self nameSpace. |
|
2237 ] ifFalse:[ |
|
2238 ns := self topOwningClass nameSpace |
|
2239 ]. |
2236 fullName := FileOutNameSpaceQuerySignal raise == true. |
2240 fullName := FileOutNameSpaceQuerySignal raise == true. |
2237 |
2241 |
2238 owner isNil ifTrue:[ |
2242 ((owner isNil and:[fullName not]) |
2239 fullName ifFalse:[ |
2243 or:[owner notNil and:[forceNameSpace and:[fullName not]]]) ifTrue:[ |
2240 (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
2244 (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
2241 nsName := ns name. |
2245 nsName := ns name. |
2242 (nsName includes:$:) ifTrue:[ |
2246 (nsName includes:$:) ifTrue:[ |
2243 nsName := '''' , nsName , '''' |
2247 nsName := '''' , nsName , '''' |
2244 ]. |
2248 ]. |
2245 aStream nextPutLine:'"{ NameSpace: ' , nsName , ' }"'; cr. |
2249 aStream nextPutLine:'"{ NameSpace: ' , nsName , ' }"'; cr. |
2246 ] |
|
2247 ] |
2250 ] |
2248 ]. |
2251 ]. |
2249 |
2252 |
2250 "take care of nil-superclass" |
2253 "take care of nil-superclass" |
2251 superclass isNil ifTrue:[ |
2254 superclass isNil ifTrue:[ |
2264 ]. |
2267 ]. |
2265 |
2268 |
2266 aStream nextPutAll:s. |
2269 aStream nextPutAll:s. |
2267 aStream space. |
2270 aStream space. |
2268 self basicFileOutInstvarTypeKeywordOn:aStream. |
2271 self basicFileOutInstvarTypeKeywordOn:aStream. |
|
2272 |
2269 fullName ifTrue:[ |
2273 fullName ifTrue:[ |
2270 aStream nextPutAll:'#'''; nextPutAll:(self name); nextPutAll:''''. |
2274 owner isNil ifTrue:[ |
|
2275 aStream nextPutAll:'#'''; nextPutAll:(self name); nextPutAll:''''. |
|
2276 ] ifFalse:[ |
|
2277 aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix). |
|
2278 ] |
2271 ] ifFalse:[ |
2279 ] ifFalse:[ |
2272 aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix). |
2280 aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix). |
2273 ]. |
2281 ]. |
2274 |
2282 |
2275 aStream crtab. |
2283 aStream crtab. |
2757 ! |
2766 ! |
2758 |
2767 |
2759 fileOutDefinitionOn:aStream |
2768 fileOutDefinitionOn:aStream |
2760 "append an expression on aStream, which defines myself." |
2769 "append an expression on aStream, which defines myself." |
2761 |
2770 |
2762 ^ self basicFileOutDefinitionOn:aStream |
2771 ^ self basicFileOutDefinitionOn:aStream withNameSpace:false |
|
2772 |
|
2773 "Modified: 4.1.1997 / 20:55:18 / cg" |
2763 ! |
2774 ! |
2764 |
2775 |
2765 fileOutIn:aFileDirectory |
2776 fileOutIn:aFileDirectory |
2766 "create a file 'class.st' consisting of all methods in self in |
2777 "create a file 'class.st' consisting of all methods in self in |
2767 directory aFileDirectory (ignoring any directory setting in |
2778 directory aFileDirectory (ignoring any directory setting in |