Class.st
author Claus Gittinger <cg@exept.de>
Fri, 16 Jan 1998 15:59:43 +0100
changeset 3180 1c225dd8c5b2
parent 3165 b6bde90005a8
child 3220 923707e8d156
permissions -rw-r--r--
care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
     1
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
     3
	       All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
719
c557a530f971 dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
    13
ClassDescription subclass:#Class
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
    14
	instanceVariableNames:'name category classvars comment subclasses classFilename package
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
    15
		revision primitiveSpec environment signature hook'
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
    16
	classVariableNames:'OldMethods'
741
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    17
	poolDictionaries:''
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    18
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    19
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    20
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    21
!Class class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    22
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    23
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    24
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    25
 COPYRIGHT (c) 1989 by Claus Gittinger
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    26
	       All Rights Reserved
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    27
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    28
 This software is furnished under a license and may be used
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    29
 only in accordance with the terms of that license and with the
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    31
 be provided or otherwise made available to, or used by, any
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    32
 other person.  No title to or ownership of the software is
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    33
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    34
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    35
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    36
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    37
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    38
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    39
    Class adds more functionality to classes; minimum stuff has already
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    40
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    41
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    42
    [Instance variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    43
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    44
	name            <Symbol>        the classes name
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    45
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    46
	category        <Symbol>        the classes category
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    47
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    48
	classvars       <String>        the names of the class variables
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    49
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    50
	comment         <String>        the classes comment; either a string,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    51
					a number specifying the offset in classFilename, or nil
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    52
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    53
	subclasses      <Collection>    cached collection of subclasses
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    54
					(currently unused - but will be soon)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    55
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    56
	classFilename   <String>        the file (or nil) where the classes
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    57
					sources are found 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    58
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    59
	package         <Symbol>        the package, in which the class was defined
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    60
					(inserted by compilers)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    61
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    62
	revision        <String>        revision string - inserted by stc
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    63
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    64
	primitiveSpec   <Array | nil>   describes primitiveIncludes, primitiveFunctions etc.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    65
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    66
	environment     <Symbol | nil>  cached environment (i.e. Smalltalk or a namespace)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    67
					of class
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    68
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    69
	signature       <SmallInteger>  the classes signature (used to detect obsolete
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    70
					or changed classes with binaryStorage)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    71
					This is filled in lazy - i.e. upon the first signature query.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    72
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    73
	hook            <any>           reserved: a place to add additional attributes,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    74
					without a need to recompile all classes.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    75
					Currently unused.
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    76
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    77
    [Class variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    78
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    79
	OldMethods                      if nonNil, this must be an IdentityDictionary,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    80
					which is filled with method->previousversionMethod
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    81
					associations. Can be used for undo-last-method-change
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    82
					Notice: this may fillup your memory over time.
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    83
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    84
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    85
    WARNING: layout known by compiler and runtime system
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    86
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    87
    [author:]
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    88
	Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
    89
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
    90
    [see also:]
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
    91
	Behavior ClassDescription Metaclass
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    92
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
    93
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    94
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    95
!Class class methodsFor:'Signal constants'!
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    96
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    97
methodRedefinitionSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    98
    "return the signal raised when a method is about to be installed
362
claus
parents: 360
diff changeset
    99
     which redefines an existing method and the methods packages are not
claus
parents: 360
diff changeset
   100
     equal. This helps when filing in alien code, to prevent existing
claus
parents: 360
diff changeset
   101
     methods to be overwritten or redefined by incompatible methods"
claus
parents: 360
diff changeset
   102
claus
parents: 360
diff changeset
   103
    ^ MethodRedefinitionSignal
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   104
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   105
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   106
nameSpaceQuerySignal
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   107
    "return the signal used as an upQuery for the current nameSpace.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   108
     Will be used when filing in code"
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   109
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   110
    ^ NameSpaceQuerySignal
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   111
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   112
    "
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   113
     Transcript showCR:Class nameSpaceQuerySignal raise
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   114
    "
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   115
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   116
    "Modified: 5.11.1996 / 20:08:38 / cg"
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   117
!
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   118
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   119
packageQuerySignal
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   120
    "return the signal used as an upQuery for the current packages name.
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   121
     Will be used when filing in code"
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   122
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   123
    ^ PackageQuerySignal
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   124
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   125
    "
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   126
     Transcript showCR:Class packageQuerySignal raise
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   127
    "
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   128
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   129
    "Created: 5.11.1996 / 20:07:22 / cg"
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   130
    "Modified: 5.11.1996 / 20:08:35 / cg"
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   131
!
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   132
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   133
updateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   134
    "return the signal used as an upQuery if the changeFile should be updated.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   135
     If unhandled, the value of UpdatingChanges is returned by the signals
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   136
     static handler."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   137
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   138
    ^ UpdateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   139
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   140
    "
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   141
     Transcript showCR:Class updateChangeFileQuerySignal raise
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   142
    "
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   143
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   144
    "Modified: 5.11.1996 / 20:08:44 / cg"
2003
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   145
!
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   146
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   147
usedNameSpaceQuerySignal
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   148
    "return the signal used as an upQuery for the used nameSpace.
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   149
     Will be used when filing in code"
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   150
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   151
    ^ UsedNameSpaceQuerySignal
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   152
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   153
    "Created: 19.12.1996 / 23:57:27 / cg"
362
claus
parents: 360
diff changeset
   154
! !
claus
parents: 360
diff changeset
   155
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   156
!Class class methodsFor:'accessing - flags'!
362
claus
parents: 360
diff changeset
   157
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   158
catchMethodRedefinitions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   159
    "return the redefinition catching flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   160
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   161
    ^ CatchMethodRedefinitions
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   162
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   163
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   164
catchMethodRedefinitions:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   165
    "turn on/off redefinition catching. Return the prior value of the flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   166
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   167
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   168
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   169
    prev := CatchMethodRedefinitions.
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   170
    CatchMethodRedefinitions := aBoolean.
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   171
    ^ prev
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   172
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   173
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   174
keepMethodHistory:aBoolean
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   175
    "turn on/off oldMethod remembering. If on, a methods previous version
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   176
     is kept locally, for later undo (or compare)."
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   177
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   178
    aBoolean ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   179
	OldMethods isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   180
	    OldMethods := IdentityDictionary new.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   181
	]
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   182
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   183
	OldMethods := nil
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   184
    ].
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   185
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   186
    "
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   187
     Class keepMethodHistory:true
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   188
     Class keepMethodHistory:false
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   189
    "
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   190
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   191
    "Modified: 7.11.1996 / 18:36:00 / cg"
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   192
    "Created: 7.11.1996 / 19:05:57 / cg"
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   193
!
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   194
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   195
lockChangesFile
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   196
    "return true, if the change file is locked during update"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   197
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   198
    ^ LockChangesFile
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   199
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   200
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   201
lockChangesFile:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   202
    "turn on/off change-file-locking. Return the previous value of the flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   203
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   204
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   205
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   206
    prev := LockChangesFile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   207
    LockChangesFile := aBoolean.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   208
    ^ prev
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   209
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   210
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   211
tryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   212
    ^ TryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   213
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   214
    "Created: 24.1.1996 / 19:55:35 / cg"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   215
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   216
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   217
tryLocalSourceFirst:aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   218
    TryLocalSourceFirst := aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   219
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   220
    "Created: 24.1.1996 / 19:55:35 / cg"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   221
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   222
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   223
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   224
    "turn on/off changes management. Return the prior value of the flag.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   225
     This value is used as a default fallback - a querySignal handler may still 
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   226
     decide to return something else."
362
claus
parents: 360
diff changeset
   227
claus
parents: 360
diff changeset
   228
    |prev|
claus
parents: 360
diff changeset
   229
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   230
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   231
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   232
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   233
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   234
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   235
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   236
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   237
     The value returned here is the default fallback - a querySignal handler may still
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   238
     decide to return something else."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   239
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   240
    ^ UpdatingChanges
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   241
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   242
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   243
!Class class methodsFor:'accessing - history'!
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   244
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   245
flushMethodHistory
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   246
    "flush any method->previousVersion associations,
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   247
     all history is lost."
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   248
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   249
    OldMethods notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   250
	OldMethods := IdentityDictionary new
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   251
    ].
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   252
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   253
    "Created: 7.11.1996 / 19:07:25 / cg"
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   254
!
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   255
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   256
methodHistory
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   257
    "return a dictionary containing method->previousVersion associations,
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   258
     nil if method remembering has been turned off"
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   259
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   260
    ^ OldMethods 
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   261
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   262
    "
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   263
     Class oldMethods
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   264
    "
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   265
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   266
    "Modified: 7.11.1996 / 18:36:00 / cg"
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   267
    "Created: 7.11.1996 / 19:06:28 / cg"
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   268
! !
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   269
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   270
!Class class methodsFor:'helpers'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   271
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   272
revisionInfoFromString:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   273
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   274
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   275
    "return a dictionary filled with revision info.
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   276
     This extracts the relevant info from aString, asking
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   277
     the sourceCode manager (if there is one)"
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   278
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   279
    "
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   280
     For now, this is a bad design - since the sourceCodeManager
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   281
     is not always delivered, here, a fallBack is provided.
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   282
     (should probably deliver some RCS-header extractor in any case,
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   283
      even if no AbstractSourceCodeManager is present)
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   284
     (knowing about the details of RCS headers here is a bad design ...)
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   285
    "
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   286
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   287
    |words info nm mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   288
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   289
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   290
    "/ mhmh - ask the default manager
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   291
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   292
    (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   293
	info := mgr revisionInfoFromString:aString.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   294
	info notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   295
	    ^ info
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   296
	]
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   297
    ].
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   298
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   299
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   300
    "/ fallBack - handles some RCS headers only
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   301
    "/ is this really needed ?
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   302
    "/
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   303
    info := IdentityDictionary new.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   304
    words := aString asCollectionOfWords.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   305
744
db7b733455b9 dont crash with bad revision strings (again)
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   306
    words notEmpty ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   307
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   308
	"/ supported formats:
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   309
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   310
	"/ $-Header: pathName rev date time user state $
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   311
	"/ $-Revision: rev $
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   312
	"/ $-Id: fileName rev date time user state $
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   313
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   314
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   315
	((words at:1) = '$Header:') ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   316
	    nm := words at:2.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   317
	    info at:#repositoryPathName put:nm.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   318
	    (nm endsWith:',v') ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   319
		nm := nm copyWithoutLast:2
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   320
	    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   321
	    info at:#fileName put:nm asFilename baseName.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   322
	    words size > 2 ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   323
		(words at:3) = '$' ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   324
		    info at:#revision put:(words at:3).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   325
		    (words at:4) = '$' ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   326
			info at:#date put:(words at:4).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   327
			info at:#time put:(words at:5).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   328
			info at:#user put:(words at:6).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   329
			info at:#state put:(words at:7).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   330
		    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   331
		].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   332
	    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   333
	    ^ info
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   334
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   335
	((words at:1) = '$Revision:') ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   336
	    info at:#revision put:(words at:2).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   337
	    ^ info
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   338
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   339
	((words at:1) = '$Id:') ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   340
	    info at:#fileName put:(words at:2).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   341
	    info at:#revision put:(words at:3).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   342
	    info at:#date put:(words at:4).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   343
	    info at:#time put:(words at:5).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   344
	    info at:#user put:(words at:6).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   345
	    info at:#state put:(words at:7).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   346
	    ^ info
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   347
	].
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   348
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   349
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   350
    ^ nil
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   351
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   352
    "Created: 15.11.1995 / 14:58:35 / cg"
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   353
    "Modified: 29.1.1997 / 19:36:31 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   354
!
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   355
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   356
revisionStringFromSource:aMethodSourceString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   357
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   358
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   359
    "extract a revision string from a methods source string"
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   360
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   361
    |lines line|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   362
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   363
    lines := aMethodSourceString asCollectionOfLines.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   364
    lines do:[:l |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   365
	|i|
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   366
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   367
	i := l indexOfSubCollection:'$Header: '.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   368
	i ~~ 0 ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   369
	    line := l copyFrom:i.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   370
	    i := line lastIndexOf:$$.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   371
	    i > 1 ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   372
		line := line copyTo:i.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   373
	    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   374
	    ^ line
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   375
	]
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   376
    ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   377
    ^ nil
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   378
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   379
    "Created: 15.10.1996 / 18:57:57 / cg"
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   380
    "Modified: 16.10.1996 / 16:54:40 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   381
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   382
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   383
!Class class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   384
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   385
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   386
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   387
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   388
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   389
    ^ self == Class class or:[self == Class]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   390
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   391
    "Created: 15.4.1996 / 17:17:13 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   392
    "Modified: 23.4.1996 / 15:56:58 / cg"
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   393
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   394
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   395
!Class methodsFor:'ST/V subclass creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   396
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   397
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   398
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   399
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   400
    "this method allows fileIn of ST/V classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   401
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   402
a27a279701f8 Initial revision
claus
parents:
diff changeset
   403
    ^ self subclass:t 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   404
	   instanceVariableNames:f
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   405
	   classVariableNames:d
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   406
	   poolDictionaries:s
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   407
	   category:'ST/V classes'
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   408
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   409
    "Modified: 5.1.1997 / 19:59:30 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   410
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   411
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   412
variableByteSubclass:t classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   413
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   414
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   415
    "this method allows fileIn of ST/V variable byte classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   416
     (which seem to have no category and no instvars)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   417
a27a279701f8 Initial revision
claus
parents:
diff changeset
   418
    ^ self variableByteSubclass:t 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   419
	   instanceVariableNames:''
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   420
	   classVariableNames:d
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   421
	   poolDictionaries:s
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   422
	   category:'ST/V classes'
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   423
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   424
    "Modified: 5.1.1997 / 19:59:33 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   425
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   426
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   427
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   428
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   429
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   430
    "this method allows fileIn of ST/V variable pointer classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   431
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   432
a27a279701f8 Initial revision
claus
parents:
diff changeset
   433
    ^ self variableSubclass:t 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   434
	   instanceVariableNames:f
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   435
	   classVariableNames:d
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   436
	   poolDictionaries:s
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   437
	   category:'ST/V classes'
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   438
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   439
    "Modified: 5.1.1997 / 19:59:36 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   440
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   441
2709
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   442
!Class methodsFor:'ST80 compatibility'!
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   443
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   444
fileOutSourceOn:aStream
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   445
    self fileOutOn:aStream withTimeStamp:false
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   446
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   447
    "Created: 20.6.1997 / 17:18:14 / cg"
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   448
    "Modified: 20.6.1997 / 17:18:26 / cg"
3064
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   449
!
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   450
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   451
isVisualStartable
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   452
    "return true, if this is an application class,
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   453
     which can be started via #open"
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   454
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   455
    ^ false
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   456
59c97d974936 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   457
    "Created: / 27.10.1997 / 16:42:05 / cg"
2709
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   458
! !
91d3b6e73ea0 added #fileOutSourceOn: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2676
diff changeset
   459
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   460
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   461
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   462
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   463
    "add a class variable if not already there and initialize it with nil.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   464
     Also writes a change record and notifies dependents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   465
     BUG: Currently, no recompilation is done - this will change."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   466
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   467
    (self classVarNames includes:aString) ifFalse:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   468
	self classVariableString:(self classVariableString , ' ' , aString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   469
	self addChangeRecordForClass:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   470
	self changed:#definition.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   471
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   472
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   473
    "Created: 29.10.1995 / 19:40:51 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   474
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   475
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   476
category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   477
    "return the category of the class. 
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   478
     The returned value may be a string or symbol."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   479
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   480
    |owner|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   481
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   482
    (owner := self owningClass) notNil ifTrue:[^ owner category].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   483
    ^ category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   484
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   485
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   486
     Point category                
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   487
     Dictionary category           
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   488
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   489
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   490
    "Modified: 15.10.1996 / 21:20:01 / cg"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   491
    "Created: 1.4.1997 / 15:23:47 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   492
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   493
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   494
category:aStringOrSymbol
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   495
    "set the category of the class to be the argument, aStringOrSymbol"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   496
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   497
    aStringOrSymbol isNil ifTrue:[
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   498
	category := aStringOrSymbol
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   499
    ] ifFalse:[
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   500
	category := aStringOrSymbol asSymbol
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   501
    ]
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   502
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   503
    "Created: 1.4.1997 / 15:24:04 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   504
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   505
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   506
classFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   507
    "return the name of the file from which the class was compiled.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   508
     This is currently NOT used."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   509
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   510
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   511
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   512
    (owner := self owningClass) notNil ifTrue:[^ owner classFilename].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   513
    ^ classFilename
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   514
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   515
    "Modified: 15.10.1996 / 18:53:21 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   516
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   517
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   518
classPool
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   519
    "return a dictionary filled with classVarName->value
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   520
     associations. This has been added for ST80 compatibility,
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   521
     and is not the way classVars are technically implemented in
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   522
     ST/X. Changing the values in the returned dictionary has no effect
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   523
     on the classVars value(s)"
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   524
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   525
    |d|
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   526
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   527
    d := IdentityDictionary new.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   528
    self classVarNames do:[:nm |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   529
	|sym|
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   530
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   531
	sym := nm asSymbol.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   532
	d at:sym put:(self classVarAt:sym)
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   533
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   534
    ^ d
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   535
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   536
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   537
     Button classPool
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   538
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   539
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   540
    "Modified: 17.10.1997 / 12:12:14 / cg"
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   541
!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
   542
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   543
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   544
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   545
     Currently, this returns nil if there is no such classvar -
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   546
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   547
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   548
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   549
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   550
     from the outside world. Currently, classvars are stored in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   551
     the Smalltalk dictionary with a funny name, since there are
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   552
     no classPools yet.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   553
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   554
    ^ Smalltalk at:(self name , ':' , aSymbol) asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   555
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   556
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   557
classVarAt:aSymbol put:something
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   558
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   559
     Currently this creates a global with a funny name if no such
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   560
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   561
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   562
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   563
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   564
     from the outside world. Currently, classvars are stored in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   565
     the Smalltalk dictionary with a funny name, since there are
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   566
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   567
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   568
    Smalltalk at:(self name , ':' , aSymbol) asSymbol put:something.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   569
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   570
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   571
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   572
    "return a collection of the class variable name-strings.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   573
     Only names of class variables defined in this class are included
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   574
     in the returned collection - use allClassVarNames, to get all known names."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   575
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   576
    classvars isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   577
	^ OrderedCollection new
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   578
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   579
    ^ classvars asCollectionOfWords
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   580
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   581
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   582
     Object classVarNames 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   583
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   584
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   585
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   586
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   587
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   588
    "return a string of the class variables names.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   589
     Only names of class variables defined in this class are in the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   590
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   591
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   592
    classvars isNil ifTrue:[^ ''].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   593
    ^ classvars
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   594
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   595
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   596
     Object classVariableString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   597
     Float classVariableString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   598
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   599
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   600
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   601
classVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   602
    "set the classes classvarnames string; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   603
     Initialize new class variables with nil, clear and remove old ones. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   604
     No change record is written and no classes are recompiled."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   605
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   606
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   607
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   608
    (classvars = aString) ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   609
	prevVarNames := self classVarNames.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   610
	classvars := aString.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   611
	varNames := self classVarNames.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   612
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   613
	"new ones get initialized to nil;
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   614
	 - old ones are nilled and removed from Smalltalk"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   615
	any := false.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   616
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   617
	varNames do:[:aName |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   618
	    (prevVarNames includes:aName) ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   619
		"a new one"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   620
		self classVarAt:aName put:nil.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   621
		any := true.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   622
	    ] ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   623
		prevVarNames remove:aName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   624
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   625
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   626
	"left overs are gone"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   627
	prevVarNames do:[:aName |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   628
	    self classVarAt:aName put:nil.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   629
	    Smalltalk removeKey:(self name , ':' , aName) asSymbol.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   630
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   631
	any ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   632
	    Smalltalk changed:#classVariables with:self
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   633
	].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   634
    ]
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   635
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   636
    "Modified: 2.4.1997 / 00:16:05 / stefan"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   637
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   638
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   639
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   640
    "return the comment (aString) of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   641
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   642
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   643
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   644
    "the comment is either a string, or an integer specifying the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   645
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   646
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   647
    comment isNumber ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   648
	classFilename notNil ifTrue:[
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   649
	    stream := self sourceStream. 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   650
	    stream notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   651
		stream position:comment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   652
		string := String readFrom:stream onError:''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   653
		stream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   654
		^ string
887
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   655
	    ].
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   656
	    ^ nil
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   657
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   658
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   659
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   660
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   661
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   662
     Object comment 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   663
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   664
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   665
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   666
comment:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   667
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   668
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   669
    "set the comment of the class to be the argument, aString;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   670
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   671
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   672
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   673
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   674
    newComment := aString.
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   675
    (aString notNil and:[aString isEmpty]) ifTrue:[
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   676
	newComment := nil
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   677
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   678
    comment ~= newComment ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   679
	oldComment := self comment.
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   680
	comment := newComment.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   681
	self changed:#comment with:oldComment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   682
	self addChangeRecordForClassComment:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   683
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   684
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   685
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   686
definition
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   687
    "return an expression-string to define myself"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   688
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   689
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   690
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   691
    s := WriteStream on:(String new).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   692
    self fileOutDefinitionOn:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   693
    ^ s contents
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   694
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   695
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   696
     Object definition 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   697
     Point definition  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   698
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   699
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   700
2444
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   701
environment
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   702
    "return the namespace I am contained in; ST-80 compatible name"
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   703
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   704
    ^ self nameSpace
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   705
!
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   706
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   707
name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   708
    "return the name of the class. In the current implementation,
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   709
     this returns a string, but will be changed to Symbol soon."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   710
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   711
    ^ name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   712
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   713
    "Created: 1.4.1997 / 15:24:32 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   714
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   715
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   716
nameSpace
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   717
    "return the namespace I am contained in;
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   718
     For private or anonymous classes, nil is returned -
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   719
     for public classes, Smalltalk is returned."
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   720
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   721
    |idx nsName|
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   722
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   723
    environment notNil ifTrue:[^ environment].
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   724
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   725
    "/ due to the implementation, extract this from my name
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   726
    "/ (physically, all classes are found in Smalltalk)
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   727
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   728
    idx := name lastIndexOf:$:.
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   729
    idx == 0 ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   730
	environment := Smalltalk.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   731
	^ Smalltalk
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   732
    ].
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   733
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   734
    (name at:idx-1) ~~ $: ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   735
	environment := Smalltalk.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   736
	^ Smalltalk
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   737
    ].
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   738
    nsName := name copyTo:(idx - 2).
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   739
    environment := Smalltalk at:nsName asSymbol.
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   740
    ^ environment
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   741
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   742
    "Modified: 24.3.1997 / 11:12:09 / cg"
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   743
!
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   744
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   745
package
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   746
    "return the package-id of the class"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   747
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   748
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   749
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   750
    (owner := self owningClass) notNil ifTrue:[^ owner package].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   751
    ^ package
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   752
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   753
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   754
     Object package  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   755
    "
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   756
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   757
    "Modified: 15.10.1996 / 18:53:36 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   758
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   759
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   760
package:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   761
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   762
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   763
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   764
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   765
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   766
primitiveDefinitions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   767
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   768
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   769
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   770
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   771
    self setPrimitiveSpecsAt:1 to:aString.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   772
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   773
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   774
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   775
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   776
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   777
primitiveDefinitionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   778
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   779
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   780
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   781
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   782
    ^ self getPrimitiveSpecsAt:1
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   783
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   784
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   785
     Object primitiveDefinitionsString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   786
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   787
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   788
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   789
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   790
primitiveFunctions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   791
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   792
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   793
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   794
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   795
    self setPrimitiveSpecsAt:3 to:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   796
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   797
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   798
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   799
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   800
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   801
primitiveFunctionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   802
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   803
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   804
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   805
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   806
    ^ self getPrimitiveSpecsAt:3 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   807
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   808
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   809
primitiveSpec
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   810
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   811
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   812
    "return the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   813
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   814
    ^  primitiveSpec
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   815
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   816
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   817
primitiveSpec:anArrayOf3ElementsOrNil
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   818
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   819
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   820
    "set the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   821
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   822
    primitiveSpec := anArrayOf3ElementsOrNil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   823
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   824
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   825
primitiveVariables:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   826
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   827
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   828
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   829
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   830
    self setPrimitiveSpecsAt:2 to:aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   831
    self addChangeRecordForPrimitiveVariables:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   832
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   833
    "Created: 29.10.1995 / 19:41:58 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   834
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   835
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   836
primitiveVariablesString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   837
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   838
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   839
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   840
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   841
    ^ self getPrimitiveSpecsAt:2 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   842
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   843
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   844
privateClasses
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   845
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   846
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   847
    "return a collection of my private classes (if any); nil otherwise.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   848
     The classes are in any order."
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   849
2489
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   850
    |classes myName myNamePrefix|
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   851
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   852
    classes := IdentitySet new.
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   853
    myName := self name.
2489
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   854
    myNamePrefix := myName , '::'.
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   855
2490
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   856
    Smalltalk allBehaviorsDo:[:aClass |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   857
	|nm owner|
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   858
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   859
	aClass isBehavior ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   860
	    (owner := aClass owningClass) notNil ifTrue:[
2490
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   861
"/                owner == self ifTrue:[
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   862
"/                    classes add:aClass.
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   863
"/                ].
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   864
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   865
		nm := aClass name.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   866
		(nm startsWith:myNamePrefix) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   867
		    "/ care for private-privateClasses
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   868
		    (nm indexOf:$: startingAt:myName size + 3) == 0 ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   869
			classes add:aClass.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   870
		    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   871
		]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   872
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   873
	]
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   874
    ].
2718
f7b5e3bffd78 sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
   875
    ^ classes asSortedCollection:[:a :b | a name < b name].
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   876
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   877
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   878
     Object privateClasses
2718
f7b5e3bffd78 sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
   879
     ObjectMemory privateClasses 
f7b5e3bffd78 sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
   880
     UILayoutTool privateClasses 
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   881
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   882
2718
f7b5e3bffd78 sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
   883
    "Modified: 25.6.1997 / 14:45:50 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   884
!
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   885
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   886
privateClassesAt:aClassNameStringOrSymbol
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   887
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   888
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   889
    "return a private class if present; nil otherwise"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   890
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   891
    |nmSym|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   892
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   893
    nmSym := (self name , '::' , aClassNameStringOrSymbol) asSymbolIfInterned.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   894
    nmSym isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   895
	"/ no such symbol - there cannot be a corresponding private class
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   896
	^ nil
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   897
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   898
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   899
    ^ Smalltalk at:nmSym.
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   900
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   901
    "Modified: 26.6.1997 / 11:44:04 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   902
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   903
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   904
privateClassesAt:aClassNameStringOrSymbol put:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   905
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   906
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   907
    "add a private class"
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   908
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   909
    self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   910
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   911
    "Modified: 26.6.1997 / 11:44:12 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   912
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   913
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   914
privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   915
    "{ Pragma: +optSpace }"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   916
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   917
    "return a collection of my private classes (if any); nil otherwise.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   918
     The classes are sorted by inheritance."
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   919
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   920
    |classes|
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   921
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   922
    classes := self privateClasses.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   923
    (classes notNil and:[classes notEmpty]) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   924
	classes := classes asOrderedCollection topologicalSort:[:a :b | b isSubclassOf:a].
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   925
    ].
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   926
    ^ classes.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   927
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   928
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   929
     Object privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   930
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   931
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   932
    "Created: 22.3.1997 / 16:10:42 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   933
    "Modified: 22.3.1997 / 16:11:20 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   934
!
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   935
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   936
removeClassVarName:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   937
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   938
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   939
    "remove a class variable if not already there.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   940
     Also writes a change record and notifies dependents.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   941
     BUG: Currently, no recompilation is done - this will change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   942
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   943
    |names newNames|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   944
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   945
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   946
    (names includes:aString) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   947
	newNames := ''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   948
	names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   949
	self classVariableString:newNames withoutSpaces.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   950
	self addChangeRecordForClass:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   951
	self changed:#definition.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   952
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   953
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   954
    "Created: 29.10.1995 / 19:42:08 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   955
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   956
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   957
setClassFilename:aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   958
    "set the classes filename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   959
     This is a dangerous (low level) operation, since the 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   960
     comment and primitiveSpecs may no longer be accessable, if a wrong filename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   961
     is set here."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   962
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   963
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   964
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   965
    "Modified: 8.9.1995 / 14:16:48 / claus"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   966
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   967
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   968
setClassVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   969
    "set the classes classvarnames string. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   970
     This is a dangerous (low level) operation, since the 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   971
     classvariables are not really created or updated. Also,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   972
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   973
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   974
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   975
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   976
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   977
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   978
    "set the comment of the class to be the argument, aString;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   979
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   980
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   981
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   982
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   983
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   984
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   985
    "set the comment and category of the class;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   986
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   987
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   988
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   989
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   990
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   991
    categoryStringOrSymbol isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   992
	cat := ''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   993
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   994
	cat := categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   995
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   996
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   997
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   998
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   999
setPackage:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1000
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1001
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1002
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1003
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1004
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1005
sharedPools
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1006
    "ST/X does not (currently) support pools"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1007
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1008
    ^ #()
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1009
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1010
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1011
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1012
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1013
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1014
    |code aStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1015
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1016
" this is too slow for big classes ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1017
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1018
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1019
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1020
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1021
    aStream := FileStream newFileNamed:'__temp'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1022
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1023
	self notify:'cannot create temporary file.'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1024
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1025
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1026
    FileOutErrorSignal handle:[:ex |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1027
	aStream nextPutAll:'"no source available"'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1028
    ] do:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1029
	self fileOutOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1030
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1031
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1032
    aStream := FileStream oldFileNamed:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1033
    aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1034
	self notify:'oops - cannot reopen temp file'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1035
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1036
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1037
    code := aStream contents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1038
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1039
    OperatingSystem removeFile:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1040
    ^ code
385
claus
parents: 384
diff changeset
  1041
!
claus
parents: 384
diff changeset
  1042
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1043
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1044
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1045
     For now, all classes return the same global manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1046
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1047
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1048
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1049
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1050
    (owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager].
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1051
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1052
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1053
    "Created: 7.12.1995 / 13:16:46 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1054
    "Modified: 15.10.1996 / 18:54:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1055
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1056
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1057
!Class methodsFor:'adding/removing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1058
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1059
removeFromSystem
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1060
    "ST-80 compatibility
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1061
     remove myself from the system"
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1062
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1063
    ^ Smalltalk removeClass:self
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1064
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1065
    "Created: 6.2.1996 / 11:32:58 / stefan"
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1066
!
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1067
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1068
unload
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1069
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1070
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1071
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1072
     autoloaded. Can be used to get rid of no longer needed autoloaded
328
claus
parents: 326
diff changeset
  1073
     classes. 
claus
parents: 326
diff changeset
  1074
     (maybe, autoloaded classes should unload themselfes when no
claus
parents: 326
diff changeset
  1075
      longer needed - for example, after some delay when the last instance 
claus
parents: 326
diff changeset
  1076
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1077
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1078
    |nm|
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1079
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1080
    self wasAutoloaded ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1081
	"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1082
	 can it be done ?
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1083
	 (all of my methods must have a source)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1084
	"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1085
	self methodDictionary do:[:aMethod |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1086
	    aMethod source isNil ifTrue:[^false].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1087
	    aMethod hasPrimitiveCode ifTrue:[^ false].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1088
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1089
	self class methodDictionary do:[:aMethod |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1090
	    aMethod source isNil ifTrue:[^false].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1091
	    aMethod hasPrimitiveCode ifTrue:[^ false].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1092
	].
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1093
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1094
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1095
    self allSubclassesDo:[:aClass |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1096
	aClass unload
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1097
    ].
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1098
    Transcript showCR:'unloading ' , name , ' ...'.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1099
359
claus
parents: 357
diff changeset
  1100
    Autoload removeClass:self.    
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1101
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1102
    Smalltalk at:nm put:nil.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1103
"/    name := (nm , ' (leftover)') asSymbol.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1104
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1105
    ObjectMemory flushMethodCache.
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1106
    Autoload addClass:nm inCategory:category.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1107
"/  category := #unloaded.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1108
    Smalltalk flushCachedClasses.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1109
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1110
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1111
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1112
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1113
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1114
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1115
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1116
    "
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1117
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1118
    "Modified: 7.6.1996 / 09:15:05 / stefan"
2675
bb724aff9c75 stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents: 2671
diff changeset
  1119
    "Modified: 4.6.1997 / 14:48:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1120
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1121
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1122
!Class methodsFor:'binary storage'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1123
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1124
addGlobalsForBinaryStorageTo:globalDictionary
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1125
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1126
    classPool == nil ifFalse: [
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1127
	classPool associationsDo: [:assoc|
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1128
	    globalDictionary at: assoc put: self
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1129
	]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1130
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1131
"
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1132
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1133
    "Created: 21.3.1997 / 15:40:45 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1134
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1135
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1136
binaryClassDefinitionFrom:stream manager:manager
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1137
    "retrieve a class as stored previously with
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1138
     #storeBinaryClassOn:manager:
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1139
     The namespace, where the class is to be installed is queries via the
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1140
     NameSpaceQuerySignal - it should answer with nil, to suppress installation."
1699
42a53290bd5d allow for a class to be loaded into another environment
Claus Gittinger <cg@exept.de>
parents: 1687
diff changeset
  1141
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1142
    |superclassName name flags instvars classvars category classInstVars
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1143
     comment package superclassSig rev
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1144
     newClass superClass methods cmethods formatID environment
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1145
     ownerName owner nPrivate privateClass cls|
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1146
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1147
    "/ the following order must correlate to
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1148
    "/ the storing in #storeBinaryClassOn:manager:
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1149
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1150
    "/ retrieve
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1151
    "/   formatID
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1152
    "/   superclasses name,
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1153
    "/   superclasses signature
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1154
    "/   name,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1155
    "/   typeSymbol,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1156
    "/   instVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1157
    "/   classVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1158
    "/   category
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1159
    "/   classInstVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1160
    "/   comment
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1161
    "/   revision
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1162
    "/   package
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1163
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1164
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1165
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1166
    "/   number of private classes
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1167
    "/   private classes, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1168
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1169
    formatID := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1170
    formatID isInteger ifFalse:[       "/ backward compatibilty
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1171
	formatID := nil.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1172
	superclassName := formatID
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1173
    ] ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1174
	superclassName := manager nextObject.
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1175
    ].
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1176
    superclassSig := manager nextObject.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1177
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1178
    superclassName notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1179
	superClass := Smalltalk at:superclassName ifAbsent:nil.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1180
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1181
	superClass isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1182
	    BinaryIOManager nonexistingClassSignal
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1183
		raiseRequestWith:'non existent superclass (in binaryLoad)'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1184
	    ^ nil
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1185
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1186
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1187
	"/ ('loading superclass: ' ,  superclassName ) printNL.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1188
	superClass autoload.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1189
	superClass := Smalltalk at:superclassName.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1190
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1191
	superclassSig ~= superClass signature ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1192
	    BinaryIOManager changedInstLayoutSignal
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1193
		raiseRequestWith:'incompatible superclass (in binaryLoad)'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1194
	    ^ nil
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1195
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1196
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1197
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1198
    name := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1199
    flags := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1200
    instvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1201
    instvars isNil ifTrue:[instvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1202
    classvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1203
    classvars isNil ifTrue:[classvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1204
    category := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1205
    classInstVars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1206
    classInstVars isNil ifTrue:[classInstVars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1207
    comment := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1208
    package := manager nextObject.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1209
    formatID == 1 ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1210
	rev := manager nextObject.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1211
	ownerName := manager nextObject.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1212
	ownerName notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1213
	    name := name copyFrom:(ownerName size + 2 + 1).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1214
	    owner := Smalltalk at:ownerName.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1215
	]
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1216
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1217
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1218
"/    'got superName:' print. superclassName printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1219
"/    'got name:' print. name printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1220
"/    'got flags: ' print. flags printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1221
"/    'got instvars: ' print. instvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1222
"/    'got classvars: ' print. classvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1223
"/    'got category: ' print. category printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1224
"/    'got classInstvars: ' print. classInstVars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1225
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1226
"/ ('create class: ' ,  name ) printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1227
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1228
    owner notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1229
	environment := owner
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1230
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1231
	environment := Class nameSpaceQuerySignal raise.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1232
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1233
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1234
    cls := superClass.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1235
    superClass isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1236
	cls := Object
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1237
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1238
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1239
    newClass := cls class
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1240
	    name:name asSymbol
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1241
	    in:environment
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1242
	    subclassOf:cls
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1243
	    instanceVariableNames:instvars
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1244
	    variable:false
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1245
	    words:false 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1246
	    pointers:true
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1247
	    classVariableNames:classvars
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1248
	    poolDictionaries:'' 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1249
	    category:category
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1250
	    comment:comment 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1251
	    changed:false 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1252
	    classInstanceVariableNames:classInstVars.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1253
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1254
    newClass isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1255
	^ nil.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1256
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1257
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1258
    superClass isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1259
	newClass setSuperclass:nil.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1260
	newClass class setSuperclass:Class.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1261
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1262
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1263
"/ Transcript showCR:'loaded ' , name , ' in ' , environment name.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1264
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1265
    newClass flags:flags.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1266
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1267
    "/ retrieve class methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1268
    cmethods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1269
    "/ retrieve inst methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1270
    methods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1271
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1272
    formatID == 1 ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1273
	"/ privateClasses
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1274
	nPrivate := manager nextObject.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1275
	nPrivate timesRepeat:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1276
	    Class nameSpaceQuerySignal
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1277
		answer:newClass
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1278
		do:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1279
		    privateClass := manager nextObject
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1280
		]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1281
	]
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1282
    ].
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1283
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1284
    (superClass isNil and:[superclassName notNil]) ifTrue:[^ nil].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1285
    newClass isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1286
	^ nil
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1287
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1288
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1289
    owner notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1290
	newClass category:nil.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1291
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1292
	newClass package:package.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1293
    ].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1294
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1295
    newClass methodDictionary:methods.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1296
    newClass class methodDictionary:cmethods.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1297
    ^ newClass
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1298
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1299
    "Modified: 7.6.1996 / 13:43:06 / stefan"
1699
42a53290bd5d allow for a class to be loaded into another environment
Claus Gittinger <cg@exept.de>
parents: 1687
diff changeset
  1300
    "Created: 8.10.1996 / 17:57:02 / cg"
1900
9e814ffbebbc namespace support
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
  1301
    "Modified: 5.11.1996 / 22:01:09 / cg"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1302
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1303
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1304
storeBinaryClassOn:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1305
    "store a classes complete description (i.e. including methods).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1306
     However, the superclass chain is not stored - at load time, that must
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1307
     be either present or autoloadable."
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1308
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1309
    |s sig owner privateClasses|
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1310
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1311
    stream nextPut: manager codeForClass.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1312
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1313
    "/ the following order must correlate to
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1314
    "/ the storing in #binaryDefinitionFrom:manager:
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1315
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1316
    "/ store
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1317
    "/   format ID
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1318
    "/   superclasses name
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1319
    "/   superclasses signature
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1320
    "/   name
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1321
    "/   typeSymbol,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1322
    "/   instVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1323
    "/   classVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1324
    "/   category
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1325
    "/   classInstVarNames
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1326
    "/   comment
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1327
    "/   package
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1328
    "/   revision
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1329
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1330
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1331
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1332
    "/   # of privateClass names
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1333
    "/   privateClasses, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1334
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1335
    1 storeBinaryOn:stream manager:manager.  "/ formatID
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1336
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1337
    owner := self owningClass.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1338
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1339
    superclass isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1340
	s := nil.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1341
	sig := 0.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1342
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1343
	s := superclass name.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1344
	sig := superclass signature.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1345
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1346
    s storeBinaryOn:stream manager:manager.
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1347
    sig storeBinaryOn:stream manager:manager.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1348
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1349
    name storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1350
    flags storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1351
    (instvars notNil and:[instvars isEmpty]) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1352
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1353
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1354
	s := instvars
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1355
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1356
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1357
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1358
    (classvars notNil and:[classvars isEmpty]) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1359
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1360
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1361
	s := classvars
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1362
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1363
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1364
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1365
    "/ the category
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1366
    owner notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1367
	nil storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1368
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1369
	category storeBinaryOn:stream manager:manager.
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1370
    ].
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1371
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1372
    "/ the classInstVarString
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1373
    s := self class instanceVariableString.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1374
    (s notNil and:[s isEmpty]) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1375
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1376
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1377
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1378
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1379
    "/ the comment
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1380
    s := comment.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1381
    manager sourceMode == #discard ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1382
	s := nil
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1383
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1384
    s storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1385
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1386
    "/ the revision, package & owner
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1387
    owner notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1388
	nil storeBinaryOn:stream manager:manager.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1389
	nil storeBinaryOn:stream manager:manager.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1390
	owner name storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1391
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1392
	package storeBinaryOn:stream manager:manager.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1393
	revision storeBinaryOn:stream manager:manager.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1394
	nil storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1395
    ].
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1396
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1397
    "/
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1398
    "/ store class method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1399
    "/ 
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1400
    self class methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1401
    "/ store inst method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1402
    self methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.    
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1403
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1404
    "/
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1405
    "/ names of private classes
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1406
    "/
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1407
    privateClasses := self privateClassesSorted.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1408
    privateClasses size storeBinaryOn:stream manager:manager.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1409
    privateClasses size > 0 ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1410
	privateClasses do:[:aClass |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1411
	    aClass storeBinaryClassOn:stream manager:manager
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1412
	]
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1413
    ].
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1414
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1415
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1416
     |bos|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1417
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1418
     bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1419
     bos nextPutClasses:(Array with:FileBrowser).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1420
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1421
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1422
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1423
     |bos cls|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1424
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1425
     bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1426
     cls := bos next.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1427
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1428
     cls open.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1429
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1430
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1431
    "Modified: 7.6.1996 / 13:39:02 / stefan"
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1432
    "Modified: 22.3.1997 / 16:13:02 / cg"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1433
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1434
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1435
storeBinaryDefinitionOf: anAssociation on: stream manager: manager
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1436
    "not usable at the moment - there are no classpools currently"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1437
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1438
    | string |
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1439
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1440
    string := self name, ' classPool at: ', anAssociation key storeString.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1441
    stream nextNumber: 2 put: string size.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1442
    stream nextPutBytes:(string size) from:string startingAt:1.
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1443
"/    string do: [:char| stream nextPut: char asciiValue]
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1444
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1445
    "Modified: 19.3.1997 / 18:49:54 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1446
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1447
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1448
storeBinaryDefinitionOn: stream manager: manager
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1449
    "store the receiver in a binary format on stream.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1450
     This is an internal interface for binary storage mechanism.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1451
     classes only store the name, signature and instvar names.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1452
     They restore by looking for that name in the Smalltalk dictionary.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1453
     However, using the signature, a check for being valid is made at
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1454
     restore time.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1455
     This avoids a full recursive store of a class in the normal binary
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1456
     storage - however, it also means that a classes semantics cannot
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1457
     be stored with the basic storeBinary operation
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1458
     (we depend on the class being present at binaryLoad time.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1459
    To store classes, use #storeBinaryClassOn:manager: or BOSS>>nextPutClasses:."
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1460
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1461
    |varnames n sz|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1462
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1463
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1464
     output the signature
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1465
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1466
    stream nextNumber:4 put:self signature.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1467
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1468
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1469
     output the instance variable name string
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1470
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1471
    varnames := self allInstVarNames.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1472
    n := varnames size.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1473
    n == 0 ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1474
	sz := 0
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1475
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1476
	sz := varnames inject:0 into:[:sum :nm | sum + nm size].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1477
	sz := sz + n - 1.
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1478
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1479
    stream nextNumber:2 put:sz.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1480
    varnames keysAndValuesDo:[:i :nm |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1481
	stream nextPutBytes:(nm size) from:nm startingAt:1.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1482
"/        nm do:[:c |
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1483
"/            stream nextPut:c asciiValue
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1484
"/        ].
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1485
	i ~~ n ifTrue:[stream nextPut:(Character space asciiValue)]
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1486
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1487
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1488
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1489
     output my name
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1490
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1491
    stream nextNumber:2 put:name size.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1492
    stream nextPutBytes:(name size) from:name startingAt:1.
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1493
"/    name do:[:c| 
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1494
"/        stream nextPut:c asciiValue
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1495
"/    ]
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1496
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1497
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1498
     |s|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1499
     s := WriteStream on:ByteArray new.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1500
     Rectangle storeBinaryOn:s.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1501
     Object readBinaryFrom:(ReadStream on:s contents)  
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1502
    "
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1503
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1504
    "Modified: 19.3.1997 / 18:47:10 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1505
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1506
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1507
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1508
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1509
addChangeRecordForChangeCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1510
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1511
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1512
    "add a category change record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1513
2676
38d61ed0cf40 stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
  1514
    Class updateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1515
	self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1516
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1517
2676
38d61ed0cf40 stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents: 2675
diff changeset
  1518
    "Modified: 4.6.1997 / 14:56:13 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1519
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1520
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1521
addChangeRecordForClass:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1522
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1523
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1524
    "add a class-definition-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1525
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1526
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1527
	self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1528
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1529
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1530
    "Modified: 24.1.1997 / 19:09:41 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1531
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1532
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1533
addChangeRecordForClassCheckIn:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1534
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1535
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1536
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1537
1938
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1538
    |rv|
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1539
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1540
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1541
	rv := aClass revision.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1542
	rv isNil ifTrue:[rv := '???'].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1543
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1544
	self 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1545
	    writingChangeWithTimeStamp:false 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1546
	    perform:#addInfoRecord:to: 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1547
	    with:('checkin ' , aClass name , ' (' , rv , ')').
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1548
    ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1549
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1550
    "Created: 18.11.1995 / 17:04:58 / cg"
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1551
    "Modified: 24.1.1997 / 19:11:55 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1552
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1553
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1554
addChangeRecordForClassComment:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1555
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1556
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1557
    "add a class-comment-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1558
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1559
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1560
	self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1561
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1562
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1563
    "Modified: 24.1.1997 / 19:09:59 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1564
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1565
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1566
addChangeRecordForClassContainerRemove:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1567
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1568
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1569
    "append a container-was-removed-record to the changes file"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1570
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1571
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1572
	self 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1573
	    writingChangeWithTimeStamp:false 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1574
	    perform:#addInfoRecord:to: 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1575
	    with:('removed source container of ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1576
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1577
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1578
    "Created: 11.9.1996 / 15:37:19 / cg"
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1579
    "Modified: 24.1.1997 / 19:12:05 / cg"
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1580
!
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1581
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1582
addChangeRecordForClassFileOut:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1583
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1584
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1585
    "append a class-was-filedOut-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1586
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1587
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1588
	self 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1589
	    writingChangeWithTimeStamp:false 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1590
	    perform:#addInfoRecord:to: 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1591
	    with:('fileOut ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1592
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1593
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1594
    "Modified: 24.1.1997 / 19:12:14 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1595
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1596
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1597
addChangeRecordForClassInstvars:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1598
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1599
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1600
    "add a class-instvars-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1601
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1602
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1603
	self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1604
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1605
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1606
    "Modified: 24.1.1997 / 19:10:18 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1607
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1608
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1609
addChangeRecordForClassRemove:oldName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1610
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1611
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1612
    "add a class-remove-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1613
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1614
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1615
	self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1616
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1617
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1618
    "Modified: 24.1.1997 / 19:10:25 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1619
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1620
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1621
addChangeRecordForClassRename:oldName to:newName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1622
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1623
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1624
    "add a class-rename-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1625
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1626
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1627
	self writingChangeDo:[:aStream |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1628
	    self addChangeRecordForClassRename:oldName to:newName to:aStream
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1629
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1630
    ]
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1631
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1632
    "Modified: 24.1.1997 / 19:10:35 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1633
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1634
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1635
addChangeRecordForPrimitiveDefinitions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1636
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1637
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1638
    "add a primitiveDefinitions-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1639
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1640
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1641
	self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1642
	Project notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1643
	    Project addPrimitiveDefinitionsChangeFor:aClass
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1644
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1645
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1646
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1647
    "Modified: 20.1.1997 / 12:36:10 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1648
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1649
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1650
addChangeRecordForPrimitiveFunctions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1651
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1652
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1653
    "add a primitiveFunctions-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1654
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1655
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1656
	self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1657
	Project notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1658
	    Project addPrimitiveFunctionsChangeFor:aClass
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1659
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1660
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1661
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1662
    "Modified: 20.1.1997 / 12:36:13 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1663
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1664
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1665
addChangeRecordForPrimitiveVariables:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1666
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1667
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1668
    "add a primitiveVariables-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1669
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1670
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1671
	self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1672
	Project notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1673
	    Project addPrimitiveVariablesChangeFor:aClass
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1674
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1675
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1676
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1677
    "Modified: 20.1.1997 / 12:36:16 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1678
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1679
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1680
addChangeRecordForSnapshot:aFileName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1681
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1682
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1683
    "add a snapshot-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1684
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1685
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1686
	self 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1687
	    writingChangeWithTimeStamp:false 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1688
	    perform:#addInfoRecord:to: 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1689
	    with:('snapshot ' , aFileName).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1690
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1691
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1692
    "Modified: 24.1.1997 / 19:12:25 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1693
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1694
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1695
addChangeRecordForSnapshot:aFileName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1696
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1697
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1698
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1699
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1700
    UpdateChangeFileQuerySignal raise ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1701
	self addInfoRecord:('snapshot ' , aFileName) to:aStream
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1702
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1703
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1704
    "Modified: 24.1.1997 / 19:11:08 / cg"
2917
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  1705
! !
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  1706
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1707
!Class methodsFor:'enumerating'!
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1708
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1709
privateClassesDo:aBlock
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1710
    "evaluate aBlock on all of my private classes (if any)"
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1711
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1712
    |classes|
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1713
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1714
    (classes := self privateClasses) size > 0 ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1715
	classes do:aBlock
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1716
    ].
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1717
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1718
    "Created: 26.10.1996 / 12:28:57 / cg"
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1719
    "Modified: 22.3.1997 / 16:17:36 / cg"
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1720
! !
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1721
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1722
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1723
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1724
primitiveDefinitions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1725
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1726
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1727
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1728
     unprocessed contents in the classes primitiveDefinitions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1729
     Thus, although the definitions are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1730
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1731
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1732
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1733
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1734
    "Modified: 10.2.1996 / 12:47:12 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1735
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1736
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1737
primitiveFunctions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1738
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1739
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1740
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1741
     unprocessed contents in the classes primitiveFunctions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1742
     Thus, although the functions are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1743
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1744
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1745
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1746
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1747
    "Modified: 10.2.1996 / 12:47:07 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1748
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1749
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1750
primitiveVariables
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1751
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1752
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1753
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1754
     unprocessed contents in the classes primitiveVariables section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1755
     Thus, although the variables are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1756
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1757
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1758
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1759
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1760
    "Modified: 10.2.1996 / 12:47:28 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1761
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1762
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1763
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1764
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1765
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1766
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  1767
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1768
    |s owner ns nsName fullName superName cls topOwner
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1769
     syntaxHilighting|
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1770
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1771
    syntaxHilighting := Smalltalk syntaxHilighting.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1772
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  1773
    owner := self owningClass.
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  1774
1932
4d4c4563486b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
  1775
    owner isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1776
	ns := self nameSpace.
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1777
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1778
	ns := self topOwningClass nameSpace
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1779
    ].
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1780
    fullName := FileOutNameSpaceQuerySignal raise == true.
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1781
        
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1782
    ((owner isNil and:[fullName not])
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1783
    or:[owner notNil and:[forceNameSpace and:[fullName not]]]) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1784
	(ns notNil and:[ns ~~ Smalltalk]) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1785
	    nsName := ns name.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1786
	    (nsName includes:$:) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1787
		nsName := '''' , nsName , ''''
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1788
	    ].
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1789
"/            aStream nextPutLine:'"{ NameSpace: ' , nsName , ' }"'; cr.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1790
	    aStream nextPutAll:'"{ NameSpace: '.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1791
	    syntaxHilighting ifTrue:[aStream bold].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1792
	    aStream nextPutAll:nsName.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1793
	    syntaxHilighting ifTrue:[aStream normal].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1794
	    aStream nextPutAll:' }"'; cr; cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1795
	]
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  1796
    ].
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  1797
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
  1798
    "take care of nil-superclass"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1799
    superclass isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1800
	s := 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1801
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1802
	fullName ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1803
	    s := superclass name
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1804
	] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1805
	    (ns == superclass nameSpace 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1806
	    and:[superclass owningClass isNil]) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1807
		s := superclass nameWithoutPrefix
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1808
	    ] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1809
		"/ a very special (rare) situation:
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1810
		"/ my superclass resides in another nameSpace,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1811
		"/ but there is something else named like this
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1812
		"/ to be found in my nameSpace (or a private class)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1813
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1814
		superName := superclass nameWithoutNameSpacePrefix asSymbol.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1815
		cls := self privateClassesAt:superName.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1816
		cls isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1817
		    (topOwner := self topOwningClass) isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1818
			ns := self nameSpace.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1819
			ns notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1820
			    cls := ns privateClassesAt:superName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1821
			] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1822
			    "/ self error:'unexpected nil namespace'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1823
			]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1824
		    ] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1825
			cls := topOwner nameSpace at:superName.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1826
		    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1827
		].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1828
		(cls notNil and:[cls ~~ superclass]) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1829
		    s := superclass nameSpace name , '::' , superName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1830
		] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1831
		    s := superName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1832
		]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1833
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1834
	]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1835
    ].
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1836
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1837
    syntaxHilighting ifTrue:[aStream bold].
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1838
    aStream nextPutAll:s.   "/ superclass
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1839
    syntaxHilighting ifTrue:[aStream normal].
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1840
    aStream space.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1841
    self basicFileOutInstvarTypeKeywordOn:aStream.
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1842
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1843
    (fullName and:[owner isNil]) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1844
	aStream nextPutAll:'#'''.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1845
	syntaxHilighting ifTrue:[aStream bold].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1846
	aStream nextPutAll:(self name).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1847
	syntaxHilighting ifTrue:[aStream normal].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1848
	aStream nextPutAll:''''.
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  1849
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1850
	aStream nextPut:$#.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1851
	syntaxHilighting ifTrue:[aStream bold].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1852
	aStream nextPutAll:(self nameWithoutPrefix).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1853
	syntaxHilighting ifTrue:[aStream normal].
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  1854
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1855
345
claus
parents: 333
diff changeset
  1856
    aStream crtab. 
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1857
    aStream nextPutAll:'instanceVariableNames:'''.
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1858
    syntaxHilighting ifTrue:[aStream bold].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1859
    self printInstVarNamesOn:aStream indent:16.
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1860
    syntaxHilighting ifTrue:[aStream normal].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1861
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1862
345
claus
parents: 333
diff changeset
  1863
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1864
    aStream nextPutAll:'classVariableNames:'''.
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1865
    syntaxHilighting ifTrue:[aStream bold].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1866
    self printClassVarNamesOn:aStream indent:16.
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1867
    syntaxHilighting ifTrue:[aStream normal].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1868
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1869
345
claus
parents: 333
diff changeset
  1870
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1871
    aStream nextPutAll:'poolDictionaries:'''''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1872
345
claus
parents: 333
diff changeset
  1873
    aStream crtab.
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  1874
    owner isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1875
	"/ a public class
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1876
	aStream nextPutAll:'category:'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1877
	category isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1878
	    s := ''''''
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1879
	] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1880
	    s := category asString storeString
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1881
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1882
	aStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1883
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1884
	"/ a private class
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1885
	aStream nextPutAll:'privateIn:'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1886
	syntaxHilighting ifTrue:[aStream bold].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1887
	fullName ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1888
	    s := owner name.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1889
	] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1890
	    s := owner nameWithoutNameSpacePrefix.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1891
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1892
	aStream nextPutAll:s.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1893
	syntaxHilighting ifTrue:[aStream normal].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1894
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1895
    aStream cr
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  1896
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1897
    "Created: 4.1.1997 / 20:38:16 / cg"
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1898
    "Modified: 8.8.1997 / 10:59:50 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1899
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1900
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1901
basicFileOutInstvarTypeKeywordOn:aStream
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1902
    "a helper for fileOutDefinition"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1903
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1904
    |isVar s|
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1905
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1906
    superclass isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1907
	isVar := self isVariable
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1908
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1909
	"I cant remember what this is for ?"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1910
	isVar := (self isVariable and:[superclass isVariable not])
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1911
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1912
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1913
    isVar ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1914
	self isBytes ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1915
	    s := 'variableByteSubclass:'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1916
	] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1917
	    self isWords ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1918
		s := 'variableWordSubclass:'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1919
	    ] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1920
		self isLongs ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1921
		    s := 'variableLongSubclass:'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1922
		] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1923
		    self isFloats ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1924
			s := 'variableFloatSubclass:'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1925
		    ] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1926
			self isDoubles ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1927
			    s := 'variableDoubleSubclass:'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1928
			] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1929
			    self isSignedWords ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1930
				s := 'variableSignedWordSubclass:'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1931
			    ] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1932
				self isSignedLongs ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1933
				    s := 'variableSignedLongSubclass:'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1934
				] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1935
				    s := 'variableSubclass:'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1936
				]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1937
			    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1938
			]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1939
		    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1940
		]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1941
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1942
	]
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1943
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1944
	s := 'subclass:'
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1945
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1946
    aStream nextPutAll:s.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1947
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1948
    "Created: 11.10.1996 / 18:57:29 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1949
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1950
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1951
binaryFileOut
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  1952
    "create a file 'class.cls' (in the current projects fileOut-directory),
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  1953
     consisting of all methods in myself in a portable binary format. 
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  1954
     The methods source is saved by reference
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1955
     to the classes sourceFile if there is any.
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1956
     That sourcefile needs to be present after reload in order to be
895
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
  1957
     browsable."
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1958
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1959
    self binaryFileOutWithSourceMode:#reference
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  1960
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  1961
    "Modified: 5.1.1997 / 15:40:05 / cg"
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1962
!
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1963
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1964
binaryFileOutOn:aStream
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1965
    "append a binary representation of myself to aStream"
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1966
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1967
    self binaryFileOutOn:aStream sourceMode:#reference 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1968
!
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1969
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1970
binaryFileOutOn:aStream sourceMode:sourceMode
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1971
    "append a binary representation of myself to aStream in
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1972
     a portable binary format. 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1973
     The argument controls how sources are to be saved:
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1974
	#keep - include the source
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1975
	#reference - include a reference to the sourceFile
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1976
	#discard - dont save sources.
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1977
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1978
     With #reference, the sourceFile needs to be present after reload 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1979
     in order to be browsable."
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1980
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1981
    |bos|
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1982
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1983
    bos := BinaryObjectStorage onNew:aStream.
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1984
    bos sourceMode:sourceMode.
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1985
    bos nextPutClasses:(Array with:self).
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1986
    bos close.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1987
!
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1988
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1989
binaryFileOutWithSourceMode:sourceMode
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  1990
    "create a file 'class.cls' (in the current projects fileOut-directory),
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  1991
     consisting of all methods in myself in a portable binary format. 
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1992
     The argument controls how sources are to be saved:
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1993
	#keep - include the source
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1994
	#reference - include a reference to the sourceFile
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  1995
	#discard - dont save sources.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1996
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1997
     With #reference, the sourceFile needs to be present after reload 
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1998
     in order to be browsable."
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1999
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2000
    |baseName fileName aStream dirName|
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2001
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2002
    baseName := (Smalltalk fileNameForClass:self name).
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2003
    fileName := baseName , '.cls'.
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2004
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2005
    Project notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2006
	dirName := Project currentProjectDirectory
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2007
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2008
	dirName := '.'
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2009
    ].
3002
0425e540f008 oops - filename changes ...
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
  2010
    fileName := dirName asFilename constructString:fileName.
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2011
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2012
    aStream := FileStream newFileNamed:fileName.
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2013
    aStream isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2014
	^ FileOutErrorSignal 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2015
		raiseRequestWith:fileName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2016
		errorString:('cannot create file:', fileName)
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2017
    ].
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2018
        
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2019
    aStream binary.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2020
    self binaryFileOutOn:aStream sourceMode:sourceMode.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2021
    aStream close.
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2022
3002
0425e540f008 oops - filename changes ...
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
  2023
    "Modified: 7.10.1997 / 13:40:00 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2024
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2025
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2026
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2027
    "create a file 'class.st' consisting of all methods in myself in
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2028
     sourceForm, from which the class can be reconstructed (by filing in).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2029
     If the current project is not nil, create the file in the projects
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2030
     directory. Care is taken, to not clobber any existing file in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2031
     case of errors (for example: disk full). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2032
     Also, since the classes methods need a valid sourcefile, the current 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2033
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2034
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2035
    |baseName dirName fileNameString|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2036
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2037
    baseName := (Smalltalk fileNameForClass:self name).
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2038
    fileNameString := baseName asFilename withSuffix:'st'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2039
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2040
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2041
     this test allows a smalltalk to be built without Projects/ChangeSets
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2042
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2043
    Project notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2044
	dirName := Project currentProjectDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2045
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2046
	dirName := Filename currentDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2047
    ].
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2048
    fileNameString := (dirName asFilename construct:fileNameString) name.
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2049
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2050
    self fileOutAs:fileNameString.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2051
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2052
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2053
"/     add a change record; that way, administration is much easier,
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2054
"/     since we can see in that changeBrowser, which changes have 
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2055
"/     already found their way into a sourceFile and which must be
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2056
"/     applied again
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2057
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2058
"/    self addChangeRecordForClassFileOut:self
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2059
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2060
    "Modified: 7.6.1996 / 09:14:43 / stefan"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2061
    "Modified: 16.4.1997 / 20:45:33 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2062
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2063
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2064
fileOutAllDefinitionsOn:aStream
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2065
    "append expressions on aStream, which defines myself and all of my private classes."
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2066
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2067
    self fileOutDefinitionOn:aStream.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2068
    aStream nextPutChunkSeparator. 
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2069
    aStream cr; cr.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2070
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2071
    "/
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2072
    "/ optional classInstanceVariables
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2073
    "/
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2074
    self class instanceVariableString isBlank ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2075
	self fileOutClassInstVarDefinitionOn:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2076
	aStream nextPutChunkSeparator. 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2077
	aStream cr; cr
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2078
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2079
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2080
    self privateClassesSorted do:[:aClass |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2081
	aClass fileOutAllDefinitionsOn:aStream
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2082
    ]
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2083
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2084
    "Created: 15.10.1996 / 11:15:19 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2085
    "Modified: 22.3.1997 / 16:11:56 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2086
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2087
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2088
fileOutAllMethodsOn:aStream
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2089
    |collectionOfCategories|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2090
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2091
    collectionOfCategories := self class categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2092
    collectionOfCategories notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2093
	collectionOfCategories do:[:aCategory |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2094
	    self class fileOutCategory:aCategory on:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2095
	    aStream cr
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2096
	]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2097
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2098
    collectionOfCategories := self categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2099
    collectionOfCategories notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2100
	collectionOfCategories do:[:aCategory |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2101
	    self fileOutCategory:aCategory on:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2102
	    aStream cr
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2103
	]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2104
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2105
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2106
    self privateClassesSorted do:[:aClass |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2107
	aClass fileOutAllMethodsOn:aStream
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2108
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2109
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2110
    "Created: 15.10.1996 / 11:13:00 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2111
    "Modified: 22.3.1997 / 16:12:17 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2112
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2113
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2114
fileOutAs:fileNameString
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2115
    "create a file consisting of all methods in myself in
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2116
     sourceForm, from which the class can be reconstructed (by filing in).
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2117
     The given fileName should be a full path, including suffix.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2118
     If the current project is not nil, create the file in the projects
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2119
     directory. Care is taken, to not clobber any existing file in
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2120
     case of errors (for example: disk full). 
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2121
     Also, since the classes methods need a valid sourcefile, the current 
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2122
     sourceFile may not be rewritten."
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2123
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2124
    |aStream fileName newFileName savFilename needRename
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2125
     mySourceFileName sameFile s mySourceFileID anySourceRef|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2126
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2127
    fileName := fileNameString asFilename.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2128
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2129
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2130
     if file exists, copy the existing to a .sav-file,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2131
     create the new file as XXX.new-file,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2132
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2133
    "
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2134
    (fileName exists) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2135
	sameFile := false.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2136
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2137
	"/ check carefully - maybe, my source does not really come from that
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2138
	"/ file (i.e. all of my methods have their source as string)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2139
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2140
	anySourceRef := false.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2141
	self methodDictionary do:[:m|
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2142
	    m sourcePosition notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2143
		anySourceRef := true
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2144
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2145
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2146
	self class methodDictionary do:[:m|
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2147
	    m sourcePosition notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2148
		anySourceRef := true
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2149
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2150
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2151
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2152
	anySourceRef ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2153
	    s := self sourceStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2154
	    s notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2155
		mySourceFileID := s pathName asFilename info id.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2156
		sameFile := (fileName info id) == mySourceFileID.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2157
		s close.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2158
	    ] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2159
		classFilename notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2160
		    "
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2161
		     check for overwriting my current source file
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2162
		     this is not allowed, since it would clobber my methods source
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2163
		     file ... you have to save it to some other place.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2164
		     This happens if you ask for a fileOut into the source-directory
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2165
		     (from which my methods get their source)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2166
		    "
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2167
		    mySourceFileName := Smalltalk getSourceFileName:classFilename. 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2168
		    sameFile := (fileNameString = mySourceFileName).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2169
		    sameFile ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2170
			mySourceFileName notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2171
			    sameFile := (fileName info id) == (mySourceFileName asFilename info id)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2172
			]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2173
		    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2174
		]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2175
	    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2176
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2177
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2178
	sameFile ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2179
	    ^ FileOutErrorSignal 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2180
		raiseRequestWith:fileNameString
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2181
		errorString:('may not overwrite sourcefile:', fileNameString)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2182
	].
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2183
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2184
	savFilename := Filename newTemporary.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2185
	fileName copyTo:savFilename.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2186
	newFileName := fileName withSuffix:'new'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2187
	needRename := true
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2188
    ] ifFalse:[
3180
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2189
	"/ another possible trap: if my sourceFileName is
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2190
	"/ the same as the written one AND the new files directory
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2191
	"/ is along the sourcePath, we also need a temporary file
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2192
	"/ first, to avoid accessing the newly written file.
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2193
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2194
	anySourceRef := false.
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2195
	self methodDictionary do:[:m|
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2196
	    |mSrc|
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2197
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2198
	    (mSrc := m sourceFilename) notNil ifTrue:[
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2199
		mSrc asFilename baseName = fileName baseName ifTrue:[
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2200
		    anySourceRef := true
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2201
		]
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2202
	    ]
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2203
	].
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2204
	self class methodDictionary do:[:m|
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2205
	    |mSrc|
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2206
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2207
	    (mSrc := m sourceFilename) notNil ifTrue:[
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2208
		mSrc asFilename baseName = fileName baseName ifTrue:[
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2209
		    anySourceRef := true
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2210
		]
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2211
	    ]
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2212
	].
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2213
	anySourceRef ifTrue:[
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2214
	    newFileName := fileName withSuffix:'new'.
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2215
	    needRename := true
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2216
	] ifFalse:[
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2217
	    newFileName := fileName.
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2218
	    needRename := false
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2219
	]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2220
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2221
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2222
    aStream := newFileName writeStream.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2223
    aStream isNil ifTrue:[
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2224
	savFilename notNil ifTrue:[
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2225
	    savFilename delete
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2226
	].
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2227
	^ FileOutErrorSignal 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2228
		raiseRequestWith:newFileName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2229
		errorString:('cannot create file:', newFileName name)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2230
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2231
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2232
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2233
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2234
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2235
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2236
     be careful, if the old one is a symbolic link; in this case,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2237
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2238
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2239
    needRename ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2240
	newFileName copyTo:fileName.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2241
	newFileName delete
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2242
    ].
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2243
    savFilename notNil ifTrue:[
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2244
	savFilename delete
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2245
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2246
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2247
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2248
     add a change record; that way, administration is much easier,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2249
     since we can see in that changeBrowser, which changes have 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2250
     already found their way into a sourceFile and which must be
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2251
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2252
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2253
    self addChangeRecordForClassFileOut:self
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2254
3180
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2255
    "Modified: / 7.6.1996 / 09:14:43 / stefan"
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2256
    "Created: / 16.4.1997 / 20:44:05 / cg"
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2257
    "Modified: / 15.1.1998 / 01:21:33 / cg"
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2258
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2259
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2260
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2261
    "append an expression to define my classInstanceVariables on aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2262
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2263
    aStream nextPutAll:(self name , ' class instanceVariableNames:''').
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2264
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2265
    aStream nextPutAll:''''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2266
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2267
    "mhmh - good idea; saw this in SmallDraw sourcecode ..."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2268
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2269
    aStream cr; cr; nextPut:(Character doubleQuote); cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2270
    aStream space; 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2271
	    nextPutLine:'The following class instance variables are inherited by this class:';
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2272
	    cr.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2273
    self allSuperclassesDo:[:aSuperClass |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2274
	aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2275
	aStream nextPutLine:(aSuperClass class instanceVariableString).
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2276
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2277
    aStream nextPut:(Character doubleQuote); cr.
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2278
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2279
    "Created: 10.12.1995 / 16:31:25 / cg"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2280
    "Modified: 9.11.1996 / 00:11:07 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2281
    "Modified: 1.4.1997 / 16:00:33 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2282
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2283
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2284
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2285
    "append an expression on aStream, which defines my comment"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2286
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2287
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2288
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2289
    self printClassNameOn:aStream.
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2290
    aStream nextPutAll:' comment:'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2291
    (comment := self comment) isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2292
	s := ''''''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2293
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2294
	s := comment storeString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2295
    ].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2296
    aStream nextPutAllAsChunk:s.
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  2297
    aStream nextPutChunkSeparator.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2298
    aStream cr
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2299
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2300
    "Modified: 21.12.1996 / 13:36:01 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2301
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2302
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2303
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2304
    "append an expression on aStream, which defines myself."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2305
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2306
    ^ self basicFileOutDefinitionOn:aStream withNameSpace:false
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2307
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2308
    "Modified: 4.1.1997 / 20:55:18 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2309
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2310
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2311
fileOutIn:aDirectoryName
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2312
    "create a file 'class.st' consisting of all methods in self in
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2313
     directory aDirectoryName (ignoring any directory setting in
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2314
     the current project). 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2315
     This is not logged in that change file (should it be ?)."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2316
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2317
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2318
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2319
    fileName := (Smalltalk fileNameForClass:self name), '.st'.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2320
    aStream := (aDirectoryName asFilename construct:fileName) writeStream.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2321
    aStream isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2322
	^ FileOutErrorSignal 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2323
		raiseRequestWith:fileName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2324
		errorString:('cannot create file:', fileName)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2325
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2326
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2327
    aStream close
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2328
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2329
    "
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2330
	self fileOutIn:'/tmp'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2331
	self fileOutIn:'/tmp' asFilename
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2332
    "
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2333
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2334
    "Modified: 19.9.1997 / 00:03:53 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2335
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2336
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2337
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2338
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2339
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2340
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2341
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2342
    "Created: 15.11.1995 / 12:53:32 / cg"
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2343
    "Modified: 3.1.1997 / 17:50:28 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2344
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2345
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2346
fileOutOn:aStream withTimeStamp:stampIt
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2347
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2348
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2349
    |collectionOfCategories copyrightMethod copyrightText comment versionMethod skippedMethods
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2350
     meta|
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2351
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2352
    self isLoaded ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2353
	^ FileOutErrorSignal 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2354
	    raiseRequestWith:self
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2355
		 errorString:'will not fileOut unloaded classes'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2356
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2357
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2358
    meta := self class.
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2359
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2360
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2361
     if there is a copyright method, add a copyright comment
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2362
     at the beginning, taking the string from the copyright method.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2363
     We cannot do this unconditionally - that would lead to my copyrights
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2364
     being put on your code ;-).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2365
     On the other hand: I want every file created by myself to have the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2366
     copyright string at the beginning be preserved .... even if the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2367
     code was edited in the browser and filedOut.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2368
    "
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2369
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2370
	"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2371
	 get the copyright methods source,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2372
	 and insert at beginning.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2373
	"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2374
	copyrightText := copyrightMethod source.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2375
	copyrightText isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2376
	    "
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2377
	     no source available - trigger an error
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2378
	    "
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2379
	    FileOutErrorSignal
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2380
		raiseRequestWith:'no source for class ' , self name , ' available. Cannot fileOut'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2381
	    ^ self
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2382
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2383
	"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2384
	 strip off the selector-line
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2385
	"
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2386
	copyrightText := copyrightText asCollectionOfLines asStringCollection.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2387
	copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2388
"/        copyrightText do:[:line | aStream nextPutAll:line. aStream cr.].
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2389
	copyrightText := copyrightText asString.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2390
	aStream nextPutAllAsChunk:copyrightText.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2391
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2392
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2393
    stampIt ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2394
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2395
	"/ first, a timestamp
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2396
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2397
	aStream nextPutAll:(Smalltalk timeStamp).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2398
	aStream nextPutChunkSeparator. 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2399
	aStream cr; cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2400
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2401
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2402
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2403
    "/ then the definition
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2404
    "/
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2405
    self fileOutAllDefinitionsOn:aStream.
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2406
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2407
    "/
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2408
    "/ a comment - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2409
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2410
    (comment := self comment) notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2411
	self fileOutCommentOn:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2412
	aStream cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2413
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2414
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2415
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2416
    "/ primitive definitions - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2417
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2418
    self fileOutPrimitiveSpecsOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2419
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2420
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2421
    "/ methods from all categories in metaclass (i.e. class methods)
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2422
    "/ EXCEPT: the version method is placed at the very end, to
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2423
    "/         avoid sourcePosition-shifts when checked out later.
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  2424
    "/         (RCS expands this string, so its size is not constant)
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2425
    "/
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2426
    collectionOfCategories := meta categories asSortedCollection.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2427
    collectionOfCategories notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2428
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2429
	"/ documentation first (if any), but not the version method
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2430
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2431
	(collectionOfCategories includes:'documentation') ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2432
	    versionMethod := meta compiledMethodAt:#version.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2433
	    versionMethod notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2434
		skippedMethods := Array with:versionMethod
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2435
	    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2436
	    meta fileOutCategory:'documentation' except:skippedMethods only:nil on:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2437
	    aStream cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2438
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2439
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2440
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2441
	"/ initialization next (if any)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2442
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2443
	(collectionOfCategories includes:'initialization') ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2444
	    meta fileOutCategory:'initialization' on:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2445
	    aStream cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2446
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2447
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2448
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2449
	"/ instance creation next (if any)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2450
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2451
	(collectionOfCategories includes:'instance creation') ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2452
	    meta fileOutCategory:'instance creation' on:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2453
	    aStream cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2454
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2455
	collectionOfCategories do:[:aCategory |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2456
	    ((aCategory ~= 'documentation')
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2457
	    and:[(aCategory ~= 'initialization')
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2458
	    and:[aCategory ~= 'instance creation']]) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2459
		meta fileOutCategory:aCategory on:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2460
		aStream cr
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2461
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2462
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2463
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2464
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2465
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2466
    "/ methods from all categories in myself
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2467
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2468
    collectionOfCategories := self categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2469
    collectionOfCategories notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2470
	collectionOfCategories do:[:aCategory |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2471
	    self fileOutCategory:aCategory on:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2472
	    aStream cr
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2473
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2474
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2475
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2476
    "/
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2477
    "/ any private classes' methods
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2478
    "/
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2479
    self privateClassesSorted do:[:aClass |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2480
	aClass fileOutAllMethodsOn:aStream
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2481
    ].
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2482
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2483
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2484
    "/
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2485
    "/ finally, the previously skipped version method
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2486
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2487
    versionMethod notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2488
	meta fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream.
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2489
    ].
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2490
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2491
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2492
    "/ optionally an initialize message
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2493
    "/
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2494
    (meta implements:#initialize) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2495
	self printClassNameOn:aStream. aStream nextPutAll:' initialize'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2496
	aStream nextPutChunkSeparator.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2497
	aStream cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2498
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2499
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2500
    "Created: 15.11.1995 / 12:53:06 / cg"
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2501
    "Modified: 22.3.1997 / 16:12:47 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2502
    "Modified: 1.4.1997 / 16:01:05 / stefan"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2503
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2504
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2505
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2506
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2507
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2508
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2509
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2510
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2511
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2512
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2513
    (s := self primitiveDefinitionsString) notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2514
	aStream nextPutChunkSeparator.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2515
	self printClassNameOn:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2516
	aStream nextPutAll:' primitiveDefinitions';
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2517
		nextPutChunkSeparator;
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2518
		cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2519
	aStream nextPutAll:s.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2520
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2521
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2522
    (s := self primitiveVariablesString) notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2523
	aStream nextPutChunkSeparator.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2524
	self printClassNameOn:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2525
	aStream nextPutAll:' primitiveVariables';
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2526
		nextPutChunkSeparator;
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2527
		cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2528
	aStream nextPutAll:s.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2529
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2530
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2531
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2532
    "Modified: 8.1.1997 / 17:45:40 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2533
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2534
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2535
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2536
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2537
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2538
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2539
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2540
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2541
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2542
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2543
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2544
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2545
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2546
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2547
    (s := self primitiveFunctionsString) notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2548
	aStream nextPutChunkSeparator.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2549
	self printClassNameOn:aStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2550
	aStream nextPutAll:' primitiveFunctions';
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2551
		nextPutChunkSeparator;
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2552
		cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2553
	aStream nextPutAll:s.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2554
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2555
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2556
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2557
    "Modified: 8.1.1997 / 17:45:51 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2558
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2559
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2560
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2561
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2562
htmlDocumentation
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2563
    ^ HTMLDocGenerator htmlDocOf:self
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2564
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2565
    "Created: 22.3.1997 / 14:18:23 / cg"
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2566
!
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2567
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2568
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2569
    "print the class variable names indented and breaking at line end"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2570
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2571
    self printNameArray:(self classVarNames) on:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2572
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2573
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2574
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2575
    "print myself and all subclasses on aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2576
     recursively calls itself to print subclasses. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2577
     Can be used to print hierarchy on the printer."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2578
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2579
    |nm|
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2580
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2581
    nm := self name.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2582
    aStream spaces:indent; bold; nextPutAll:nm; normal; nextPutAll:' ('.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2583
    self printInstVarNamesOn:aStream indent:(indent + nm size + 2).
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2584
    aStream nextPutLine:')'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2585
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2586
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2587
	aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2588
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2589
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2590
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2591
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2592
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2593
     printStream close"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2594
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2595
    "Modified: 13.12.1996 / 14:13:06 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2596
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2597
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2598
printOutCategory:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2599
    "print out all methods in aCategory on aPrintStream should be a PrintStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2600
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2601
    |dict any|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2602
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2603
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2604
    dict notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2605
	any := false.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2606
	dict do:[:aMethod |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2607
	    (aCategory = aMethod category) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2608
		any := true
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2609
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2610
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2611
	any ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2612
	     aPrintStream italic.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2613
	     aPrintStream nextPutAll:aCategory.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2614
	     aPrintStream normal.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2615
	     aPrintStream cr; cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2616
	     dict do:[:aMethod |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2617
		 (aCategory = aMethod category) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2618
		     self printOutSource:(aMethod source) on:aPrintStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2619
		     aPrintStream cr; cr
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2620
		 ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2621
	     ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2622
	     aPrintStream cr
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2623
	 ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2624
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2625
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2626
    "Modified: 12.6.1996 / 11:47:36 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2627
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2628
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2629
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2630
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2631
333
claus
parents: 328
diff changeset
  2632
    |comment s|
claus
parents: 328
diff changeset
  2633
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2634
    aPrintStream nextPutAll:'class                '; bold; nextPutLine:self name; normal. 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2635
    aPrintStream nextPutAll:'superclass           '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2636
    superclass isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2637
	s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2638
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2639
	s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2640
    ].
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2641
    aPrintStream nextPutLine:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2642
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2643
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2644
    self printInstVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2645
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2646
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2647
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2648
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2649
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2650
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2651
    category notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2652
	aPrintStream nextPutAll:'category             '; 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2653
		     nextPutLine:(category printString).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2654
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2655
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  2656
    (comment := self comment) notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2657
	aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2658
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2659
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2660
    "Created: 10.12.1995 / 16:30:47 / cg"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2661
    "Modified: 9.11.1996 / 00:13:37 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2662
    "Modified: 1.4.1997 / 16:01:26 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2663
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2664
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2665
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2666
    "print out all methods on aPrintStream which should be a printStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2667
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2668
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2669
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2670
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2671
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2672
    collectionOfCategories := self class categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2673
    collectionOfCategories notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2674
	aPrintStream nextPutLine:'class protocol'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2675
	aPrintStream cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2676
	collectionOfCategories do:[:aCategory |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2677
	    self class printOutCategory:aCategory on:aPrintStream
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2678
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2679
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2680
    collectionOfCategories := self categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2681
    collectionOfCategories notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2682
	aPrintStream nextPutLine:'instance protocol'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2683
	aPrintStream cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2684
	collectionOfCategories do:[:aCategory |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2685
	    self printOutCategory:aCategory on:aPrintStream
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2686
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2687
    ]
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2688
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2689
    "Modified: 9.11.1996 / 00:14:11 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2690
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2691
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2692
printOutSource:aString on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2693
    "print out a source-string; the message-specification is printed bold,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2694
     comments are printed italic"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2695
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2696
    |text textIndex textSize line lineIndex lineSize inComment aCharacter|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2697
    text := aString asStringCollection.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2698
    aPrintStream bold.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2699
    aPrintStream nextPutAll:(text at:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2700
    aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2701
    aPrintStream cr.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2702
    inComment := false.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2703
    textSize := text size.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2704
    textIndex := 2.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2705
    [textIndex <= textSize] whileTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2706
	line := text at:textIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2707
	((line occurrencesOf:Character doubleQuote) == 0) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2708
	    aPrintStream nextPutAll:line
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2709
	] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2710
	    lineSize := line size.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2711
	    lineIndex := 1.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2712
	    [lineIndex <= lineSize] whileTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2713
		aCharacter := line at:lineIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2714
		(aCharacter == Character doubleQuote) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2715
		    inComment ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2716
			aPrintStream normal.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2717
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2718
			inComment := false
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2719
		    ] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2720
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2721
			aPrintStream italic.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2722
			inComment := true
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2723
		    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2724
		] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2725
		    aPrintStream nextPut:aCharacter
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2726
		].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2727
		lineIndex := lineIndex + 1
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2728
	    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2729
	].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2730
	aPrintStream cr.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2731
	textIndex := textIndex + 1
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2732
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2733
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2734
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2735
!Class methodsFor:'private changes management'!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2736
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2737
addChangeRecordForChangeCategory:category to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2738
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2739
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2740
    "append a category change record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2741
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2742
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2743
    aStream nextPutAll:(' category:' , category storeString).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2744
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2745
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2746
    "this test allows a smalltalk without Projects/ChangeSets"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2747
    Project notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2748
	Project addClassDefinitionChangeFor:self
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2749
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2750
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2751
    "Created: 3.12.1995 / 13:43:33 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2752
    "Modified: 3.12.1995 / 14:10:34 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2753
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2754
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2755
addChangeRecordForClass:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2756
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2757
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2758
    "append a class-definition-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2759
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2760
    aClass isLoaded ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2761
	aClass fileOutDefinitionOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2762
	aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2763
	Project notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2764
	    Project addClassDefinitionChangeFor:aClass 
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2765
	]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2766
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2767
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2768
    "Created: 3.12.1995 / 13:57:44 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2769
    "Modified: 3.12.1995 / 14:11:26 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2770
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2771
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2772
addChangeRecordForClassComment:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2773
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2774
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2775
    "append a class-comment-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2776
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2777
    aClass fileOutCommentOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2778
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2779
    "Modified: 4.3.1996 / 16:49:08 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2780
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2781
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2782
addChangeRecordForClassInstvars:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2783
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2784
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2785
    "append a class-instvars-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2786
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2787
    aClass fileOutClassInstVarDefinitionOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2788
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2789
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2790
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2791
addChangeRecordForClassRemove:oldName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2792
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2793
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2794
    "append a class-remove-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2795
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2796
    aStream nextPutAll:('Smalltalk removeClass:' , oldName).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2797
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2798
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2799
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2800
addChangeRecordForClassRename:oldName to:newName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2801
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2802
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2803
    "append a class-rename-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2804
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  2805
    aStream nextPutAll:('Smalltalk renameClass:' , oldName, ' to:''' , newName , '''').
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2806
    aStream nextPutChunkSeparator.
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  2807
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  2808
    "Modified: 30.10.1996 / 20:27:02 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2809
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2810
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2811
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2812
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2813
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2814
    "append a primitiveDefinitions-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2815
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2816
    aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2817
	    nextPutAll:(aClass primitiveDefinitionsString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2818
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2819
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2820
    "Modified: 9.11.1996 / 00:09:54 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2821
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2822
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2823
addChangeRecordForPrimitiveFunctions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2824
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2825
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2826
    "append a primitiveFunctions-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2827
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2828
    aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2829
	    nextPutAll:(aClass primitiveFunctionsString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2830
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2831
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2832
    "Modified: 9.11.1996 / 00:10:02 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2833
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2834
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2835
addChangeRecordForPrimitiveVariables:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2836
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2837
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2838
    "append a primitiveVariables-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2839
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2840
    aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2841
	    nextPutAll:(aClass primitiveVariablesString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2842
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2843
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2844
    "Modified: 9.11.1996 / 00:10:10 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2845
! !
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2846
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2847
!Class methodsFor:'private helpers'!
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2848
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2849
getPrimitiveSpecsAt:index
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2850
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2851
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2852
    "return a primitiveSpecification component as string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2853
2172
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  2854
    |owner pos stream string|
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  2855
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  2856
    (owner := self owningClass) notNil ifTrue:[^ owner getPrimitiveSpecsAt:index].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2857
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2858
    primitiveSpec isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2859
    pos := primitiveSpec at:index.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2860
    pos isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2861
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2862
    "the primitiveSpec is either a string, or an integer specifying the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2863
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2864
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2865
    pos isNumber ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2866
	classFilename notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2867
	    stream := self sourceStream. 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2868
	    stream notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2869
		stream position:pos+1.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2870
		string := stream nextChunk.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2871
		stream close.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2872
		^ string
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2873
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2874
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2875
	^ nil
544
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  2876
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2877
    ^ pos
2172
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  2878
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  2879
    "Modified: 15.1.1997 / 15:29:30 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2880
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2881
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2882
setPrimitiveSpecsAt:index to:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2883
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2884
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2885
    "set a primitiveSpecification component to aString"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2886
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2887
    primitiveSpec isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2888
	primitiveSpec := Array new:3
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2889
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2890
    primitiveSpec at:index put:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2891
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2892
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2893
!Class methodsFor:'protocol printOut'!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2894
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2895
printOutProtocolOn:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2896
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2897
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2898
    |collectionOfCategories|
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2899
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2900
    self printOutDefinitionOn:aPrintStream.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2901
    aPrintStream cr.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2902
    collectionOfCategories := self class categories.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2903
    collectionOfCategories notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2904
	aPrintStream nextPutLine:'class protocol'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2905
	aPrintStream cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2906
	collectionOfCategories do:[:aCategory |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2907
	    self class printOutCategoryProtocol:aCategory on:aPrintStream
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2908
	]
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2909
    ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2910
    collectionOfCategories := self categories.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2911
    collectionOfCategories notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2912
	aPrintStream nextPutLine:'instance protocol'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2913
	aPrintStream cr.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2914
	collectionOfCategories do:[:aCategory |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2915
	    self printOutCategoryProtocol:aCategory on:aPrintStream
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2916
	]
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2917
    ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2918
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  2919
    "Modified: 9.11.1996 / 00:14:26 / cg"
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2920
! !
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  2921
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2922
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2923
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2924
isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2925
    "return true, if the receiver is some kind of class 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2926
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2927
     true is returned here - the method is redefined from Object.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2928
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2929
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2930
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2931
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2932
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2933
     Point isClass  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2934
     1 isClass      
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2935
     Behavior new isBehavior  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2936
     Behavior new isClass       
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2937
     Class new isBehavior    
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2938
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2939
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2940
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2941
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2942
rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2943
    "return a collection of classes which have a nil superclass"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2944
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2945
    |set|
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2946
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2947
    set := IdentitySet new.
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2948
    Smalltalk allBehaviorsDo:[:aClass | 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  2949
	aClass superclass isNil ifTrue:[set add:aClass]
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2950
    ].
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2951
    ^ set asOrderedCollection
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2952
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2953
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2954
     Class rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2955
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2956
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2957
    "Modified: 18.4.1997 / 20:55:34 / cg"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2958
!
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  2959
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2960
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2961
    "return true, if this class came into the system via an
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2962
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2963
     This is not an attribute of the class, but instead remembered in
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2964
     Autoload. The interface here is for your convenience."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2965
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2966
    ^ Autoload wasAutoloaded:self
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2967
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  2968
    "Modified: 21.3.1996 / 16:27:09 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2969
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2970
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2971
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2972
    "return the class which defines the class variable
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2973
     named aVariableName. This method should not be used for
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2974
     repeated searches (i.e. in the compiler/parser), since it creates
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2975
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2976
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2977
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2978
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2979
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2980
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2981
	(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2982
	cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2983
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2984
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2985
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2986
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2987
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2988
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2989
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2990
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2991
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2992
!Class methodsFor:'renaming'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  2993
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  2994
makePrivateIn:newOwner
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  2995
    "make a private class of newOwner from the receiver;
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  2996
     the receiver must be public class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  2997
     Returns the new private class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  2998
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  2999
    |sel newClass|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3000
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3001
    self owningClass notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3002
	^ self
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3003
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3004
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3005
    sel := self definitionSelectorPrivate.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3006
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3007
    newClass := self superclass
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3008
	perform:sel
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3009
	withArguments:(Array 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3010
			with:(self name asSymbol)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3011
			with:(self instanceVariableString)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3012
			with:(self classVariableString)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3013
			with:''
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3014
			with:newOwner).
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3015
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3016
    "/ copy over methods ...
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3017
    self class copyInvalidatedMethodsFrom:self class for:newClass class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3018
    self class copyInvalidatedMethodsFrom:self for:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3019
    newClass class recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3020
    newClass recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3021
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3022
    newOwner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3023
    Smalltalk changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3024
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3025
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3026
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3027
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3028
    "Modified: 5.8.1997 / 14:30:30 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3029
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3030
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3031
makePublic
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3032
    "make a public class from the receiver.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3033
     The receiver must be a private class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3034
     Returns the new public class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3035
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3036
    |sel owner newClass|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3037
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3038
    owner := self topOwningClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3039
    owner isNil ifTrue:[^ self].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3040
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3041
    "/ first, create the public class ...
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3042
    sel := self definitionSelector.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3043
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3044
    Class nameSpaceQuerySignal answer:Smalltalk
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3045
    do:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3046
	newClass := self superclass
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3047
	    perform:sel
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3048
	    withArguments:(Array 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3049
			    with:(self nameWithoutPrefix asSymbol)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3050
			    with:(self instanceVariableString)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3051
			    with:(self classVariableString)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3052
			    with:''
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3053
			    with:(owner category)).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3054
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3055
	"/ copy over methods ...
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3056
	self class copyInvalidatedMethodsFrom:self class for:newClass class.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3057
	self class copyInvalidatedMethodsFrom:self for:newClass.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3058
	newClass class recompileInvalidatedMethods.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3059
	newClass recompileInvalidatedMethods.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3060
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3061
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3062
    owner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3063
    Smalltalk changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3064
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3065
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3066
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3067
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3068
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3069
    "Created: 23.6.1997 / 13:28:52 / cg"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3070
    "Modified: 20.10.1997 / 21:43:38 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3071
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3072
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3073
renameTo:newName
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3074
    "change the name of the class. This does not write a change record."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3075
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3076
    |oldSym newSym|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3077
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3078
    "/ the code below is obsolete - it does not deal with
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3079
    "/ classVariables, private classes and does not
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3080
    "/ recompile other classes in order to car for namespace
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3081
    "/ changes.
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3082
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3083
    self obsoleteMethodWarning.
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3084
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3085
    oldSym := name asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3086
    newSym := newName asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3087
    self setName:newSym.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3088
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3089
    Smalltalk at:oldSym put:nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3090
    Smalltalk removeKey:oldSym.             "26.jun 93"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3091
    Smalltalk at:newSym put:self.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3092
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3093
    "Created: 1.4.1997 / 15:27:53 / stefan"
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3094
    "Modified: 5.8.1997 / 14:24:13 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3095
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3096
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3097
!Class methodsFor:'signature checking'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3098
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3099
classinstSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3100
    "for checking class compatibility: return some number based on 
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3101
     the classinstSize from a signature key (not always the real classinstsize)."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3102
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3103
    ^ (aSignature bitShift:-7) bitAnd:7
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3104
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3105
    "Created: 1.4.1997 / 15:23:01 / stefan"
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3106
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3107
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3108
instNameKeyFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3109
    "for checking class compatibility: return a number based on the
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3110
     names and order of the instance variables from a signature key."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3111
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3112
    ^ (aSignature bitShift:-14) bitAnd:16rFFFF
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3113
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3114
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3115
     Point instNameKeyFromSignature:Point signature.             
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3116
     Association instNameKeyFromSignature:Association signature.  
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3117
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3118
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3119
    "Created: 1.4.1997 / 15:23:07 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3120
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3121
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3122
instSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3123
    "for checking class compatibility: return the some number based on
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3124
     the instSize from a signature key (not always the real instSize)."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3125
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3126
    ^ aSignature bitAnd:16r7F
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3127
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3128
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3129
     Class instSizeFromSignature:Point signature.     
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3130
     Class instSizeFromSignature:Association signature.   
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3131
     Class instSizeFromSignature:Dictionary signature.    
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3132
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3133
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3134
    "Created: 1.4.1997 / 15:23:15 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3135
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3136
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3137
instTypeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3138
    "for checking class compatibility: return some number based on
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3139
     the instType (i.e. variableBytes/Pointers etc.) from a signature key."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3140
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3141
    ^ (aSignature bitShift:-10) bitAnd:(Class maskIndexType)
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3142
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3143
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3144
     Class instTypeFromSignature:Object signature.               
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3145
     Class instTypeFromSignature:Array signature.                
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3146
     Class instTypeFromSignature:String signature.               
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3147
     Class instTypeFromSignature:OrderedCollection signature.    
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3148
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3149
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3150
    "Created: 1.4.1997 / 15:23:20 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3151
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3152
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3153
signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3154
    "return a signature number - this number is useful for a quick
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3155
     check for changed classes, and is done in the binary-object loader, 
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3156
     and the dynamic class loader.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3157
     Do NOT change the algorithm here - others may depend on it.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3158
     Also, the algorithm may change - so never interpret the returned value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3159
     (if at all, use the access #XXXFromSignature: methods)"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3160
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3161
    |value   "{ Class: SmallInteger }"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3162
     nameKey "{ Class: SmallInteger }" |
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3163
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3164
    signature notNil ifTrue:[^ signature].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3165
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3166
    value := self flags bitAnd:(Class maskIndexType).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3167
    value := (value bitShift:3) + ((self class instSize - Class instSize) bitAnd:7).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3168
    value := (value bitShift:7) + (self instSize bitAnd:16r7F).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3169
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3170
    nameKey := 0.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3171
    self allInstVarNames do:[:name |
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3172
	nameKey := nameKey bitShift:1.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3173
	(nameKey bitAnd:16r10000) ~~ 0 ifTrue:[
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3174
	    nameKey := nameKey bitXor:1.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3175
	    nameKey := nameKey bitAnd:16rFFFF.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3176
	].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3177
	nameKey := (nameKey + (name at:1) asciiValue) bitAnd:16rFFFF.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3178
    ].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3179
    value := value + (nameKey bitShift:14).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3180
    signature := value.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3181
    ^ value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3182
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3183
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3184
     Array signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3185
     ByteArray signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3186
     View signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3187
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3188
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3189
    "Created: 1.4.1997 / 15:23:24 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3190
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3191
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3192
!Class methodsFor:'source management'!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3193
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3194
binaryRevision
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3195
    "return the revision-ID from which the class was stc-compiled;
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3196
     nil if its an autoloaded or filedIn class.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3197
     If a classes binary is up-to-date w.r.t. the source repository,
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3198
     the returned string is the same as the one returned by #revision."
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3199
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3200
    |owner info c|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3201
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3202
    (owner := self owningClass) notNil ifTrue:[^ owner binaryRevision].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3203
    revision notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3204
	c := revision first.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3205
	c == $$ ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3206
	    info := Class revisionInfoFromString:revision.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3207
	    info isNil ifTrue:[^ '0'].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3208
	    ^ info at:#revision ifAbsent:'0'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3209
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3210
	c isDigit ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3211
	    ^ '0'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3212
	].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3213
    ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3214
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3215
    ^ revision
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3216
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3217
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3218
     Object binaryRevision
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3219
     Object class binaryRevision
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3220
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3221
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3222
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3223
     to find all classes which are not up-to-date:
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3224
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3225
     |classes|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3226
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3227
     classes := Smalltalk allClasses 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3228
		    select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3229
     SystemBrowser browseClasses:classes title:'classes which are not up-to-date'
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3230
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3231
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3232
    "Created: 7.12.1995 / 10:58:47 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3233
    "Modified: 1.4.1997 / 23:33:01 / stefan"
2909
b4df6be2ed52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2906
diff changeset
  3234
    "Modified: 9.9.1997 / 12:05:41 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3235
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3236
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3237
localSourceStreamFor:sourceFile
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3238
    "return an open stream on a local sourcefile, nil if that is not available"
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3239
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3240
    |fileName info module dir fn package|
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3241
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3242
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3243
    "/ old: look in 'source/<filename>'
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3244
    "/ this is still kept in order to find user-private
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3245
    "/ classes in her currentDirectory.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3246
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3247
    fileName := Smalltalk getSourceFileName:sourceFile.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3248
    fileName notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3249
	^ fileName asFilename readStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3250
    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3251
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3252
    (package := self package) notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3253
	(package includes:$:) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3254
	    package := package asString copy replaceAll:$: with:$/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3255
	] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3256
	    package := 'stx/' , package
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3257
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3258
	fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3259
	fileName notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3260
	    ^ fileName asFilename readStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3261
	].
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3262
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3263
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3264
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3265
    "/ new: look in 'source/<module>/<package>/<filename>
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3266
    "/ this makes the symbolic links to (or copy of) the source files
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3267
    "/ obsolete.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3268
    info := self packageSourceCodeInfo.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3269
    info notNil ifTrue:[
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3270
	module := info at:#module ifAbsent:nil.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3271
	module notNil ifTrue:[
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3272
	    dir := info at:#directory ifAbsent:nil.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3273
	    dir notNil ifTrue:[
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3274
		fn := (module asFilename construct:dir) construct:sourceFile.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3275
		fileName := Smalltalk getSourceFileName:(fn name).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3276
		fileName notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3277
		    ^ fileName asFilename readStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3278
		].
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3279
	    ]
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3280
	]
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3281
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3282
    ^ nil
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3283
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3284
    "Modified: / 9.1.1998 / 15:02:46 / cg"
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3285
!
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3286
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3287
packageSourceCodeInfo
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3288
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3289
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3290
    "return the sourceCodeInfo, which defines the module and the subdirectory
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3291
     in which the receiver class was built. 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3292
     This info is extracted from the package id (which is added to stc-compiled classes).
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3293
     This method is to be obsoleted soon, since the same info is now found
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3294
     in the versionString.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3295
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3296
     The info returned consists of a dictionary
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3297
     filled with (at least) values at: #module, #directory and #library.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3298
     If no such info is present in the class, nil is returned.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3299
     (this happens with autoloaded and filed-in classes)
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3300
     Auotloaded classes set their package from the revisionInfo, if present.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3301
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3302
     By convention, this info is encoded in the classes package
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3303
     string (which is given as argument to stc) as the last word in parenthesis. 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3304
     The info consists of 1 to 3 subcomponents, separated by colons.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3305
     The first defines the classes module (i.e. some application identifier), 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3306
     the second defines the subdirectory within that module, the third
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3307
     defines the name of the class library. 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3308
     If left blank, the module info defaults to 'stx',
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3309
     the directory info defaults to library name.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3310
     The library name may not be left blank.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3311
     (this is done for backward compatibility,)
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3312
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3313
     For example: 
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3314
	'....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3315
	'....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3316
	'....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3317
	'....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase 
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3318
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3319
     The way how the sourceCodeManager uses this to find the source location
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3320
     depends on the scheme used. For CVS, the module is taken as the -d arg,
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3321
     while the directory is prepended to the file name.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3322
     Other schemes may do things differently - these are not yet specified.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3323
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3324
     Caveat:
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3325
	Encoding this info in the package string seems somewhat kludgy.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3326
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3327
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3328
    |owner sourceInfo packageString idx1 idx2 
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  3329
     moduleString directoryString libraryString components dirComponents mgr|
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3330
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3331
    (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3332
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3333
    package isNil ifTrue:[^ nil].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3334
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3335
    packageString := package asString.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3336
    idx1 := packageString lastIndexOf:$(.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3337
    idx1 ~~ 0 ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3338
	idx2 := packageString indexOf:$) startingAt:idx1+1.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3339
	idx2 ~~ 0 ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3340
	    sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3341
	]
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  3342
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3343
	sourceInfo := packageString
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3344
    ].
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  3345
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3346
    sourceInfo isNil ifTrue:[^ nil].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3347
    components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3348
    components size == 0 ifTrue:[
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  3349
"/        moduleString := 'stx'.
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  3350
"/        directoryString := libraryString := ''.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3351
	^ nil
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  3352
    ].
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  3353
    components size == 1 ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3354
	"/ a single name given - the module becomes 'stx' or
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3355
	"/ the very first directory component (if such a module exists).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3356
	"/ If the component includes slashes, its the directory
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3357
	"/ otherwise the library
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3358
	"/ 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3359
	dirComponents := Filename concreteClass components:(components at:1).     
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3360
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3361
	(dirComponents size > 1
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3362
	and:[(mgr := self sourceCodeManager) notNil
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3363
	and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3364
	    moduleString := dirComponents first.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3365
	    directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3366
	] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3367
	    moduleString := 'stx'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3368
	    directoryString := libraryString := components at:1.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3369
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3370
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3371
	(libraryString includes:$/) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3372
	    libraryString := libraryString asFilename baseName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3373
	]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3374
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3375
	components size == 2 ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3376
	    "/ two components - assume its the module and the directory; 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3377
	    "/ the library is assumed to be named after the directory
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3378
	    "/ except, if slashes are in the name; then the libraryname
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3379
	    "/ is the last component.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3380
	    "/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3381
	    moduleString := components at:1.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3382
	    directoryString := libraryString := components at:2.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3383
	    (libraryString includes:$/) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3384
		libraryString := libraryString asFilename baseName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3385
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3386
	] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3387
	    "/ all components given
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3388
	    moduleString := components at:1.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3389
	    directoryString := components at:2.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3390
	    libraryString := components at:3.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3391
	]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3392
    ].
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  3393
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3394
    libraryString isEmpty ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3395
	directoryString notEmpty ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3396
	    libraryString := directoryString asFilename baseName
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3397
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3398
	libraryString isEmpty ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3399
	    "/ lets extract the library from the liblist file ...
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3400
	    libraryString := Smalltalk libraryFileNameOfClass:self.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3401
	    libraryString isNil ifTrue:[^ nil].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3402
	]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3403
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3404
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3405
    moduleString isEmpty ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3406
	moduleString := 'stx'.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3407
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3408
    directoryString isEmpty ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3409
	directoryString := libraryString.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3410
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3411
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3412
    ^ IdentityDictionary
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3413
	with:(#module->moduleString)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3414
	with:(#directory->directoryString)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3415
	with:(#library->libraryString)
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3416
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3417
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3418
     Object packageSourceCodeInfo     
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3419
     View packageSourceCodeInfo    
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3420
     Model packageSourceCodeInfo  
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3421
     BinaryObjectStorage packageSourceCodeInfo  
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3422
     MemoryMonitor packageSourceCodeInfo  
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3423
     ClockView packageSourceCodeInfo  
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3424
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3425
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3426
    "Created: 4.11.1995 / 20:36:53 / cg"
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  3427
    "Modified: 19.9.1997 / 10:42:25 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3428
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3429
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3430
revision
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3431
    "return the revision-ID of the class which corresponds to the
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3432
     rcs-id of the source to which this class is equivalent.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3433
     Initially, this is the same as #binaryRevision; however, once changes have
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3434
     been checked into a source repository, the binary continues to remain based upon
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3435
     the old revision, while logically, the class has the new (checked-in) revision.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3436
     To check if a source corresponds to a compiled binary, compare this 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3437
     ID with the one returned by #binaryRevision."
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3438
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3439
    |info|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3440
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3441
    info := self revisionInfo.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3442
    info notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3443
	^ info at:#revision ifAbsent:nil
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3444
    ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3445
    ^ self binaryRevision
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3446
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3447
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3448
     Object revision 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3449
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3450
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3451
    "Created: 11.11.1995 / 14:27:20 / cg"
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3452
    "Modified: 12.12.1995 / 20:30:20 / cg"
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3453
    "Modified: 26.3.1997 / 00:14:00 / stefan"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3454
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3455
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3456
revisionDateString
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3457
    "return the revision-Date of the class as a string.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3458
     This is extracted from the version string."
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3459
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3460
    |info|
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3461
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3462
    info := self revisionInfo.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3463
    info notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3464
	^ info at:#date ifAbsent:'??/??/??'
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3465
    ].
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3466
    ^ '??/??/??'
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3467
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3468
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3469
     Object revisionDateString 
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3470
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3471
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3472
    "Created: 23.4.1997 / 12:29:21 / cg"
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3473
!
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  3474
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3475
revisionInfo
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3476
    "return a dictionary filled with revision info.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3477
     This extracts the relevant info from the revisionString.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3478
     The revisionInfo contains all or a subset of:
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3479
	#binaryRevision - the revision upon which the binary of this class is based
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3480
	#revision       - the revision upon which the class is based logically
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3481
			  (different, if a changed class was checked in, but not yet recompiled)
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3482
	#user           - the user who checked in the logical revision
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3483
	#date           - the date when the logical revision was checked in
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3484
	#time           - the time when the logical revision was checked in
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3485
	#fileName       - the classes source file name
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3486
	#repositoryPath - the classes source container
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3487
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3488
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  3489
    |vsnString info mgr|
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3490
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3491
    vsnString := self revisionString.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3492
    vsnString notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3493
	mgr := self sourceCodeManager.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3494
	mgr notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3495
	    info := mgr revisionInfoFromString:vsnString
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3496
	] ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3497
	    info := Class revisionInfoFromString:vsnString.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3498
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3499
	info notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3500
	    info at:#binaryRevision put:self binaryRevision.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3501
	]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3502
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3503
    ^ info
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3504
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3505
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3506
     Object revisionString 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3507
     Object revisionInfo 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3508
     Image revisionInfo 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3509
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3510
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3511
    "Created: 11.11.1995 / 14:27:20 / cg"
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  3512
    "Modified: 29.1.1997 / 18:59:12 / cg"
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3513
    "Modified: 26.3.1997 / 00:13:17 / stefan"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3514
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3515
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3516
revisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3517
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3518
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3519
    "return my revision string; that one is extracted from the
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3520
     classes #version method. Either this is a method returning that string,
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3521
     or its a comment-only method and the comment defines the version.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3522
     If the source is not accessable or no such method exists,
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3523
     nil is returned."
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3524
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3525
    |owner cls meta m src val|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3526
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3527
    (owner := self owningClass) notNil ifTrue:[^ owner revisionString].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3528
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3529
    thisContext isRecursive ifTrue:[^ nil ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3530
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3531
    self isMeta ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3532
	meta := self. cls := self soleInstance
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3533
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3534
	cls := self. meta := self class
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3535
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3536
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3537
    m := meta compiledMethodAt:#version.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3538
    m isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3539
	m := cls compiledMethodAt:#version.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3540
	m isNil ifTrue:[^ nil].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3541
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3542
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3543
    m isExecutable ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3544
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3545
	"/ if its a method returning the string,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3546
	"/ thats the returned value
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3547
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3548
	val := cls version.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3549
	val isString ifTrue:[^ val].
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3550
    ].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3551
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3552
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3553
    "/ if its a method consisting of a comment only
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3554
    "/ extract it - this may lead to a recursive call
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3555
    "/ to myself (thats what the #isRecursive is for)
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3556
    "/ in case we need to access the source code manager
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3557
    "/ for the source ...
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3558
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3559
    src := m source.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3560
    src isNil ifTrue:[^ nil].
1811
8afb43250471 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
  3561
    ^ Class revisionStringFromSource:src 
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3562
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3563
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3564
     Smalltalk allClassesDo:[:cls |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3565
	Transcript showCR:cls revisionString
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3566
     ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3567
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3568
     Number revisionString  
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3569
     FileDirectory revisionString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3570
     Metaclass revisionString
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3571
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3572
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3573
    "Created: 29.10.1995 / 19:28:03 / cg"
1811
8afb43250471 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
  3574
    "Modified: 23.10.1996 / 18:23:56 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3575
    "Modified: 1.4.1997 / 23:37:25 / stefan"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3576
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3577
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3578
setBinaryRevision:aString
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3579
    "set the revision-ID.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3580
     This should normally not be done in the running system, as the source-manager
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3581
     will need this to validate sourcefiles being correct for a given binary
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3582
     (and optionally: extracting the required sourcefile from the rcs source)"
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3583
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3584
    revision := aString
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3585
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3586
    "Created: 9.12.1995 / 17:05:17 / cg"
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3587
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3588
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3589
setPackageFromRevision
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3590
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3591
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3592
    "set my package from the info found in the revisionString if present.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3593
     This is used to set some useful packageInfo after autoloading
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3594
     (otherwise, autoloaded classes/methods would go into your current
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3595
      package - which is probably not a good idea)"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3596
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3597
    |info mgr dir lib mod p|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3598
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  3599
    self owningClass notNil ifTrue:[^ self].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  3600
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3601
    mgr := self sourceCodeManager.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3602
    mgr notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3603
	info := mgr sourceInfoOfClass:self
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3604
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3605
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3606
    info notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3607
	mod := info at:#module ifAbsent:nil.    "/ stx, aeg, <your-organization>
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3608
	dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ...
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3609
	lib := info at:#library ifAbsent:dir.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3610
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3611
	p := ''.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3612
	mod notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3613
	    mod ~= 'stx' ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3614
		p := p , mod
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3615
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3616
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3617
	dir notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3618
	    p notEmpty ifTrue:[p := p , ':'].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3619
	    p := p , dir.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3620
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3621
	lib notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3622
	    lib ~= dir ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3623
		p notEmpty ifTrue:[p := p , ':'].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3624
		p := p , lib.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3625
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3626
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3627
	(p notEmpty and:[p ~= package]) ifTrue:[
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  3628
"/            package notNil ifTrue:[
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  3629
"/                (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR.
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  3630
"/            ].
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3631
	    package := p.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3632
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3633
	    self methodDictionary do:[:aMethod |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3634
		aMethod package isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3635
		    aMethod package:p
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3636
		]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3637
	    ]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3638
	].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3639
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3640
    ^ self
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3641
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3642
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3643
     MemoryMonitor autoload.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3644
     MemoryMonitor setPackageFromRevision
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3645
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3646
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3647
    "Modified: 12.6.1996 / 11:49:31 / stefan"
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  3648
    "Modified: 7.1.1997 / 12:01:08 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3649
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3650
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3651
sourceStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3652
    "return an open stream on my sourcefile, nil if that is not available"
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3653
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3654
    |owner source|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3655
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3656
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStream].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3657
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3658
    classFilename notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3659
	source := classFilename
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3660
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3661
	source := (Smalltalk fileNameForClass:self) , '.st'
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3662
    ].
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3663
    ^ self sourceStreamFor:source
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3664
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3665
    "Modified: 15.10.1996 / 18:59:40 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3666
    "Modified: 1.4.1997 / 14:33:12 / stefan"
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3667
!
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3668
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3669
sourceStreamFor:source
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3670
    "return an open stream on a sourcefile, nil if that is not available"
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3671
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3672
    |owner fileName aStream mgr validated|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3673
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3674
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3675
    validated := false.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3676
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3677
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3678
    "/ if there is no SourceCodeManager, 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3679
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3680
    "/ look in standard places first
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3681
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3682
    ((mgr := self sourceCodeManager) isNil 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3683
    or:[TryLocalSourceFirst == true]) ifTrue:[
2917
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  3684
	aStream := self localSourceStreamFor:source.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3685
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3686
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3687
    aStream isNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3688
	"/      
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3689
	"/ hard case - there is no source file for this class
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3690
	"/ (in the source-dir-path).
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3691
	"/      
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3692
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3693
	"/      
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3694
	"/ look if my binary is from a dynamically loaded module,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3695
	"/ and, if so, look in the modules directory for the
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3696
	"/ source file.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3697
	"/      
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3698
	ObjectFileLoader notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3699
	    ObjectFileLoader loadedObjectHandlesDo:[:h |
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3700
		|f classes|
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3701
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3702
		aStream isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3703
		    (classes := h classes) notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3704
			(classes includes:self) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3705
			    f := h pathName.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3706
			    f := f asFilename directory.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3707
			    f := f construct:source.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3708
			    f exists ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3709
				aStream := f readStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3710
			    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3711
			].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3712
		    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3713
		]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3714
	    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3715
	].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3716
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3717
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3718
    aStream isNil ifTrue:[
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3719
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3720
	"/ mhmh - still no source file.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3721
	"/ If there is a SourceCodeManager, ask it to aquire the
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3722
	"/ the source for my class, and return an open stream on it. 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3723
	"/ if that one does not know about the source, look in
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3724
	"/ standard places
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3725
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3726
	mgr notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3727
	    aStream := mgr getSourceStreamFor:self.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3728
	    aStream notNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3729
		(self validateSourceStream:aStream) ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3730
		    ('Class [info]: repositories source for `' 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3731
		     , (self isMeta ifTrue:[self soleInstance name]
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3732
				    ifFalse:[name])
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3733
		     , ''' is invalid.') infoPrintCR.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3734
		    aStream close.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3735
		    aStream := nil
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3736
		] ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3737
		    validated := true.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3738
		].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3739
	    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3740
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3741
	    aStream isNil ifTrue:[
2917
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  3742
		aStream := self localSourceStreamFor:source.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3743
	    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3744
	].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3745
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3746
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3747
	"/ final chance: try current directory
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3748
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3749
	aStream isNil ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3750
	    aStream := source asFilename readStream.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3751
	].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3752
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3753
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3754
    (aStream notNil and:[validated not]) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3755
	(self validateSourceStream:aStream) ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3756
	    ('Class [warning]: source for ''' , self name , ''' is invalid. Take care.') errorPrintCR
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3757
	].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  3758
    ].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3759
    ^ aStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3760
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3761
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3762
     Object sourceStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3763
     Clock sourceStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3764
     Autoload sourceStream
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3765
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3766
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3767
    "Created: 10.11.1995 / 21:05:13 / cg"
2124
6238280f6120 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
  3768
    "Modified: 10.1.1997 / 15:36:26 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3769
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3770
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3771
updateVersionMethodFor:newRevisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3772
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3773
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3774
    "helper for the checkin procedure.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3775
     Update my #version method, to now return newRevisionString."
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3776
986
c3a9f590146d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
  3777
    |cls "vs m mgr"|
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3778
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3779
    cls := self.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3780
    self isMeta ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3781
	cls := self class
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3782
    ].
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3783
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3784
"/    m := cls compiledMethodAt:#version.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3785
"/    m isNil ifTrue:[^ false].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3786
"/    vs := self revisionString.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3787
"/    vs isNil ifTrue:[^ false].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3788
"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3789
"/    (mgr := self sourceCodeManager) isNil ifTrue:[^ false].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3790
"/    newString := mgr updatedRevisionStringOf:cls forRevision:newRevision with:vs. 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3791
"/    newString isNil ifTrue:[^ false].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3792
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3793
    MethodRedefinitionSignal handle:[:ex |
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3794
	ex proceedWith:#keep 
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3795
    ] do:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3796
	Class withoutUpdatingChangesDo:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3797
	    Compiler compile:'version
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3798
    ^ ''' , newRevisionString , '''
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3799
'
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3800
		     forClass:cls 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3801
		     inCategory:#documentation 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3802
		     notifying:nil 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3803
		     install:true 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3804
		     skipIfSame:false 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3805
		     silent:true. 
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3806
	]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3807
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3808
"/ ('updated to :' , newRevisionString) printNL.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3809
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3810
    ^ true
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3811
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3812
    "Created: 7.12.1995 / 20:42:22 / cg"
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  3813
    "Modified: 7.11.1996 / 21:02:09 / cg"
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3814
!
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3815
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3816
validateSourceStream:aStream
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3817
    "check if aStream really contains my source.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3818
     This is done by checking the version methods return value
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3819
     against the version string as contained in the version method"
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3820
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  3821
    |cls meta cannotCheckReason versionMethod info
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3822
     versionFromCode versionFromSource oldPos pos src rev|
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3823
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3824
    self isMeta ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3825
	meta := self. cls := self soleInstance
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3826
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3827
	cls := self. meta := self class
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3828
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3829
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  3830
    cannotCheckReason := nil.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3831
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3832
    versionMethod := meta compiledMethodAt:#version.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3833
    (versionMethod isNil 
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3834
    or:[versionMethod isExecutable not]) ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3835
	versionMethod := cls compiledMethodAt:#version.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3836
	(versionMethod isNil
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3837
	or:[versionMethod isExecutable not]) ifTrue:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3838
	    cannotCheckReason := 'no valid version method'.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3839
	]
2544
c3a2791de289 care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
  3840
    ] ifFalse:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3841
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3842
	"/ if its a method returning the string,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3843
	"/ thats the returned value
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3844
	"/
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3845
	versionFromCode := cls version.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3846
	versionFromCode isString ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3847
	    cannotCheckReason := 'version method does not return a string'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3848
	].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3849
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3850
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3851
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3852
    "/ if its a method consisting of a comment only
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3853
    "/ extract it - this may lead to a recursive call
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3854
    "/ to myself (thats what the #isRecursive is for)
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3855
    "/ in case we need to access the source code manager
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3856
    "/ for the source ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3857
    "/
1942
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  3858
    versionMethod notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3859
	pos := versionMethod sourcePosition.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3860
	pos isInteger ifFalse:[
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3861
	    "/ mhmh - either no version method,
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3862
	    "/ or updated due to a checkin.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3863
	    "/ in any case, this should be a good source.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3864
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3865
	    ^ true.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3866
	    "/ cannotCheckReason := 'no source position for version-method'
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3867
	]
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3868
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3869
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  3870
    cannotCheckReason notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3871
	('Class [warning]: ' , cannotCheckReason) errorPrintCR.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3872
	'Class [info]: cannot validate source; trusting source' infoPrintCR.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3873
	^ true
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3874
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3875
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3876
    oldPos := aStream position.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3877
    aStream position:pos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3878
    src := aStream nextChunk.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3879
    aStream position:oldPos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3880
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3881
    (src isNil or:[src isEmpty]) ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3882
"/ 'empty source for version-method' printCR.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3883
	^ false
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3884
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3885
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3886
    versionFromSource := Class revisionStringFromSource:src.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3887
    versionFromSource = versionFromCode ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3888
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  3889
    versionFromSource isNil ifTrue:[^ false].
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  3890
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3891
    "/ mhmh - check my binary version ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3892
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3893
    info := Class revisionInfoFromString:versionFromSource.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3894
    info notNil ifTrue:[
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3895
	rev := info at:#revision.
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3896
	rev = self binaryRevision ifTrue:[^ true].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3897
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3898
    ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3899
2544
c3a2791de289 care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
  3900
    "Modified: 13.4.1997 / 02:18:09 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3901
! !
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3902
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3903
!Class methodsFor:'special accessing'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3904
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3905
setName:aString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3906
    "set the classes name - be careful, it will be still
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3907
     in the Smalltalk dictionary - under another key.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3908
     This is NOT for general use - see renameTo:"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3909
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3910
    environment := nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3911
    name := aString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3912
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3913
    "Created: 1.4.1997 / 15:46:01 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3914
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3915
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3916
!Class class methodsFor:'documentation'!
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3917
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3918
version
3180
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  3919
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.299 1998-01-16 14:59:43 cg Exp $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  3920
! !