Class.st
changeset 2059 c58962259667
parent 2049 308ce0c3828a
child 2068 6d5711ab4a44
equal deleted inserted replaced
2058:09ea6d9cd607 2059:c58962259667
  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. 
  2304             aStream nextPutAll:owner nameWithoutNameSpacePrefix.
  2312             aStream nextPutAll:owner nameWithoutNameSpacePrefix.
  2305         ]
  2313         ]
  2306     ].
  2314     ].
  2307     aStream cr
  2315     aStream cr
  2308 
  2316 
  2309     "Modified: 3.1.1997 / 20:43:50 / cg"
  2317     "Created: 4.1.1997 / 20:38:16 / cg"
       
  2318     "Modified: 4.1.1997 / 21:06:42 / cg"
  2310 !
  2319 !
  2311 
  2320 
  2312 basicFileOutInstvarTypeKeywordOn:aStream
  2321 basicFileOutInstvarTypeKeywordOn:aStream
  2313     "a helper for fileOutDefinition"
  2322     "a helper for fileOutDefinition"
  2314 
  2323 
  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
  4551 ! !
  4562 ! !
  4552 
  4563 
  4553 !Class class methodsFor:'documentation'!
  4564 !Class class methodsFor:'documentation'!
  4554 
  4565 
  4555 version
  4566 version
  4556     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.233 1997-01-03 20:13:15 cg Exp $'
  4567     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.234 1997-01-04 20:09:17 cg Exp $'
  4557 ! !
  4568 ! !
  4558 Class initialize!
  4569 Class initialize!