Class.st
changeset 6394 492964c0fd9b
parent 6386 2434f5e652ea
child 6409 f325e6f07ea2
equal deleted inserted replaced
6393:6d4b7a7173b4 6394:492964c0fd9b
  1433 storeBinaryClassOn:stream manager:manager
  1433 storeBinaryClassOn:stream manager:manager
  1434     "store a classes complete description (i.e. including methods).
  1434     "store a classes complete description (i.e. including methods).
  1435      However, the superclass chain is not stored - at load time, that must
  1435      However, the superclass chain is not stored - at load time, that must
  1436      be either present or autoloadable."
  1436      be either present or autoloadable."
  1437 
  1437 
  1438     |s sig owner privateClasses nPrivate|
  1438     |s sig owner superclass privateClasses nPrivate|
  1439 
  1439 
  1440     stream nextPut: manager codeForClass.
  1440     stream nextPut: manager codeForClass.
  1441 
  1441 
  1442     "/ the following order must correlate to
  1442     "/ the following order must correlate to
  1443     "/ the storing in #binaryDefinitionFrom:manager:
  1443     "/ the storing in #binaryDefinitionFrom:manager:
  1463 
  1463 
  1464     1 storeBinaryOn:stream manager:manager.  "/ formatID
  1464     1 storeBinaryOn:stream manager:manager.  "/ formatID
  1465 
  1465 
  1466     owner := self owningClass.
  1466     owner := self owningClass.
  1467 
  1467 
       
  1468     superclass := self superclass.
  1468     superclass isNil ifTrue:[
  1469     superclass isNil ifTrue:[
  1469         s := nil.
  1470         s := nil.
  1470         sig := 0.
  1471         sig := 0.
  1471     ] ifFalse:[
  1472     ] ifFalse:[
  1472         s := superclass name.
  1473         s := superclass name.
  1976 
  1977 
  1977 basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage
  1978 basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage
  1978     "append an expression on aStream, which defines myself."
  1979     "append an expression on aStream, which defines myself."
  1979 
  1980 
  1980     |s owner ns nsName fullName superNameWithoutNameSpacePrefix cls topOwner
  1981     |s owner ns nsName fullName superNameWithoutNameSpacePrefix cls topOwner
  1981      syntaxHilighting superclassNamespace|
  1982      syntaxHilighting superclass superclassNamespace|
  1982 
  1983 
  1983     UserPreferences isNil ifTrue:[
  1984     UserPreferences isNil ifTrue:[
  1984         syntaxHilighting := false
  1985         syntaxHilighting := false
  1985     ] ifFalse:[
  1986     ] ifFalse:[
  1986         syntaxHilighting := UserPreferences current syntaxColoring.
  1987         syntaxHilighting := UserPreferences current syntaxColoring.
  2025             ]
  2026             ]
  2026         ].
  2027         ].
  2027     ].
  2028     ].
  2028 
  2029 
  2029     "take care of nil-superclass"
  2030     "take care of nil-superclass"
       
  2031     superclass := self superclass.
  2030     superclass isNil ifTrue:[
  2032     superclass isNil ifTrue:[
  2031         s := 'nil'
  2033         s := 'nil'
  2032     ] ifFalse:[
  2034     ] ifFalse:[
  2033         superclassNamespace := superclass nameSpace.
  2035         superclassNamespace := superclass nameSpace.
  2034 
  2036 
  2153 !
  2155 !
  2154 
  2156 
  2155 basicFileOutInstvarTypeKeywordOn:aStream
  2157 basicFileOutInstvarTypeKeywordOn:aStream
  2156     "a helper for fileOutDefinition"
  2158     "a helper for fileOutDefinition"
  2157 
  2159 
  2158     |isVar s|
  2160     |isVar superclass|
  2159 
  2161 
       
  2162     superclass := self superclass.
  2160     superclass isNil ifTrue:[
  2163     superclass isNil ifTrue:[
  2161         isVar := self isVariable
  2164         isVar := self isVariable
  2162     ] ifFalse:[
  2165     ] ifFalse:[
  2163         "I cant remember what this is for ?"
  2166         "I cant remember what this is for ?"
  2164         isVar := (self isVariable and:[superclass isVariable not])
  2167         isVar := (self isVariable and:[superclass isVariable not])
  2566         ^ FileOutErrorSignal 
  2569         ^ FileOutErrorSignal 
  2567             raiseRequestWith:self
  2570             raiseRequestWith:self
  2568                  errorString:'will not fileOut unloaded classes'
  2571                  errorString:'will not fileOut unloaded classes'
  2569     ].
  2572     ].
  2570 
  2573 
  2571     meta := self class.
  2574     meta := self theMetaclass.
  2572 
  2575 
  2573     "
  2576     "
  2574      if there is a copyright method, add a copyright comment
  2577      if there is a copyright method, add a copyright comment
  2575      at the beginning, taking the string from the copyright method.
  2578      at the beginning, taking the string from the copyright method.
  2576      We cannot do this unconditionally - that would lead to my copyrights
  2579      We cannot do this unconditionally - that would lead to my copyrights
  3260 !
  3263 !
  3261 
  3264 
  3262 printOutDefinitionOn:aPrintStream
  3265 printOutDefinitionOn:aPrintStream
  3263     "print out my definition"
  3266     "print out my definition"
  3264 
  3267 
  3265     |comment s|
  3268     |comment s superclass|
  3266 
  3269 
  3267     aPrintStream nextPutAll:'class                '; bold; nextPutLine:self name; normal. 
  3270     aPrintStream nextPutAll:'class                '; bold; nextPutLine:self name; normal. 
  3268     aPrintStream nextPutAll:'superclass           '.
  3271     aPrintStream nextPutAll:'superclass           '.
       
  3272     superclass := self superclass.
  3269     superclass isNil ifTrue:[
  3273     superclass isNil ifTrue:[
  3270         s := 'Object'
  3274         s := 'Object'
  3271     ] ifFalse:[
  3275     ] ifFalse:[
  3272         s := superclass name
  3276         s := superclass name
  3273     ].
  3277     ].
  4694 ! !
  4698 ! !
  4695 
  4699 
  4696 !Class class methodsFor:'documentation'!
  4700 !Class class methodsFor:'documentation'!
  4697 
  4701 
  4698 version
  4702 version
  4699     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.408 2002-02-11 10:01:25 cg Exp $'
  4703     ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.409 2002-02-15 12:43:03 cg Exp $'
  4700 ! !
  4704 ! !