Class.st
author Claus Gittinger <cg@exept.de>
Mon, 05 Feb 1996 01:47:11 +0100
changeset 934 1d07586a2283
parent 910 f5a8a3a320e9
child 937 f2243cbb7ae0
permissions -rw-r--r--
dont fail when storing binary methods which cannot be compiled to bytecode (is this a good idea ?)
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
741
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    14
	instanceVariableNames:'classvars comment subclasses classFilename package revision
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
    15
		history'
741
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    16
	classVariableNames:'UpdatingChanges LockChangesFile FileOutErrorSignal
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
    17
		CatchMethodRedefinitions MethodRedefinitionSignal
896
0226558f4b6c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 895
diff changeset
    18
		UpdateChangeFileQuerySignal
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
    19
		TryLocalSourceFirst'
741
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    20
	poolDictionaries:''
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    21
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    23
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    24
!Class class methodsFor:'documentation'!
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    25
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    26
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    27
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    28
 COPYRIGHT (c) 1989 by Claus Gittinger
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    29
	       All Rights Reserved
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    30
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    31
 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
    32
 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
    33
 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
    34
 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
    35
 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
    36
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    37
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    38
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    39
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    40
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    41
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    42
    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
    43
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    44
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    45
    Also change management and recompilation is defined here (since the superclasses
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    46
    do not have enough symbolic information to support compilation).
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    47
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    48
    For production code, the stc compiler is planned to (optionally) generate classes 
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    49
    as subclasses of Behavior - to excludes all name, source info etc., 
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    50
    however, normally all classes are subclasses of Class.
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    51
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    52
    Instance variables:
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    53
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    54
	classvars       <String>        the names of the class variables
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    55
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    56
	comment         <String>        the classes comment; either a string,
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    57
					a number specifying the offset in classFilename, or nil
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    58
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    59
	subclasses      <Collection>    cached collection of subclasses
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    60
					(currently unused - but will be soon)
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    61
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    62
	classFilename   <String>        the file (or nil) where the classes
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    63
					sources are found 
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    64
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    65
	package         <Symbol>        the package, in which the class was defined
385
claus
parents: 384
diff changeset
    66
					(inserted by compilers)
claus
parents: 384
diff changeset
    67
391
claus
parents: 385
diff changeset
    68
	revision        <String>        revision string - inserted by stc
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    69
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    70
	history         <any>           a place for a history string (not currently used)
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    71
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    72
    Class variables:
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    73
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    74
	UpdatingChanges <Boolean>       true if the changes-file shall be updated
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    75
					(except during startup and when filing in, this flag
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    76
					 is usually true)
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    77
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    78
	LockChangesFile <Boolean>       if true, the change file is locked for updates.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    79
					Required when multiple users operate on a common
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    80
					change file.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    81
					This is an experimental new feature, being evaluated.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    82
421
claus
parents: 415
diff changeset
    83
	UpdateChangeFileQuerySignal     used as an upQuery from the change management.
claus
parents: 415
diff changeset
    84
					Whenever a changeRecord is to be written,
claus
parents: 415
diff changeset
    85
					this signal is raised and a handler (if present)
claus
parents: 415
diff changeset
    86
					is supposed to return true or false.
claus
parents: 415
diff changeset
    87
					If unhandled, the value of the global
claus
parents: 415
diff changeset
    88
					UpdatingChanges is returned for backward
claus
parents: 415
diff changeset
    89
					compatibility (which means that the old
claus
parents: 415
diff changeset
    90
					mechanism is used if no query-handler
claus
parents: 415
diff changeset
    91
					is present).
claus
parents: 415
diff changeset
    92
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    93
	FileOutErrorSignal              raised when an error occurs during fileOut
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    94
362
claus
parents: 360
diff changeset
    95
	CatchMethodRedefinitions        if true, classes protect themself 
claus
parents: 360
diff changeset
    96
	MethodRedefinitionSignal        (by raising MethodRedefinitionSignal)
claus
parents: 360
diff changeset
    97
					from redefining any existing methods,
claus
parents: 360
diff changeset
    98
					which are defined in another package.
claus
parents: 360
diff changeset
    99
					(i.e. a signal will be raised, if you
claus
parents: 360
diff changeset
   100
					 fileIn something which redefines an
claus
parents: 360
diff changeset
   101
					 existing method and the packages do not
claus
parents: 360
diff changeset
   102
					 match).
claus
parents: 360
diff changeset
   103
					The default is (currently) true.
claus
parents: 360
diff changeset
   104
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   105
	TryLocalSourceFirst             If true, local source files are tried
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   106
					first BEFORE the sourceCodeManager is
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   107
					consulted. If false, the sourceCodeManager
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   108
					is asked first.
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   109
					Should be turned on, if you run an image from
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   110
					local sources which have not yet been checked in.
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   111
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   112
                                        
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   113
    WARNING: layout known by compiler and runtime system
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   114
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   115
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   116
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   117
!Class class methodsFor:'initialization'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   118
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   119
initialize
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   120
    "the classvariable 'UpdatingChanges' controls if changes are put
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   121
     into the changes-file; normally this variable is set to true, but
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   122
     (for example) during fileIn or when changes are applied, it is set to false
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   123
     to avoid putting too much junk into the changes-file."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   124
     
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   125
    UpdatingChanges := true.
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
   126
    LockChangesFile := false.
362
claus
parents: 360
diff changeset
   127
    CatchMethodRedefinitions := true.
909
e20934aa134e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   128
    TryLocalSourceFirst := false.
362
claus
parents: 360
diff changeset
   129
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   130
    FileOutErrorSignal isNil ifTrue:[
421
claus
parents: 415
diff changeset
   131
	FileOutErrorSignal := ErrorSignal newSignalMayProceed:false.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   132
	FileOutErrorSignal nameClass:self message:#fileOutErrorSignal.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   133
	FileOutErrorSignal notifierString:'error during fileOut'.
362
claus
parents: 360
diff changeset
   134
421
claus
parents: 415
diff changeset
   135
	MethodRedefinitionSignal := ErrorSignal newSignalMayProceed:true.
362
claus
parents: 360
diff changeset
   136
	MethodRedefinitionSignal nameClass:self message:#methodRedefinitionSignal.
claus
parents: 360
diff changeset
   137
	MethodRedefinitionSignal notifierString:'attempt to redefine method from different package'.
421
claus
parents: 415
diff changeset
   138
claus
parents: 415
diff changeset
   139
	UpdateChangeFileQuerySignal := QuerySignal new mayProceed:true.
claus
parents: 415
diff changeset
   140
	UpdateChangeFileQuerySignal nameClass:self message:#updateChangeFileQuerySignal.
claus
parents: 415
diff changeset
   141
	UpdateChangeFileQuerySignal notifierString:'asking if changeFile update is wanted'.
claus
parents: 415
diff changeset
   142
	UpdateChangeFileQuerySignal handlerBlock:[:ex | ex proceedWith:UpdatingChanges].
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   143
    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   144
! !
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   145
345
claus
parents: 333
diff changeset
   146
!Class class methodsFor:'Signal constants'!
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   147
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   148
fileOutErrorSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   149
    "return the signal raised when an error occurs while fileing out.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   150
     This is signalled to allow browsers some user feed back in case
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   151
     a fileout fails (for example due to disk-full errors)"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   152
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   153
    ^ FileOutErrorSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   154
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   155
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   156
methodRedefinitionSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   157
    "return the signal raised when a method is about to be installed
362
claus
parents: 360
diff changeset
   158
     which redefines an existing method and the methods packages are not
claus
parents: 360
diff changeset
   159
     equal. This helps when filing in alien code, to prevent existing
claus
parents: 360
diff changeset
   160
     methods to be overwritten or redefined by incompatible methods"
claus
parents: 360
diff changeset
   161
claus
parents: 360
diff changeset
   162
    ^ MethodRedefinitionSignal
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   163
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   164
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   165
updateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   166
    "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
   167
     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
   168
     static handler."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   169
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   170
    ^ UpdateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   171
362
claus
parents: 360
diff changeset
   172
! !
claus
parents: 360
diff changeset
   173
claus
parents: 360
diff changeset
   174
!Class class methodsFor:'accessing - flags'!
claus
parents: 360
diff changeset
   175
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   176
catchMethodRedefinitions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   177
    "return the redefinition catching flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   178
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   179
    ^ CatchMethodRedefinitions
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   180
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   181
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   182
catchMethodRedefinitions:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   183
    "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
   184
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   185
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   186
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   187
    prev := CatchMethodRedefinitions.
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   188
    CatchMethodRedefinitions := aBoolean.
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   189
    ^ prev
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   190
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   191
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   192
lockChangesFile
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   193
    "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
   194
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   195
    ^ LockChangesFile
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   196
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   197
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   198
lockChangesFile:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   199
    "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
   200
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   201
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   202
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   203
    prev := LockChangesFile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   204
    LockChangesFile := aBoolean.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   205
    ^ prev
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   206
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   207
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   208
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   209
    "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
   210
     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
   211
     decide to return something else."
362
claus
parents: 360
diff changeset
   212
claus
parents: 360
diff changeset
   213
    |prev|
claus
parents: 360
diff changeset
   214
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   215
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   216
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   217
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   218
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   219
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   220
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   221
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   222
     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
   223
     decide to return something else."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   224
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   225
    ^ UpdatingChanges
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   226
!
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   227
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   228
tryLocalSourceFirst:aBoolean
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   229
    TryLocalSourceFirst := aBoolean
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   230
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   231
    "Created: 24.1.1996 / 19:55:35 / cg"
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   232
!
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   233
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   234
tryLocalSourceFirst
909
e20934aa134e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   235
    ^ TryLocalSourceFirst
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   236
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   237
    "Created: 24.1.1996 / 19:55:35 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   238
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   239
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   240
!Class class methodsFor:'enumeration '!
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   241
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   242
allClassesInCategory:aCategory do:aBlock
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   243
    "evaluate aBlock for all classes in aCategory;
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   244
     no specific order is defined."
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   245
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
   246
    Smalltalk allBehaviorsDo:[:aClass |
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   247
	aClass isMeta ifFalse:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   248
	    (aClass category = aCategory) ifTrue:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   249
		aBlock value:aClass
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   250
	    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   251
	].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   252
    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   253
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   254
    "
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   255
     Class allClassesInCategory:'Kernel-Classes' 
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   256
			     do:[:class |Transcript showCr:class name]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   257
    "
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   258
!
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   259
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   260
allClassesInCategory:aCategory inOrderDo:aBlock
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   261
    "evaluate aBlock for all classes in aCategory;
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   262
     superclasses come first - then subclasses."
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   263
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   264
    |classes|
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   265
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   266
    classes := OrderedCollection new.
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
   267
    Smalltalk allBehaviorsDo:[:aClass |
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   268
	aClass isMeta ifFalse:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   269
	    (aClass category = aCategory) ifTrue:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   270
		classes add:aClass
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   271
	    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   272
	]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   273
    ].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   274
    classes topologicalSort:[:a :b | b isSubclassOf:a].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   275
    classes do:aBlock
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   276
! !
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   277
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   278
!Class class methodsFor:'helpers'!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   279
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   280
revisionInfoFromString:aString
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   281
    "return a dictionary filled with revision info.
740
b647ebdc25ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   282
     This extracts the relevant info from aString.
b647ebdc25ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   283
     For now, this is a bad design - should always ask the
b647ebdc25ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   284
     SCM to extract the parts (knowing about the details of RCS headers
b647ebdc25ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   285
     here is a bad design ...)"
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
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   289
    info := IdentityDictionary new.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   290
    words := aString asCollectionOfWords.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   291
744
db7b733455b9 dont crash with bad revision strings (again)
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   292
    words notEmpty ifTrue:[
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   293
	"/
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   294
	"/ supported formats:
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   295
	"/
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   296
	"/ $-Header: pathName rev date time user state $
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   297
	"/ $-Revision: rev $
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   298
	"/ $-Id: fileName rev date time user state $
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   299
	"/
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   300
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   301
	((words at:1) = '$Header:') ifTrue:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   302
	    nm := words at:2.
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   303
	    info at:#repositoryPathName put:nm.
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   304
	    (nm endsWith:',v') ifTrue:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   305
		nm := nm copyWithoutLast:2
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   306
	    ].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   307
	    info at:#fileName put:nm asFilename baseName.
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   308
	    (words at:3) = '$' ifFalse:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   309
		info at:#revision put:(words at:3).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   310
		info at:#date put:(words at:4).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   311
		info at:#time put:(words at:5).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   312
		info at:#user put:(words at:6).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   313
		info at:#state put:(words at:7).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   314
	    ].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   315
	    ^ info
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   316
	].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   317
	((words at:1) = '$Revision:') ifTrue:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   318
	    info at:#revision put:(words at:2).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   319
	    ^ info
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   320
	].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   321
	((words at:1) = '$Id:') ifTrue:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   322
	    info at:#fileName put:(words at:2).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   323
	    info at:#revision put:(words at:3).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   324
	    info at:#date put:(words at:4).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   325
	    info at:#time put:(words at:5).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   326
	    info at:#user put:(words at:6).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   327
	    info at:#state put:(words at:7).
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   328
	    ^ info
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   329
	].
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   330
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   331
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   332
    "/
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   333
    "/ mhmh - maybe its some other source code system
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   334
    "/
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   335
    (mgr := Smalltalk at:SourceCodeManager) notNil ifTrue:[
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   336
	^ mgr revisionInfoFromString:aString
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   337
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   338
    ^ nil
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   339
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   340
    "Created: 15.11.1995 / 14:58:35 / cg"
744
db7b733455b9 dont crash with bad revision strings (again)
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   341
    "Modified: 13.12.1995 / 17:11:28 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   342
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   343
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   344
!Class methodsFor:'ST/V subclass creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   345
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   346
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   347
    "this method allows fileIn of ST/V classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   348
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   349
a27a279701f8 Initial revision
claus
parents:
diff changeset
   350
    ^ self subclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   351
	   instanceVariableNames:f
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   352
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   353
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   354
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   355
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   356
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   357
variableByteSubclass:t classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   358
    "this method allows fileIn of ST/V variable byte classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   359
     (which seem to have no category and no instvars)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   360
a27a279701f8 Initial revision
claus
parents:
diff changeset
   361
    ^ self variableByteSubclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   362
	   instanceVariableNames:''
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   363
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   364
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   365
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   366
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   367
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   368
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   369
    "this method allows fileIn of ST/V variable pointer classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   370
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   371
a27a279701f8 Initial revision
claus
parents:
diff changeset
   372
    ^ self variableSubclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   373
	   instanceVariableNames:f
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   374
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   375
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   376
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   377
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   378
a27a279701f8 Initial revision
claus
parents:
diff changeset
   379
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   380
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   381
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   382
    "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
   383
     Also writes a change record and notifies dependents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   384
     BUG: Currently, no recompilation is done - this will change."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   385
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   386
    (self classVarNames includes:aString) ifFalse:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   387
	self classVariableString:(self classVariableString , ' ' , aString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   388
	self addChangeRecordForClass:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   389
	self changed:#definition.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   390
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   391
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   392
    "Created: 29.10.1995 / 19:40:51 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   393
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   394
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   395
allClassVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   396
    "return a collection of all the class variable name-strings
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   397
     this includes all superclass-class variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   398
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   399
    ^ self addAllClassVarNamesTo:(OrderedCollection new)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   400
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   401
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   402
     Float allClassVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   403
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   404
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   405
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   406
classFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   407
    "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
   408
     This is currently NOT used."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   409
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   410
    ^ classFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   411
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   412
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   413
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   414
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   415
     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
   416
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   417
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   418
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   419
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   420
     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
   421
     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
   422
     no classPools yet.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   423
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   424
    ^ Smalltalk at:(self name , ':' , aSymbol) asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   425
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   426
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   427
classVarAt:aSymbol put:something
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   428
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   429
     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
   430
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   431
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   432
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   433
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   434
     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
   435
     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
   436
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   437
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   438
    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
   439
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   440
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   441
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   442
    "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
   443
     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
   444
     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
   445
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   446
    classvars isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   447
	^ OrderedCollection new
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   448
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   449
    ^ classvars asCollectionOfWords
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   450
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   451
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   452
     Object classVarNames 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   453
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   454
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   455
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   456
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   457
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   458
    "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
   459
     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
   460
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   461
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   462
    classvars isNil ifTrue:[^ ''].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   463
    ^ classvars
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   464
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   465
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   466
     Object classVariableString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   467
     Float classVariableString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   468
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   469
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   470
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   471
classVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   472
    "set the classes classvarnames string; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   473
     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
   474
     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
   475
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   476
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   477
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   478
    "ignore for metaclasses except the one"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   479
    (self isMeta) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   480
	(self == Metaclass) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   481
	    ^ self
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   482
	]
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   483
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   484
    (classvars = aString) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   485
	prevVarNames := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   486
	classvars := aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   487
	varNames := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   488
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   489
	"new ones get initialized to nil;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   490
	 - old ones are nilled and removed from Smalltalk"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   491
	any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   492
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   493
	varNames do:[:aName |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   494
	    (prevVarNames includes:aName) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   495
		"a new one"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   496
		self classVarAt:aName put:nil.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   497
		any := true.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   498
	    ] ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   499
		prevVarNames remove:aName
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   500
	    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   501
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   502
	"left overs are gone"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   503
	prevVarNames do:[:aName |
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   504
	    self classVarAt:aName put:nil.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   505
	    Smalltalk removeKey:(self name , ':' , aName) asSymbol.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   506
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   507
	any ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   508
	    Smalltalk changed:#classVariables with:self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   509
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   510
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   511
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   512
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   513
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   514
    "return the comment (aString) of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   515
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   516
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   517
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   518
    "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
   519
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   520
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   521
    comment isNumber ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   522
	classFilename notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   523
	    stream := self sourceStream. "/ Smalltalk sourceFileStreamFor:classFilename.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   524
	    stream notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   525
		stream position:comment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   526
		string := String readFrom:stream onError:''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   527
		stream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   528
		^ string
887
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   529
	    ].
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   530
	    ^ nil
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   531
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   532
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   533
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   534
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   535
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   536
     Object comment 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   537
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   538
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   539
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   540
comment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   541
    "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
   542
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   543
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   544
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   545
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   546
    newComment := aString.
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   547
    (aString notNil and:[aString isEmpty]) ifTrue:[
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   548
	newComment := nil
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   549
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   550
    comment ~= newComment ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   551
	oldComment := self comment.
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   552
	comment := newComment.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   553
	self changed:#comment with:oldComment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   554
	self addChangeRecordForClassComment:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   555
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   556
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   557
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   558
definition
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   559
    "return an expression-string to define myself"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   560
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   561
    |s|
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
    s := WriteStream on:(String new).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   564
    self fileOutDefinitionOn:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   565
    ^ s contents
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   566
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   567
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   568
     Object definition 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   569
     Point definition  
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
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   572
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   573
history 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   574
    "return the history  of the class"
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
    ^ history 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   577
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
     Object history   
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   583
history:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   584
    "set the history of the class."
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
    history  := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   587
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   588
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   589
package
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   590
    "return the package of the class"
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
    ^ package
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   593
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
     Object package  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   596
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   597
!
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
package:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   600
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   601
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   602
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   603
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   604
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   605
primitiveDefinitions:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   606
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   607
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   608
    self setPrimitiveSpecsAt:1 to:aString.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   609
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   610
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   611
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   612
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   613
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   614
primitiveDefinitionsString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   615
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   616
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   617
    ^ self getPrimitiveSpecsAt:1
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   618
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   619
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   620
     Object primitiveDefinitionsString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   621
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   622
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   623
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   624
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   625
primitiveFunctions:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   626
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   627
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   628
    self setPrimitiveSpecsAt:3 to:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   629
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   630
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   631
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   632
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   633
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   634
primitiveFunctionsString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   635
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   636
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   637
    ^ self getPrimitiveSpecsAt:3 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   638
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   639
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   640
primitiveSpec
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   641
    "return the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   642
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   643
    ^  primitiveSpec
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   644
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   645
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   646
primitiveSpec:anArrayOf3ElementsOrNil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   647
    "set the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   648
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   649
    primitiveSpec := anArrayOf3ElementsOrNil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   650
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   651
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   652
primitiveVariables:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   653
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   654
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   655
    self setPrimitiveSpecsAt:2 to:aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   656
    self addChangeRecordForPrimitiveVariables:self.
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
    "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
   659
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   660
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   661
primitiveVariablesString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   662
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   663
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   664
    ^ self getPrimitiveSpecsAt:2 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   665
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   666
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   667
removeClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   668
    "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
   669
     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
   670
     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
   671
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   672
    |names newNames|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   673
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   674
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   675
    (names includes:aString) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   676
	newNames := ''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   677
	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
   678
	self classVariableString:newNames withoutSpaces.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   679
	self addChangeRecordForClass:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   680
	self changed:#definition.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   681
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   682
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   683
    "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
   684
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   685
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   686
renameCategory:oldCategory to:newCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   687
    "rename a category (changes category of those methods).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   688
     Appends a change record and notifies dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   689
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   690
    |any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   691
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   692
    any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   693
    methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   694
	aMethod category = oldCategory ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   695
	    aMethod category:newCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   696
	    any := true.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   697
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   698
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   699
    any ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   700
	self addChangeRecordForRenameCategory:oldCategory to:newCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   701
	self changed:#methodCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   702
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   703
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   704
    "Created: 29.10.1995 / 19:42:15 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   705
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   706
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   707
setClassFilename:aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   708
    "set the classes filename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   709
     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
   710
     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
   711
     is set here."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   712
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   713
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   714
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   715
    "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
   716
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   717
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   718
setClassVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   719
    "set the classes classvarnames string. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   720
     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
   721
     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
   722
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   723
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   724
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   725
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   726
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   727
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   728
    "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
   729
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   730
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   731
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   732
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   733
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   734
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   735
    "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
   736
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   737
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   738
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   739
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   740
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   741
    categoryStringOrSymbol isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   742
	cat := ''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   743
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   744
	cat := categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   745
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   746
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   747
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   748
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   749
setHistory:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   750
    "set the history of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   751
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   752
    history  := aString
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   755
setPackage:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   756
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   757
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   758
    package := aStringOrSymbol
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   761
sharedPools
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   762
    "ST/X does not (currently) support pools"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   763
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   767
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   768
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   769
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   770
    |code aStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   771
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   772
" this is too slow for big classes ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   773
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   774
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   775
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   776
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   777
    aStream := FileStream newFileNamed:'__temp'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   778
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   779
	self notify:'cannot create temporary file.'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   780
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   781
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   782
    FileOutErrorSignal handle:[:ex |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   783
	aStream nextPutAll:'"no source available"'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   784
    ] do:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   785
	self fileOutOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   786
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   787
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   788
    aStream := FileStream oldFileNamed:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   789
    aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   790
	self notify:'oops - cannot reopen temp file'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   791
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   792
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   793
    code := aStream contents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   794
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   795
    OperatingSystem removeFile:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   796
    ^ code
385
claus
parents: 384
diff changeset
   797
!
claus
parents: 384
diff changeset
   798
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   799
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   800
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   801
     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
   802
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   803
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
   804
    |rev|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   805
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   806
    AbstractSourceCodeManager notNil ifTrue:[
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   807
	^ AbstractSourceCodeManager defaultManager
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
   808
    ].
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   809
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   810
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   811
    "Created: 7.12.1995 / 13:16:46 / 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
   812
    "Modified: 16.12.1995 / 13:21:55 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   813
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   814
a27a279701f8 Initial revision
claus
parents:
diff changeset
   815
!Class methodsFor:'adding/removing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   816
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   817
addSelector:newSelector withMethod:newMethod
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   818
    "add the method given by 2nd argument under the selector given by
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   819
     1st argument to the methodDictionary. 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   820
     Append a change record to the changes file and tell dependents."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   821
362
claus
parents: 360
diff changeset
   822
    |oldMethod|
claus
parents: 360
diff changeset
   823
claus
parents: 360
diff changeset
   824
    CatchMethodRedefinitions ifTrue:[
claus
parents: 360
diff changeset
   825
	"check for attempts to redefine a method
claus
parents: 360
diff changeset
   826
	 in a different package. Signal a resumable error if so.
claus
parents: 360
diff changeset
   827
	 This allows tracing redefinitions of existing system methods
claus
parents: 360
diff changeset
   828
	 when filing in alien code ....
claus
parents: 360
diff changeset
   829
	 (which we may want to forbit sometimes)
claus
parents: 360
diff changeset
   830
	"
claus
parents: 360
diff changeset
   831
	oldMethod := self compiledMethodAt:newSelector.
claus
parents: 360
diff changeset
   832
	oldMethod notNil ifTrue:[
claus
parents: 360
diff changeset
   833
	    oldMethod package ~= newMethod package ifTrue:[
claus
parents: 360
diff changeset
   834
		"
claus
parents: 360
diff changeset
   835
		 attempt to redefine an existing method, which was
claus
parents: 360
diff changeset
   836
		 defined in another package.
claus
parents: 360
diff changeset
   837
		 If you continue in the debugger, the new method gets installed.
claus
parents: 360
diff changeset
   838
		 Otherwise, the existing (old) method remains valid.
claus
parents: 360
diff changeset
   839
claus
parents: 360
diff changeset
   840
		 You can turn of the catching of redefinitions by setting
claus
parents: 360
diff changeset
   841
		   CatchMethodRedefinitions to false
claus
parents: 360
diff changeset
   842
		 (also found in the NewLaunchers 'settings-misc' menu)
claus
parents: 360
diff changeset
   843
		"
406
claus
parents: 403
diff changeset
   844
		MethodRedefinitionSignal 
claus
parents: 403
diff changeset
   845
		    raiseErrorString:(' ' , name , '>>' , newSelector) 
362
claus
parents: 360
diff changeset
   846
	    ]
claus
parents: 360
diff changeset
   847
	]
claus
parents: 360
diff changeset
   848
    ].
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   849
    (super addSelector:newSelector withMethod:newMethod) ifTrue:[
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   850
	self addChangeRecordForMethod:newMethod.
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   851
    ]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   852
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   853
    "Created: 29.10.1995 / 19:42:42 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   854
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   855
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   856
removeSelector:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   857
    "remove the selector, aSelector and its associated method 
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   858
     from the methodDictionary.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   859
     Append a change record to the changes file and tell dependents."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   860
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   861
    (super removeSelector:aSelector) ifTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   862
	self addChangeRecordForRemoveSelector:aSelector.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   863
	self changed:#methodDictionary with:aSelector.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   864
    ]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   865
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   866
    "Created: 29.10.1995 / 19:42:47 / cg"
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   867
!
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   868
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   869
unload
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   870
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   871
     autoloaded. Can be used to get rid of no longer needed autoloaded
328
claus
parents: 326
diff changeset
   872
     classes. 
claus
parents: 326
diff changeset
   873
     (maybe, autoloaded classes should unload themselfes when no
claus
parents: 326
diff changeset
   874
      longer needed - for example, after some delay when the last instance 
claus
parents: 326
diff changeset
   875
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   876
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   877
    |nm|
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   878
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   879
    self wasAutoloaded ifFalse:[
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   880
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   881
	"
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   882
	 can it be done ?
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   883
	"
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   884
	self methodArray do:[:aMethod |
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   885
	    aMethod source isNil ifTrue:[^false].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   886
	    aMethod hasPrimitiveCode ifTrue:[^ false].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   887
	].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   888
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   889
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
   890
    self allSubclassesDo:[:aClass |
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
   891
	aClass unload
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
   892
    ].
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
   893
    Transcript showCr:'unloading ' , name.
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
   894
359
claus
parents: 357
diff changeset
   895
    Autoload removeClass:self.    
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   896
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   897
    Smalltalk at:nm put:nil.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   898
    name := nm , ' (leftover)'.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
   899
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
   900
    ObjectMemory flushMethodCache.
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   901
    Autoload addClass:nm inCategory:category.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   902
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   903
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   904
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   905
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   906
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   907
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   908
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   909
    "
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   910
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   911
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   912
!Class methodsFor:'binary storage'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   913
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   914
addGlobalsTo: globalDictionary manager: manager
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   915
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   916
    classPool == nil ifFalse: [
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   917
	classPool associationsDo: [:assoc|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   918
	    globalDictionary at: assoc put: self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   919
	]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   920
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   921
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   922
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   923
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   924
storeBinaryDefinitionOf: anAssociation on: stream manager: manager
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   925
    "not usable at the moment - there are no classpools currently"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   926
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   927
    | string |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   928
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   929
    string := self name, ' classPool at: ', anAssociation key storeString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   930
    stream nextNumber: 2 put: string size.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   931
    string do: [:char| stream nextPut: char asciiValue]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   932
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   933
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   934
storeBinaryDefinitionOn: stream manager: manager
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   935
    "classes only store the name, signature and instvar names.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   936
     They restore by looking for that name in the Smalltalk dictionary.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   937
     However, using the signature, a check for being valid is made at
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   938
     restore time.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   939
     This avoids a full recursive store of a class in the normal binary
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   940
     storage - however, it also means that a classes semantics cannot
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   941
     be stored with the basic storeBinary operation
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   942
     (we depend on the class being present at binaryLoad time.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   943
    To store classes, use #storeBinaryClassOn:manager: or BOSS>>nextPutClasses:."
557
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
    |varnames n sz|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   946
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   947
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   948
     output the signature
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   949
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   950
    stream nextNumber:4 put:self signature.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   951
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
     output the instance variable name string
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   954
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   955
    varnames := self allInstVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   956
    n := varnames size.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   957
    n == 0 ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   958
	sz := 0
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   959
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   960
	sz := varnames inject:0 into:[:sum :nm | sum + nm size].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   961
	sz := sz + n - 1.
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
    stream nextNumber:2 put:sz.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   964
    varnames keysAndValuesDo:[:i :nm |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   965
	nm do:[:c |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   966
	    stream nextPut:c asciiValue
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
	i ~~ n ifTrue:[stream nextPut:(Character space asciiValue)]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   969
    ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   970
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   971
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   972
     output my name
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   973
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   974
    stream nextNumber:2 put:name size.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   975
    name do:[:c| 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   976
	stream nextPut:c asciiValue
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   977
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   978
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   979
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   980
     |s|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   981
     s := WriteStream on:ByteArray new.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   982
     Rectangle storeBinaryOn:s.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   983
     Object readBinaryFrom:(ReadStream on:s contents)  
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   984
    "
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   985
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   986
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   987
storeBinaryClassOn:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   988
    "store a classes complete description (i.e. including methods).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   989
     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
   990
     be either present or autoloadable."
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   991
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
   992
    |nSel s selectors|
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   993
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   994
    stream nextPut: manager codeForClass.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   995
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   996
    "/ the following order must correlate to
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   997
    "/ the storing in #binaryDefinitionFrom:manager:
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   998
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   999
    "/ store
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1000
    "/   superclasses name,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1001
    "/   name,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1002
    "/   typeSymbol,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1003
    "/   instVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1004
    "/   classVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1005
    "/   category
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1006
    "/   classInstVarNames
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1007
    "/   comment
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1008
    "/   package
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1009
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1010
    superclass isNil ifTrue:[
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1011
	s := nil
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1012
    ] ifFalse:[
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1013
	s := superclass name
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1014
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1015
    s storeBinaryOn:stream manager:manager.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1016
    name storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1017
    flags storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1018
    (instvars notNil and:[instvars isEmpty]) ifTrue:[
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1019
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1020
    ] ifFalse:[
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1021
	s := instvars
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1022
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1023
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1024
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1025
    (classvars notNil and:[classvars isEmpty]) ifTrue:[
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1026
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1027
    ] ifFalse:[
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1028
	s := classvars
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1029
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1030
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1031
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1032
    category storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1033
    s := self class instanceVariableString.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1034
    (s notNil and:[s isEmpty]) ifTrue:[
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1035
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1036
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1037
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1038
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1039
    s := comment.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1040
    manager sourceMode == #discard ifTrue:[
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1041
	s := nil
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1042
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1043
    s storeBinaryOn:stream manager:manager.
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1044
    package storeBinaryOn:stream manager:manager.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1045
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1046
    "/ store
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1047
    "/   number of class methods
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1048
    selectors := self class selectorArray copy.
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1049
    selectors storeBinaryOn:stream manager:manager.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1050
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1051
    "/ store
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1052
    "/   class methods
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1053
    selectors do:[:sel |
934
1d07586a2283 dont fail when storing binary methods which cannot be compiled to bytecode
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
  1054
	|m m2|
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1055
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1056
	m := self class compiledMethodAt:sel.
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1057
	m isLazyMethod ifTrue:[
934
1d07586a2283 dont fail when storing binary methods which cannot be compiled to bytecode
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
  1058
	    m2 := m makeRealMethod.
1d07586a2283 dont fail when storing binary methods which cannot be compiled to bytecode
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
  1059
	    m2 notNil ifTrue:[
1d07586a2283 dont fail when storing binary methods which cannot be compiled to bytecode
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
  1060
		m := m2
1d07586a2283 dont fail when storing binary methods which cannot be compiled to bytecode
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
  1061
	    ] ifFalse:[
1d07586a2283 dont fail when storing binary methods which cannot be compiled to bytecode
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
  1062
		('failed to compile: ' , m displayString) errorPrintNL
1d07586a2283 dont fail when storing binary methods which cannot be compiled to bytecode
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
  1063
	    ]
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1064
	].
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1065
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1066
	m storeFullBinaryDefinitionOn:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1067
    ].
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1068
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1069
    "/ store
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1070
    "/   number of inst methods
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1071
    
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1072
    selectors := selectorArray copy.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1073
    selectors storeBinaryOn:stream manager:manager.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1074
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1075
    "/ store
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1076
    "/   inst methods
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1077
    selectors do:[:sel |
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1078
	|m|
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1079
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1080
	m := self compiledMethodAt:sel.
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1081
	m isLazyMethod ifTrue:[
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1082
	    m := m makeRealMethod
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1083
	].
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1084
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1085
	m storeFullBinaryDefinitionOn:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1086
    ].
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1087
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1088
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1089
     |bos|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1090
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1091
     bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1092
     bos nextPutClasses:(Array with:FileBrowser).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1093
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1094
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1095
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1096
     |bos cls|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1097
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1098
     bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1099
     cls := bos next.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1100
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1101
     cls open.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1102
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1103
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1104
    "Modified: 16.1.1996 / 17:01:05 / cg"
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1105
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1106
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1107
binaryClassDefinitionFrom:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1108
    "retrieve a class as stored previously with
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1109
     #storeBinaryClassOn:manager:"
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1110
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1111
    |superclassName name flags instvars classvars category classInstVars
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1112
     comment package nSel sel lastCategory
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1113
     newClass superClass selectors methods cselectors cmethods|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1114
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1115
    "/ the following order must correlate to
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1116
    "/ the storing in #storeBinaryClassOn:manager:
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1117
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1118
    "/ retrieve
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1119
    "/   superclasses name,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1120
    "/   name,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1121
    "/   typeSymbol,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1122
    "/   instVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1123
    "/   classVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1124
    "/   category
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1125
    "/   classInstVarNames
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1126
    "/   comment
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1127
    "/   package
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1128
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1129
    superclassName := manager nextObject.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1130
    superclassName notNil ifTrue:[
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1131
	superClass := Smalltalk at:superclassName ifAbsent:nil.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1132
    ].
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1133
    superClass notNil ifTrue:[
881
eb44cdaa19af *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 880
diff changeset
  1134
"/ ('loading superclass: ' ,  superclassName ) printNL.
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1135
	superClass autoload.
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1136
	superClass := Smalltalk at:superclassName.
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1137
    ].
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1138
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1139
    name := manager nextObject.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1140
    flags := manager nextObject.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1141
    instvars := manager nextObject.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1142
    instvars isNil ifTrue:[instvars := ''].
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1143
    classvars := manager nextObject.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1144
    classvars isNil ifTrue:[classvars := ''].
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1145
    category := manager nextObject.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1146
    classInstVars := manager nextObject.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1147
    classInstVars isNil ifTrue:[classInstVars := ''].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1148
    comment := manager nextObject.
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1149
    package := manager nextObject.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1150
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1151
"/    'got superName:' print. superclassName printNL.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1152
"/    'got name:' print. name printNL.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1153
"/    'got flags: ' print. flags printNL.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1154
"/    'got instvars: ' print. instvars printNL.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1155
"/    'got classvars: ' print. classvars printNL.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1156
"/    'got category: ' print. category printNL.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1157
"/    'got classInstvars: ' print. classInstVars printNL.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1158
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1159
"/ ('create class: ' ,  name ) printNL.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1160
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1161
    (superClass notNil or:[superclassName isNil]) ifTrue:[
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1162
	newClass := superClass class
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1163
		name:name asSymbol
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1164
		inEnvironment:Smalltalk
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1165
		subclassOf:superClass
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1166
		instanceVariableNames:instvars
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1167
		variable:false
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1168
		words:false 
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1169
		pointers:true
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1170
		classVariableNames:classvars
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1171
		poolDictionaries:'' 
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1172
		category:category
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1173
		comment:comment 
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1174
		changed:false 
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1175
		classInstanceVariableNames:classInstVars.
910
f5a8a3a320e9 allow retrieval of variable/byte/word/float & double classes
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
  1176
	newClass flags:flags.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1177
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1178
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1179
    "/ retrieve
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1180
    "/   number of class methods
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1181
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1182
    cselectors := manager nextObject.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1183
    nSel := cselectors size.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1184
    cmethods := Array new:nSel.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1185
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1186
    "/ retrieve
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1187
    "/   class methods
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1188
    1 to:nSel do:[:i |
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1189
	|m|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1190
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1191
	m := Method binaryFullDefinitionFrom:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1192
	cmethods at:i put:m.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1193
    ].
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1194
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1195
    "/ retrieve
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1196
    "/   number of inst methods
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1197
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1198
    selectors := manager nextObject.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1199
    nSel := selectors size.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1200
    methods := Array new:nSel.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1201
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1202
    "/ retrieve
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1203
    "/   inst methods
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1204
    1 to:nSel do:[:i |
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1205
	|m|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1206
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1207
	m := Method binaryFullDefinitionFrom:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1208
	methods at:i put:m.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1209
    ].
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1210
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1211
    (superClass isNil and:[superclassName notNil]) ifTrue:[^ nil].
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1212
    newClass isNil ifTrue:[
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1213
	^ nil
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1214
    ].
887
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
  1215
"/    newClass class instanceVariableNames:classInstVars.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1216
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1217
    newClass package:package.
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1218
    newClass selectors:selectors methods:methods.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1219
    newClass class selectors:cselectors methods:cmethods.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1220
    ^ newClass
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1221
887
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
  1222
    "Modified: 22.1.1996 / 13:22:08 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1223
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1224
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1225
!Class methodsFor:'c function interfacing'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1226
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1227
cInterfaceFunction:selector calling:cFunctionNameString args:argTypeArray returning:returnType
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1228
    "create an interface to an existing (i.e. already linked in) c function.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1229
     The function can be called by sending selector to the receiver class.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1230
     The c-function has the name cFunctionNameString, and expects parameters as specified in
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1231
     argTypeArray. The functions return value has a type as specified by returnType.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1232
     WARNING: 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1233
	this interface is EXPERIMENTAL - it may change or even be removed."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1234
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1235
    StubGenerator isNil ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1236
	^ self error:'this system does not support dynamic C Interface functions'.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1237
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1238
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1239
    StubGenerator 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1240
	createStubFor:selector 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1241
	calling:cFunctionNameString 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1242
	args:argTypeArray 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1243
	returning:returnType
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1244
	in:self                          
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1245
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1246
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1247
     Object subclass:#CInterface
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1248
	    instanceVariableNames:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1249
	    classVariableNames:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1250
	    poolDictionaries:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1251
	    category:'Examples'.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1252
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1253
     CInterface cInterfaceFunction:#printfOn:format:withFloat: 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1254
			   calling:'fprintf' 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1255
			      args:#(ExternalStream String Float) 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1256
			 returning:#SmallInteger.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1257
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1258
     CInterface printfOn:Stdout format:'this is a float: %g' withFloat:(Float pi). Stdout cr  
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1259
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1260
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1261
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1262
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1263
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1264
addChangeRecordForChangeCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1265
    "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
  1266
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1267
    self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1268
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1269
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1270
addChangeRecordForChangeCategory:category to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1271
    "append a category change record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1272
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1273
    self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1274
    aStream nextPutAll:(' category:' , category storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1275
    aStream nextPutChunkSeparator.
663
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1276
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1277
    "this test allows a smalltalk without Projects/ChangeSets"
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1278
    Project notNil ifTrue:[
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1279
	Project addClassDefinitionChangeFor:self
663
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1280
    ]
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1281
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1282
    "Created: 3.12.1995 / 13:43:33 / cg"
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1283
    "Modified: 3.12.1995 / 14:10:34 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1284
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1285
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1286
addChangeRecordForClass:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1287
    "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
  1288
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1289
    self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1290
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1291
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1292
addChangeRecordForClass:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1293
    "append a class-definition-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1294
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1295
    aClass isLoaded ifTrue:[
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1296
	aClass fileOutDefinitionOn:aStream.
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1297
	aStream nextPutChunkSeparator.
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1298
	Project notNil ifTrue:[
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1299
	    Project addClassDefinitionChangeFor:aClass 
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1300
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1301
    ]
663
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1302
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1303
    "Created: 3.12.1995 / 13:57:44 / cg"
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1304
    "Modified: 3.12.1995 / 14:11:26 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1305
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1306
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1307
addChangeRecordForClassCheckIn:aClass
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1308
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1309
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  1310
    self addInfoRecord:('checkin ' , aClass name , ' (' , aClass revision , ')')
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1311
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1312
    "Created: 18.11.1995 / 17:04:58 / cg"
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  1313
    "Modified: 7.12.1995 / 23:45:01 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1314
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1315
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1316
addChangeRecordForClassComment:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1317
    "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
  1318
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1319
    self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1320
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1321
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1322
addChangeRecordForClassComment:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1323
    "append a class-comment-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1324
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1325
    aClass fileOutCommentOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1326
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1327
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1328
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1329
addChangeRecordForClassFileOut:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1330
    "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
  1331
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1332
    self addInfoRecord:('fileOut ' , aClass name) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1333
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1334
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1335
addChangeRecordForClassInstvars:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1336
    "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
  1337
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1338
    self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1339
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1340
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1341
addChangeRecordForClassInstvars:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1342
    "append a class-instvars-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1343
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1344
    aClass fileOutClassInstVarDefinitionOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1345
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1346
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1347
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1348
addChangeRecordForClassRemove:oldName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1349
    "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
  1350
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1351
    self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1352
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1353
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1354
addChangeRecordForClassRemove:oldName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1355
    "append a class-remove-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1356
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1357
    aStream nextPutAll:('Smalltalk removeClass:' , oldName).
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1358
    aStream nextPutChunkSeparator.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1359
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1360
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1361
addChangeRecordForClassRename:oldName to:newName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1362
    "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
  1363
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1364
    self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1365
	self addChangeRecordForClassRename:oldName to:newName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1366
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1367
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1368
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1369
addChangeRecordForClassRename:oldName to:newName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1370
    "append a class-rename-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1371
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1372
    aStream nextPutAll:('Smalltalk renameClass:' , oldName , ' to:''' , newName , '''').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1373
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1374
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1375
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1376
addChangeRecordForMethod:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1377
    "add a method-change-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1378
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1379
    self askIfUpdatingChanges ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1380
	self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1381
	"this test allows a smalltalk without Projects/ChangeSets"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1382
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1383
	    Project addMethodChange:aMethod in:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1384
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1385
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1386
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1387
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1388
addChangeRecordForMethod:aMethod to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1389
    "append a method-change-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1390
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1391
    self fileOutMethod:aMethod on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1392
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1393
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1394
addChangeRecordForMethodCategory:aMethod category:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1395
    "add a methodCategory-change-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1396
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1397
    self askIfUpdatingChanges ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1398
	self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1399
	    self addChangeRecordForMethodCategory:aMethod category:aString to:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1400
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1401
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1402
	"this test allows a smalltalk without Projects/ChangeSets"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1403
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1404
	    Project addMethodCategoryChange:aMethod category:aString in:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1405
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1406
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1407
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1408
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1409
addChangeRecordForMethodCategory:aMethod category:newCategory to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1410
    "append a methodCategory-change-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1411
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1412
    |selector|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1413
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1414
    selector := aMethod selector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1415
    selector notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1416
	aStream nextPutAll:'('.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1417
	self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1418
	aStream nextPutAll:(' compiledMethodAt:' , selector storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1419
	aStream nextPutAll:(') category:' , newCategory storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1420
	aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1421
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1422
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1423
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1424
addChangeRecordForMethodPrivacy:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1425
    "add a method-privacy-change-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1426
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1427
    self askIfUpdatingChanges ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1428
	self writingChangePerform:#addChangeRecordForMethodPrivacy:to: with:aMethod.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1429
	"this test allows a smalltalk without Projects/ChangeSets"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1430
	Project notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1431
	    Project addMethodPrivacyChange:aMethod in:self
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1432
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1433
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1434
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1435
    "Modified: 27.8.1995 / 22:47:32 / claus"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1436
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1437
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1438
addChangeRecordForMethodPrivacy:aMethod to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1439
    "append a method-privacy-change-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1440
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1441
    |selector|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1442
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1443
    selector := aMethod selector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1444
    selector notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1445
	aStream nextPutAll:'('.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1446
	self printClassNameOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1447
	aStream nextPutAll:(' compiledMethodAt:' , selector storeString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1448
	aStream nextPutAll:(') privacy:' , aMethod privacy storeString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1449
	aStream nextPutChunkSeparator.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1450
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1451
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1452
    "Modified: 27.8.1995 / 22:59:56 / claus"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1453
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1454
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1455
addChangeRecordForPrimitiveDefinitions:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1456
    "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
  1457
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1458
    self askIfUpdatingChanges ifTrue:[
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1459
	self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1460
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1461
	    Project addPrimitiveDefinitionsChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1462
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1463
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1464
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1465
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1466
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1467
    "append a primitiveDefinitions-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1468
667
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1469
    aStream nextPutAll:aClass name; nextPutAll:' primitiveDefinitions:'''; cr; 
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1470
	    nextPutAll:(aClass primitiveDefinitionsString storeString copyFrom:2).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1471
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1472
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1473
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1474
addChangeRecordForPrimitiveFunctions:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1475
    "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
  1476
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1477
    self askIfUpdatingChanges ifTrue:[
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1478
	self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1479
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1480
	    Project addPrimitiveFunctionsChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1481
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1482
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1483
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1484
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1485
addChangeRecordForPrimitiveFunctions:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1486
    "append a primitiveFunctions-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1487
667
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1488
    aStream nextPutAll:aClass name; nextPutAll:' primitiveFunctions:'''; cr; 
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1489
	    nextPutAll:(aClass primitiveFunctionsString storeString copyFrom:2).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1490
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1491
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1492
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1493
addChangeRecordForPrimitiveVariables:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1494
    "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
  1495
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1496
    self askIfUpdatingChanges ifTrue:[
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1497
	self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1498
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1499
	    Project addPrimitiveVariablesChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1500
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1501
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1502
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1503
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1504
addChangeRecordForPrimitiveVariables:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1505
    "append a primitiveVariables-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1506
667
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1507
    aStream nextPutAll:aClass name; nextPutAll:' primitiveVariables:'''; cr; 
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1508
	    nextPutAll:(aClass primitiveVariablesString storeString copyFrom:2).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1509
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1510
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1511
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1512
addChangeRecordForRemoveSelector:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1513
    "add a method-remove-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1514
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1515
    self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1516
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1517
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1518
addChangeRecordForRemoveSelector:aSelector to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1519
    "append a method-remove-record to aStream"
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
    self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1522
    aStream nextPutAll:(' removeSelector:#' , aSelector).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1523
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1524
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1525
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1526
addChangeRecordForRenameCategory:oldCategory to:newCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1527
    "add a category-rename record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1528
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1529
    self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1530
	self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1531
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1532
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1533
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1534
addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1535
    "append a category-rename record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1536
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1537
    self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1538
    aStream nextPutAll:(' renameCategory:' , oldCategory storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1539
    aStream nextPutAll:(' to:' , newCategory storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1540
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1541
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1542
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1543
addChangeRecordForSnapshot:aFileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1544
    "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
  1545
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1546
    self addInfoRecord:('snapshot ' , aFileName) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1547
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1548
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1549
addChangeRecordForSnapshot:aFileName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1550
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1551
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1552
    self addInfoRecord:('snapshot ' , aFileName) to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1553
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1554
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1555
addChangeTimeStampTo:aStream
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1556
    "a timestamp - prepended to any change, except infoRecords"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1557
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1558
    |info|
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1559
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1560
    info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1561
    self addInfoRecord:info to:aStream. aStream cr.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1562
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1563
    "Created: 18.11.1995 / 15:41:01 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1564
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1565
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1566
addInfoRecord:aMessage
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1567
    "add an info-record (snapshot, class fileOut etc.) to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1568
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1569
    self writingChangeWithTimeStamp:false perform:#addInfoRecord:to: with:aMessage.
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1570
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1571
    "Modified: 18.11.1995 / 15:45:10 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1572
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1573
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1574
addInfoRecord:aMessage to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1575
    "append an info-record (snapshot, class fileOut etc.) to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1576
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1577
    aStream nextPutAll:('''---- ' , aMessage , ' ',
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1578
			Date today printString , ' ' ,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1579
			Time now printString ,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1580
			' ----''').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1581
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1582
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1583
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1584
changesStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1585
    "return a Stream for the writing changes file - or nil if no update is wanted"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1586
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1587
    |streamType aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1588
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1589
    self askIfUpdatingChanges ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1590
	fileName := ObjectMemory nameForChanges.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1591
        
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1592
	LockChangesFile ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1593
	    streamType := LockedFileStream. 
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1594
	] ifFalse:[
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1595
	    streamType := FileStream.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1596
	].
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1597
	aStream := streamType oldFileNamed:fileName.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1598
	aStream isNil ifTrue:[
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1599
	    aStream := streamType newFileNamed:fileName.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1600
	    aStream isNil ifTrue:[
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1601
		self warn:'cannot create/update the changes file'.
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1602
		^ nil
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1603
	    ]
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1604
	].
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1605
	aStream setToEnd
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1606
    ].
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1607
    ^ aStream
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1608
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1609
    "Created: 28.10.1995 / 16:53:43 / cg"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1610
    "Modified: 28.10.1995 / 16:55:03 / cg"
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1611
!
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1612
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1613
sourcesStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1614
    "return a stream for writing the sources file.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1615
     Notice, in ST/X, it is noncommon to use a single
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1616
     source file; typically each classes source is kept
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1617
     in a separate file."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1618
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1619
    |aStream fileName|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1620
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1621
    fileName := ObjectMemory nameForSources.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1622
    aStream := FileStream oldFileNamed:fileName.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1623
    aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1624
	aStream := FileStream newFileNamed:fileName.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1625
	aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1626
	    Transcript showCr:'cannot update sources file'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1627
	    ^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1628
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1629
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1630
    aStream setToEnd.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1631
    ^ aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1632
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1633
    "Created: 28.10.1995 / 16:53:17 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1634
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1635
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1636
withoutUpdatingChangesDo:aBlock
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1637
    "turn off change file update while evaluating aBlock.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1638
     This method makes sure, that the update-flag is correctly restored
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1639
     in case of an abort or other error."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1640
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1641
    UpdateChangeFileQuerySignal handle:[:ex | 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1642
	ex proceedWith:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1643
    ] do:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1644
	aBlock value
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1645
    ].
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  1646
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  1647
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1648
writingChangeDo:aBlock
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1649
    "common helper to write a change record.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1650
     Opens the changefile and executes aBlock passing the stream
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1651
     as argument. WriteErrors are cought and will lead to a warning.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1652
     The changefile is not kept open, to force the change to go to disk
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1653
     as soon as possible - thus, in case of a crash, no changes should
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1654
     be lost due to buffering."
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1655
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1656
    self writingChangeWithTimeStamp:true do:aBlock
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1657
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1658
    "Modified: 18.11.1995 / 15:43:36 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1659
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1660
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1661
writingChangePerform:aSelector with:anArgument
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1662
    self writingChangeWithTimeStamp:true perform:aSelector with:anArgument
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1663
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1664
    "Created: 28.10.1995 / 16:50:48 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1665
    "Modified: 18.11.1995 / 15:44:53 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1666
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1667
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1668
writingChangeWithTimeStamp:doStampIt do:aBlock
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1669
    "common helper to write a change record.
155
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1670
     Opens the changefile and executes aBlock passing the stream
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
  1671
     as argument. WriteErrors are cought and will lead to a warning.
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
  1672
     The changefile is not kept open, to force the change to go to disk
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
  1673
     as soon as possible - thus, in case of a crash, no changes should
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
  1674
     be lost due to buffering."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1675
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  1676
    |aStream|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1677
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1678
    aStream := self changesStream.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1679
    aStream notNil ifTrue:[
155
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1680
	FileStream writeErrorSignal handle:[:ex |
355
2d96938a5081 *** empty log message ***
claus
parents: 345
diff changeset
  1681
	    self warn:('could not update the changes-file\\' , ex errorString) withCRs.
155
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1682
	    ex return
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1683
	] do:[
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1684
	    doStampIt ifTrue:[self addChangeTimeStampTo:aStream].
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1685
	    aBlock value:aStream.
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1686
	    aStream cr.
155
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1687
	].
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1688
	aStream close
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1689
    ]
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1690
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1691
    "Created: 18.11.1995 / 15:36:02 / cg"
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1692
!
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1693
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1694
writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1695
    self writingChangeWithTimeStamp:stampIt do:[:stream |
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1696
	self perform:aSelector with:anArgument with:stream.
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1697
    ]
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1698
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1699
    "Created: 18.11.1995 / 15:44:28 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1700
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1701
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1702
!Class methodsFor:'compiling'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1703
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1704
compile:code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1705
    "compile code, aString for this class; 
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1706
     if successful update the method dictionary.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1707
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1708
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1709
    ^ self compilerClass 
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1710
	compile:code 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1711
	forClass:self
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1712
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1713
    "Modified: 13.12.1995 / 10:56:00 / cg"
328
claus
parents: 326
diff changeset
  1714
!
claus
parents: 326
diff changeset
  1715
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1716
compile:code classified:category
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1717
    "compile code, aString for this class; 
671
53de87163ad5 spelling
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1718
     if successful update the method dictionary. 
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1719
     The method is classified under category.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1720
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1721
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1722
    ^ self compilerClass 
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1723
	compile:code 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1724
	forClass:self 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1725
	inCategory:category
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1726
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1727
    "Modified: 13.12.1995 / 11:02:34 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1728
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1729
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1730
compile:code notifying:requestor
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1731
    "compile code, aString for this class; on any error, notify
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1732
     requestor, anObject with the error reason.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1733
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1734
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1735
    ^ self compilerClass 
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1736
	compile:code 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1737
	forClass:self 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1738
	notifying:requestor
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1739
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1740
    "Modified: 13.12.1995 / 11:02:40 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1741
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1742
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1743
recompile
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1744
    "recompile all methods
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1745
     used when a class changes instances and therefore all methods
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1746
     have to be recompiled"
2
claus
parents: 1
diff changeset
  1747
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1748
    selectorArray do:[:aSelector |
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1749
	self recompile:aSelector
2
claus
parents: 1
diff changeset
  1750
    ]
claus
parents: 1
diff changeset
  1751
!
claus
parents: 1
diff changeset
  1752
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1753
recompile:aSelector
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1754
    "recompile the method associated with the argument, aSelector;
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1755
     used when a superclass changes instances and we have to recompile
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1756
     subclasses"
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1757
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1758
    |cat code|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1759
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1760
    Class withoutUpdatingChangesDo:[
362
claus
parents: 360
diff changeset
  1761
	Class methodRedefinitionSignal handle:[:ex |
claus
parents: 360
diff changeset
  1762
	    ex proceed
claus
parents: 360
diff changeset
  1763
	] do:[
claus
parents: 360
diff changeset
  1764
	    cat := (self compiledMethodAt:aSelector) category.
claus
parents: 360
diff changeset
  1765
	    code := self sourceCodeAt:aSelector.
claus
parents: 360
diff changeset
  1766
	    self compilerClass compile:code forClass:self inCategory:cat
claus
parents: 360
diff changeset
  1767
	]
2
claus
parents: 1
diff changeset
  1768
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1769
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1770
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1771
recompileAll
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1772
    "recompile this class and all subclasses"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1773
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1774
    |classes|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1775
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1776
    classes := self subclasses.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1777
    self recompile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1778
    classes do:[:aClass |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1779
	aClass recompileAll
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1780
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1781
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1782
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1783
recompileInvalidatedMethods:trap
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1784
    "recompile all invalidated methods"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1785
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1786
    |trapCode trapByteCode|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1787
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1788
    trapCode := trap code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1789
    trapByteCode := trap byteCode.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1790
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1791
    selectorArray do:[:aSelector |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1792
	|m|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1793
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1794
	m := self compiledMethodAt:aSelector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1795
	((m code = trapCode) and:[m byteCode == trapByteCode]) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1796
	    self recompile:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1797
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1798
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1799
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1800
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1801
recompileMethodsAccessingAny:setOfNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1802
    "recompile all methods accessing a variable from setOfNames"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1803
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1804
    self recompileMethodsAccessingAny:setOfNames orSuper:false 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1805
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1806
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1807
recompileMethodsAccessingAny:setOfNames orSuper:superBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1808
    "recompile all methods accessing a variable from setOfNames,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1809
     or super (if superBoolean is true)"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1810
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1811
    |p|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1812
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1813
    selectorArray do:[:aSelector |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1814
	|m|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1815
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1816
	m := self compiledMethodAt:aSelector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1817
	p := Parser parseMethod:(m source) in:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1818
	(p isNil 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1819
	 or:[(p usedVars notNil and:[p usedVars includesAny:setOfNames])
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1820
	 or:[superBoolean and:[p usesSuper]]]) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1821
	    self recompile:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1822
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1823
    ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1824
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1825
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1826
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1827
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1828
ignoredMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1829
    "this is a speciality of ST/X - it allows quick commenting of methods
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1830
     from a source-file by replacing the 'methodsFor:' by 'ignoredMethodsFor'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1831
     Returns a ClassCategoryReader to read in and skip methods."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1832
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1833
    ^ ClassCategoryReader skippingChunks
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1834
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1835
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1836
methods
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1837
    "this method allows fileIn of ST/V methods -
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1838
     return a ClassCategoryReader to read in and compile methods for me."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1839
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1840
    ^ ClassCategoryReader class:self category:'ST/V methods'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1841
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1842
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1843
methodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1844
    "return a ClassCategoryReader to read in and compile methods for me.
10
claus
parents: 5
diff changeset
  1845
     This one actually creates the ClassReader when code is filed-in."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1846
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1847
    ^ ClassCategoryReader class:self category:aCategory
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1848
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1849
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1850
methodsForUndefined:categoryString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1851
    "ST-80 compatibility.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1852
     I dont yet know what this does - it was encountered by some tester.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1853
     For now, simply forward it."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1854
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1855
    ^ self methodsFor:categoryString
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1856
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1857
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1858
primitiveDefinitions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1859
    "this method allows fileIn of classes with primitive code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1860
     outside of methods - it returns a CCReader which skips the next chunks"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1861
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1862
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1863
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1864
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1865
primitiveFunctions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1866
    "this method allows fileIn of classes with primitive code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1867
     outside of methods - it returns a CCReader which skips the next chunks"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1868
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1869
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1870
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1871
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1872
primitiveVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1873
    "this method allows fileIn of classes with primitive code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1874
     outside of methods - it returns a CCReader which skips the next chunks"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1875
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1876
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1877
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1878
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1879
privateMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1880
    "this method allows fileIn of ENVY methods 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1881
     (although ST/X currently does NOT really enforce method visibility yet).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1882
     Returns a ClassCategoryReader to read in and compile methods for me."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1883
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1884
    ^ (self methodsFor:aCategory) privateProtocol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1885
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1886
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1887
protectedMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1888
    "this method allows fileIn of ENVY methods 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1889
     (although ST/X currently does NOT really enforce method visibility yet).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1890
     Returns a ClassCategoryReader to read in and compile methods for me."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1891
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1892
    ^ (self methodsFor:aCategory) protectedProtocol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1893
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1894
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1895
publicMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1896
    "this method allows fileIn of ENVY methods 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1897
     (although ST/X currently does NOT support method visibility).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1898
     Returns a ClassCategoryReader to read in and compile methods for me."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1899
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1900
    ^ self methodsFor:aCategory
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1901
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1902
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1903
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1904
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1905
basicFileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1906
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  1907
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1908
    |isVar line s|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1909
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
  1910
    "take care of nil-superclass"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1911
    superclass isNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1912
	line := 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1913
    ] ifFalse:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1914
	line := (superclass name)
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1915
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1916
    superclass isNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1917
	isVar := self isVariable
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1918
    ] ifFalse:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1919
	"I cant remember what this is for ?"
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1920
	isVar := (self isVariable and:[superclass isVariable not])
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1921
    ].
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1922
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1923
    isVar ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1924
	self isBytes ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1925
	    s := ' variableByteSubclass:#'
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1926
	] ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1927
	    self isWords ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1928
		s := ' variableWordSubclass:#'
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1929
	    ] ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1930
		self isLongs ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1931
		    s := ' variableLongSubclass:#'
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1932
		] ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1933
		    self isFloats ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1934
			s := ' variableFloatSubclass:#'
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1935
		    ] ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1936
			self isDoubles ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1937
			    s := ' variableDoubleSubclass:#'
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1938
			] ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1939
			    s := ' variableSubclass:#'
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1940
			]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1941
		    ]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1942
		]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1943
	    ]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1944
	]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1945
    ] ifFalse:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1946
	s := ' subclass:#'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1947
    ].
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1948
    line := line , s , name.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1949
    aStream nextPutAll:line.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1950
345
claus
parents: 333
diff changeset
  1951
    aStream crtab. 
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1952
    aStream nextPutAll:'instanceVariableNames:'''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1953
    self printInstVarNamesOn:aStream indent:16.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1954
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1955
345
claus
parents: 333
diff changeset
  1956
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1957
    aStream nextPutAll:'classVariableNames:'''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1958
    self printClassVarNamesOn:aStream indent:16.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1959
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1960
345
claus
parents: 333
diff changeset
  1961
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1962
    aStream nextPutAll:'poolDictionaries:'''''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1963
345
claus
parents: 333
diff changeset
  1964
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1965
    aStream nextPutAll:'category:'.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1966
    category isNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1967
	s := ''''''
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1968
    ] ifFalse:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1969
	s := category asString storeString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1970
    ].
333
claus
parents: 328
diff changeset
  1971
    aStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1972
    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
  1973
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  1974
    "Modified: 10.12.1995 / 16:31:50 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1975
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1976
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1977
binaryFileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1978
    "create a file 'class.cls' consisting of all methods in myself
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1979
     in a portable binary format. The methods source is saved by reference
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1980
     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
  1981
     That sourcefile needs to be present after reload in order to be
895
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
  1982
     browsable."
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1983
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1984
    self binaryFileOutWithSourceMode:#reference
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1985
!
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1986
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1987
binaryFileOutWithSourceMode:sourceMode
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1988
    "create a file 'class.cls' consisting of all methods in myself
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1989
     in a portable binary format. 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1990
     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
  1991
	#keep - include the source
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1992
	#reference - include a reference to the sourceFile
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1993
	#discard - dont save sources.
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1994
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1995
     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
  1996
     in order to be browsable."
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  1997
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1998
    |baseName fileName aStream|
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  1999
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2000
    baseName := (Smalltalk fileNameForClass:self name).
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2001
    fileName := baseName , '.cls'.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2002
    aStream := FileStream newFileNamed:fileName.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2003
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2004
    aStream binary.
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2005
    self binaryFileOutOn:aStream sourceMode:sourceMode.
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2006
    aStream close.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2007
!
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2008
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2009
binaryFileOutOn:aStream
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2010
    "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
  2011
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2012
    self binaryFileOutOn:aStream sourceMode:#reference 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2013
!
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2014
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2015
binaryFileOutOn:aStream sourceMode:sourceMode
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2016
    "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
  2017
     a portable binary format. 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2018
     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
  2019
	#keep - include the source
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2020
	#reference - include a reference to the sourceFile
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2021
	#discard - dont save sources.
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2022
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2023
     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
  2024
     in order to be browsable."
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2025
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2026
    |bos|
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2027
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2028
    bos := BinaryObjectStorage onNew:aStream.
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2029
    bos sourceMode:sourceMode.
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2030
    bos nextPutClasses:(Array with:self).
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2031
    bos close.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2032
!
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2033
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2034
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2035
    "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
  2036
     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
  2037
     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
  2038
     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
  2039
     case of errors (for example: disk full). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2040
     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
  2041
     sourceFile may not be rewritten."
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
    |aStream baseName dirName fileName newFileName needRename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2044
     mySourceFileName sameFile|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2045
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2046
    baseName := (Smalltalk fileNameForClass:self name).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2047
    fileName := baseName , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2048
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2049
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2050
     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
  2051
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2052
    Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2053
	dirName := Project currentProjectDirectory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2054
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2055
	dirName := ''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2056
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2057
    fileName := dirName , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2058
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2059
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2060
     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
  2061
     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
  2062
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2063
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2064
    (fileName asFilename exists 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2065
    and:[classFilename notNil]) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2066
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2067
	 check for overwriting my current source file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2068
	 this is not allowed, since it would clobber my methods source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2069
	 file ... you have to save it to some other place.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2070
	 This happens if you ask for a fileOut into the source-directory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2071
	 (from which my methods get their source)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2072
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2073
	mySourceFileName := Smalltalk getSourceFileName:classFilename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2074
	sameFile := (fileName = mySourceFileName).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2075
	sameFile ifFalse:[
600
10d5c6a49061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
  2076
	    mySourceFileName notNil ifTrue:[
10d5c6a49061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
  2077
		sameFile := (fileName asFilename info at:#id) == (mySourceFileName asFilename info at:#id)
10d5c6a49061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
  2078
	    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2079
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2080
	sameFile ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2081
	    ^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2082
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2083
		errorString:('may not overwrite sourcefile:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2084
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2085
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2086
	fileName asFilename copyTo:('/tmp/' , baseName , '.sav').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2087
	newFileName := dirName , baseName , '.new'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2088
	needRename := true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2089
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2090
	newFileName := fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2091
	needRename := false
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2092
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2093
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2094
    aStream := FileStream newFileNamed:newFileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2095
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2096
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2097
		raiseRequestWith:newFileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2098
		errorString:('cannot create file:', newFileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2099
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2100
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2101
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2102
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2103
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2104
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2105
     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
  2106
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2107
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2108
    needRename ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2109
	newFileName asFilename copyTo:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2110
	newFileName asFilename delete
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2111
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2112
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2113
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2114
     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
  2115
     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
  2116
     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
  2117
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2118
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2119
    self addChangeRecordForClassFileOut:self
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2120
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2121
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2122
fileOutCategory:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2123
    "create a file 'class-category.st' consisting of all methods in aCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2124
     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
  2125
     directory."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2126
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2127
    |aStream fileName|
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
    fileName := name , '-' , aCategory , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2130
    fileName replaceAll:(Character space) by:$_.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2131
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2132
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2133
     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
  2134
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2135
    Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2136
	fileName := Project currentProjectDirectory , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2137
    ].
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2138
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2139
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2140
     if file exists, save original in a .sav file
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2141
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2142
    fileName asFilename exists ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2143
	fileName asFilename copyTo:(fileName , '.sav')
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2144
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2145
    aStream := FileStream newFileNamed:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2146
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2147
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2148
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2149
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2150
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2151
    self fileOutCategory:aCategory on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2152
    aStream close
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2153
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2154
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2155
fileOutCategory:aCategory except:skippedMethods only:savedMethods on:aStream
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2156
    "file out all methods belonging to aCategory, aString onto aStream.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2157
     If skippedMethods is nonNil, those are not saved.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2158
     If savedMethods is nonNil, only those are saved.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2159
     If both are nil, all are saved. See version-method handling in
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2160
     fileOut for what this is needed."
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2161
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2162
    |source sortedSelectors first privacy interestingMethods|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2163
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2164
    methodArray notNil ifTrue:[
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2165
	interestingMethods := OrderedCollection new.
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2166
	methodArray do:[:aMethod |
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2167
	    |wanted|
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2168
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2169
	    (aCategory = aMethod category) ifTrue:[
649
6a2a1eec91fe more revision stuff for sourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
  2170
		skippedMethods notNil ifTrue:[
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2171
		    wanted := (skippedMethods includesIdentical:aMethod) not
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2172
		] ifFalse:[
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2173
		    savedMethods notNil ifTrue:[
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2174
			wanted := (savedMethods includesIdentical:aMethod).
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2175
		    ] ifFalse:[
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2176
			wanted := true
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2177
		    ]
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2178
		].
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2179
		wanted ifTrue:[interestingMethods add:aMethod].
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2180
	    ]
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2181
	].
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2182
	interestingMethods notEmpty ifTrue:[
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2183
	    first := true.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2184
	    privacy := nil.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2185
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2186
	    "/
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2187
	    "/ sort by selector
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2188
	    "/
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2189
	    sortedSelectors := interestingMethods collect:[:m | self selectorAtMethod:m].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2190
	    sortedSelectors sortWith:interestingMethods.
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2191
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2192
	    interestingMethods do:[:aMethod |
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2193
		first ifFalse:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2194
		    privacy ~~ aMethod privacy ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2195
			first := true.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2196
			aStream space.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2197
			aStream nextPutChunkSeparator.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2198
		    ].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2199
		    aStream cr; cr
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2200
		].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2201
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2202
		privacy := aMethod privacy.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2203
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2204
		first ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2205
		    aStream nextPutChunkSeparator.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2206
		    self printClassNameOn:aStream.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2207
		    privacy ~~ #public ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2208
			aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'''.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2209
		    ] ifFalse:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2210
			aStream nextPutAll:' methodsFor:'''.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2211
		    ].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2212
		    aCategory notNil ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2213
			aStream nextPutAll:aCategory
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2214
		    ].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2215
		    aStream nextPut:$'; nextPutChunkSeparator; cr; cr.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2216
		    first := false.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2217
		].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2218
		source := aMethod source.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2219
		source isNil ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2220
		    FileOutErrorSignal raiseRequestWith:'no source for method'
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2221
		] ifFalse:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2222
		    aStream nextChunkPut:source.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2223
		].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2224
	    ].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2225
	    aStream space.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2226
	    aStream nextPutChunkSeparator.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2227
	    aStream cr
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2228
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2229
    ]
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
    "Modified: 28.8.1995 / 14:30:41 / claus"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2232
    "Modified: 15.11.1995 / 12:45:54 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2233
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2234
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2235
fileOutCategory:aCategory on:aStream
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2236
    "file out all methods belonging to aCategory, aString onto aStream"
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2237
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2238
    self fileOutCategory:aCategory except:nil only:nil on:aStream
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2239
!
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2240
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2241
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2242
    "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
  2243
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2244
    aStream nextPutAll:(name , ' class instanceVariableNames:''').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2245
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2246
    aStream nextPutAll:''''.
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
    "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
  2249
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2250
    aStream cr; cr; nextPut:(Character doubleQuote); cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2251
    aStream space; 
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2252
	    nextPutAll:'The following class instance variables are inherited by this class:';
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2253
	    cr; cr.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2254
    self allSuperclassesDo:[:aSuperClass |
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2255
	aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2256
	aStream nextPutAll:(aSuperClass class instanceVariableString); cr.
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2257
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2258
    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
  2259
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2260
    "Created: 10.12.1995 / 16:31:25 / cg"
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2261
    "Modified: 10.12.1995 / 16:31:44 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2262
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2263
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2264
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2265
    "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
  2266
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2267
    |comment s|
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 nextPutAll:name; nextPutAll:' comment:'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2270
    (comment := self comment) isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2271
	s := ''''''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2272
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2273
	s := comment storeString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2274
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2275
    aStream nextPutAll:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2276
    aStream cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2277
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2278
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2279
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2280
    "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
  2281
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2282
    ^ self basicFileOutDefinitionOn:aStream
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2285
fileOutIn:aFileDirectory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2286
    "create a file 'class.st' consisting of all methods in self in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2287
     directory aFileDirectory (ignoring any directory setting in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2288
     the current porject). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2289
     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
  2290
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2291
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2292
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2293
    fileName := (Smalltalk fileNameForClass:self name) , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2294
    aStream := FileStream newFileNamed:fileName in:aFileDirectory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2295
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2296
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2297
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2298
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2299
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2300
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2301
    aStream close
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2304
fileOutMethod:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2305
    "create a file 'class-method.st' consisting of the method, aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2306
     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
  2307
     directory."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2308
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2309
    |aStream fileName selector|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2310
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2311
    selector := self selectorAtMethod:aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2312
    selector notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2313
	fileName := name , '-' , selector, '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2314
	fileName replaceAll:$: by:$_.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2315
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2316
	 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
  2317
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2318
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2319
	    fileName := Project currentProjectDirectory , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2320
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2321
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2322
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2323
	 if file exists, save original in a .sav file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2324
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2325
	fileName asFilename exists ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2326
	    fileName asFilename copyTo:(fileName , '.sav')
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2327
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2328
	aStream := FileStream newFileNamed:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2329
	aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2330
	    ^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2331
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2332
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2333
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2334
	self fileOutMethod:aMethod on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2335
	aStream close
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2336
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2337
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2338
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2339
fileOutMethod:aMethod on:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2340
    "file out the method, aMethod onto aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2341
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2342
    |cat source privacy|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2343
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2344
    methodArray notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2345
	aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2346
	self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2347
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2348
	(privacy := aMethod privacy) ~~ #public ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2349
	    aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2350
	] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2351
	    aStream nextPutAll:' methodsFor:'''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2352
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2353
	cat := aMethod category.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2354
	cat notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2355
	    aStream nextPutAll:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2356
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2357
	aStream nextPut:$'; nextPutChunkSeparator; cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2358
	source := aMethod source.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2359
	source isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2360
	    FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2361
		raiseRequestWith:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2362
		errorString:('no source for method: ' ,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2363
			     self name , '>>' ,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2364
			     (self selectorAtMethod:aMethod))
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2365
	] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2366
	    aStream nextChunkPut:source.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2367
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2368
	aStream space.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2369
	aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2370
	aStream cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2371
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2372
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2373
    "Modified: 27.8.1995 / 01:23:19 / claus"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2374
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2375
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2376
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2377
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2378
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2379
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2380
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2381
    "Created: 15.11.1995 / 12:53:32 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2382
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2383
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2384
fileOutOn:aStream withTimeStamp:stampIt
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2385
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2386
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2387
    |collectionOfCategories copyrightMethod copyrightText comment cls versionMethod skippedMethods|
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2388
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2389
    self isLoaded ifFalse:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2390
	^ FileOutErrorSignal 
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2391
	    raiseRequestWith:self
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2392
		 errorString:'will not fileOut unloaded classes'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2393
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2394
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2395
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2396
     if there is a copyright method, add a copyright comment
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2397
     at the beginning, taking the string from the copyright method.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2398
     We cannot do this unconditionally - that would lead to my copyrights
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2399
     being put on your code ;-).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2400
     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
  2401
     copyright string at the beginning be preserved .... even if the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2402
     code was edited in the browser and filedOut.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2403
    "
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2404
    (copyrightMethod := self class compiledMethodAt:#copyright) notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2405
	"
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2406
	 get the copyright methods source,
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2407
	 and insert at beginning.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2408
	"
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2409
	copyrightText := copyrightMethod source.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2410
	copyrightText isNil ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2411
	    "
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2412
	     no source available - trigger an error
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2413
	    "
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2414
	    FileOutErrorSignal
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2415
		raiseRequestWith:'no source for class ' , name , ' available. Cannot fileOut'.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2416
	    ^ self
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2417
	].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2418
	"
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2419
	 strip off the selector-line
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2420
	"
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2421
	copyrightText := copyrightText asCollectionOfLines asStringCollection.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2422
	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
  2423
"/        copyrightText do:[:line | aStream nextPutAll:line. aStream cr.].
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2424
	copyrightText := copyrightText asString.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2425
	aStream nextPutAllAsChunk:copyrightText.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2426
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2427
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2428
    stampIt ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2429
	"/
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2430
	"/ first, a timestamp
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2431
	"/
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2432
	aStream nextPutAll:(Smalltalk timeStamp).
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2433
	aStream nextPutChunkSeparator. 
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2434
	aStream cr; cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2435
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2436
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2437
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2438
    "/ then the definition
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2439
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2440
    self fileOutDefinitionOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2441
    aStream nextPutChunkSeparator. 
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2442
    aStream cr; cr.
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2443
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2444
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2445
    "/ optional classInstanceVariables
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2446
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2447
    self class instanceVariableString isBlank ifFalse:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2448
	self fileOutClassInstVarDefinitionOn:aStream.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2449
	aStream nextPutChunkSeparator. 
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2450
	aStream cr; cr
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2451
    ].
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2452
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2453
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2454
    "/ a comment - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2455
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2456
    (comment := self comment) notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2457
	aStream nextPutAll:name; nextPutAll:' comment:'.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2458
	aStream nextPutAll:(comment storeString).
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2459
	aStream nextPutChunkSeparator.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2460
	aStream cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2461
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2462
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2463
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2464
    "/ primitive definitions - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2465
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2466
    self fileOutPrimitiveSpecsOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2467
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2468
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2469
    "/ 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
  2470
    "/ 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
  2471
    "/         avoid sourcePosition-shifts when checked out later.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2472
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2473
    collectionOfCategories := self class categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2474
    collectionOfCategories notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2475
	"/
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2476
	"/ documentation first (if any), but not the version method
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2477
	"/
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2478
	(collectionOfCategories includes:'documentation') ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2479
	    versionMethod := self class compiledMethodAt:#version.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2480
	    versionMethod notNil ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2481
		skippedMethods := Array with:versionMethod
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2482
	    ].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2483
	    self class fileOutCategory:'documentation' except:skippedMethods only:nil on:aStream.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2484
	    aStream cr.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2485
	].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2486
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2487
	"/
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2488
	"/ initialization next (if any)
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2489
	"/
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2490
	(collectionOfCategories includes:'initialization') ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2491
	    self class fileOutCategory:'initialization' on:aStream.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2492
	    aStream cr.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2493
	].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2494
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2495
	"/
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2496
	"/ instance creation next (if any)
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2497
	"/
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2498
	(collectionOfCategories includes:'instance creation') ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2499
	    self class fileOutCategory:'instance creation' on:aStream.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2500
	    aStream cr.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2501
	].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2502
	collectionOfCategories do:[:aCategory |
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2503
	    ((aCategory ~= 'documentation')
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2504
	    and:[(aCategory ~= 'initialization')
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2505
	    and:[aCategory ~= 'instance creation']]) ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2506
		self class fileOutCategory:aCategory on:aStream.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2507
		aStream cr
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2508
	    ]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2509
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2510
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2511
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2512
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2513
    "/ methods from all categories in myself
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2514
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2515
    collectionOfCategories := self categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2516
    collectionOfCategories notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2517
	collectionOfCategories do:[:aCategory |
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2518
	    self fileOutCategory:aCategory on:aStream.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2519
	    aStream cr
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2520
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2521
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2522
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2523
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2524
    "/ finally, the previously skipped version method
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2525
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2526
    versionMethod notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2527
	self class 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
  2528
    ].
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2529
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2530
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2531
    "/ optionally an initialize message
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2532
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2533
    (self class implements:#initialize) ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2534
	aStream nextPutAll:(name , ' initialize').
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2535
	aStream nextPutChunkSeparator.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2536
	aStream cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2537
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2538
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2539
    "Created: 15.11.1995 / 12:53:06 / cg"
719
c557a530f971 dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  2540
    "Modified: 9.12.1995 / 15:54:40 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2541
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2542
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2543
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2544
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2545
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2546
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2547
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2548
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2549
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2550
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2551
    (s := self primitiveDefinitionsString) notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2552
	aStream nextPutChunkSeparator; 
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2553
		nextPutAll:name; nextPutAll:' primitiveDefinitions';
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2554
		nextPutChunkSeparator;
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2555
		cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2556
	aStream nextPutAll:s.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2557
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2558
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2559
    (s := self primitiveVariablesString) notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2560
	aStream nextPutChunkSeparator; 
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2561
		nextPutAll:name; nextPutAll:' primitiveVariables';
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2562
		nextPutChunkSeparator;
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2563
		cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2564
	aStream nextPutAll:s.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2565
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2566
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2567
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2568
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2569
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2570
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2571
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2572
    |s|
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
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2575
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2576
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2577
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2578
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2579
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2580
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2581
    (s := self primitiveFunctionsString) notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2582
	aStream nextPutChunkSeparator; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2583
		nextPutAll:name; nextPutAll:' primitiveFunctions';
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2584
		nextPutChunkSeparator;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2585
		cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2586
	aStream nextPutAll:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2587
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2591
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2592
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2593
printClassNameOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2594
    "helper for fileOut - print my name if I am not a Metaclass;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2595
     otherwise my name without -class followed by space-class"
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
    self isMeta ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2598
	aStream nextPutAll:(name copyTo:(name size - 5)); nextPutAll:' class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2599
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2600
	name printOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2601
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2602
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2603
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2604
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2605
    "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
  2606
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2607
    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
  2608
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2609
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2610
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2611
    "print myself and all subclasses on aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2612
     recursively calls itself to print subclasses. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2613
     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
  2614
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2615
    aStream spaces:indent; bold; nextPutAll:name; normal; nextPutAll:' ('.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2616
    self printInstVarNamesOn:aStream indent:(indent + name size + 2).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2617
    aStream nextPutAll:')'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2618
    aStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2619
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2620
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2621
	aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2622
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2623
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2624
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2625
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2626
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2627
     printStream close"
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2630
printHierarchyAnswerIndentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2631
    "print my class hierarchy on aStream - return indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2632
     recursively calls itself to print superclass and use returned indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2633
     for my description - used in the browser"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2634
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2635
    |indent|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2636
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2637
    indent := 0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2638
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2639
	indent := (superclass printHierarchyAnswerIndentOn:aStream) + 2
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2640
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2641
    aStream spaces:indent.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2642
    aStream nextPutAll:name; nextPutAll:' ('.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2643
    self printInstVarNamesOn:aStream indent:(indent + name size + 2).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2644
    aStream nextPutAll:')'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2645
    aStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2646
    ^ indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2647
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2648
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2649
printHierarchyOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2650
    "print my class hierarchy on aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2651
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2652
    self printHierarchyAnswerIndentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2653
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2654
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2655
printInstVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2656
    "print the instance 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
  2657
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2658
    self printNameArray:(self instVarNames) on:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2659
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2660
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2661
printNameArray:anArray on:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2662
    "print an array of strings separated by spaces; when the stream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2663
     defines a lineLength, break when this limit is reached; indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2664
     every line; used to printOut instance variable names"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2665
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2666
    |thisName nextName arraySize lenMax pos mustBreak line spaces|
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
    arraySize := anArray size.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2669
    arraySize ~~ 0 ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2670
	pos := indent.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2671
	lenMax := aStream lineLength.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2672
	thisName := anArray at:1.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2673
	line := ''.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2674
	1 to:arraySize do:[:index |
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2675
	    line := line , thisName.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2676
	    pos := pos + thisName size.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2677
	    (index == arraySize) ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2678
		nextName := anArray at:(index + 1).
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2679
		mustBreak := false.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2680
		(lenMax > 0) ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2681
		    ((pos + nextName size) > lenMax) ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2682
			mustBreak := true
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2683
		    ]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2684
		].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2685
		mustBreak ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2686
		    aStream nextPutAll:line withTabs.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2687
		    aStream cr.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2688
		    spaces isNil ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2689
			spaces := String new:indent
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2690
		    ].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2691
		    line := spaces.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2692
		    pos := indent
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2693
		] ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2694
		    line := line , ' '.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2695
		    pos := pos + 1
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2696
		].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2697
		thisName := nextName
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2698
	    ]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2699
	].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2700
	aStream nextPutAll:line withTabs
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2701
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2702
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2703
    "Created: 10.12.1995 / 16:34:23 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2704
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2705
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2706
printOutCategory:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2707
    "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
  2708
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2709
    |any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2710
    methodArray notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2711
	any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2712
	methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2713
	    (aCategory = aMethod category) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2714
		any := true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2715
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2716
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2717
	any ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2718
	     aPrintStream italic.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2719
	     aPrintStream nextPutAll:aCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2720
	     aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2721
	     aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2722
	     methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2723
		 (aCategory = aMethod category) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2724
		     self printOutSource:(aMethod source) on:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2725
		     aPrintStream cr; cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2726
		 ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2727
	     ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2728
	     aPrintStream cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2729
	 ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2730
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2731
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2732
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2733
printOutCategoryProtocol:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2734
    |any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2735
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2736
    methodArray notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2737
	any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2738
	methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2739
	    (aCategory = aMethod category) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2740
		any := true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2741
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2742
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2743
	any ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2744
	    aPrintStream italic.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2745
	    aPrintStream nextPutAll:aCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2746
	    aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2747
	    aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2748
	    methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2749
		(aCategory = aMethod category) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2750
		    self printOutSourceProtocol:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2751
					     on:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2752
		    aPrintStream cr; cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2753
		]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2754
	    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2755
	    aPrintStream cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2756
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2757
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2758
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2759
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2760
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2761
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2762
333
claus
parents: 328
diff changeset
  2763
    |comment s|
claus
parents: 328
diff changeset
  2764
claus
parents: 328
diff changeset
  2765
    aPrintStream nextPutAll:'class                '; bold; nextPutAll:name; normal; cr. 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2766
    aPrintStream nextPutAll:'superclass           '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2767
    superclass isNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2768
	s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2769
    ] ifFalse:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2770
	s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2771
    ].
333
claus
parents: 328
diff changeset
  2772
    aPrintStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2773
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2774
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2775
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2776
    self printInstVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2777
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2778
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2779
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2780
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2781
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2782
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2783
    category notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2784
	aPrintStream nextPutAll:'category             '; nextPutAll:(category printString).
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2785
	aPrintStream cr
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2786
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2787
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  2788
    (comment := self comment) notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2789
	aPrintStream cr; nextPutAll:'comment:'; cr; italic; nextPutAll:comment; normal; cr
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2790
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2791
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2792
    "Created: 10.12.1995 / 16:30:47 / cg"
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2793
    "Modified: 10.12.1995 / 16:32:01 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2794
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2795
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2796
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2797
    "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
  2798
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2799
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2800
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2801
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2802
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2803
    collectionOfCategories := self class categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2804
    collectionOfCategories notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2805
	aPrintStream nextPutAll:'class protocol'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2806
	aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2807
	collectionOfCategories do:[:aCategory |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2808
	    self class printOutCategory:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2809
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2810
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2811
    collectionOfCategories := self categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2812
    collectionOfCategories notNil ifTrue:[
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2813
	aPrintStream nextPutAll:'instance protocol'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2814
	aPrintStream cr; cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2815
	collectionOfCategories do:[:aCategory |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2816
	    self printOutCategory:aCategory on:aPrintStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2817
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2818
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2819
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2820
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2821
printOutProtocolOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2822
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2823
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2824
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2825
    collectionOfCategories := self class categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2826
    collectionOfCategories notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2827
	aPrintStream nextPutAll:'class protocol'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2828
	aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2829
	collectionOfCategories do:[:aCategory |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2830
	    self class printOutCategoryProtocol:aCategory on:aPrintStream
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2831
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2832
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2833
    collectionOfCategories := self categories.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2834
    collectionOfCategories notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2835
	aPrintStream nextPutAll:'instance protocol'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2836
	aPrintStream cr; cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2837
	collectionOfCategories do:[:aCategory |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2838
	    self printOutCategoryProtocol:aCategory on:aPrintStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2839
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2840
    ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2841
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2842
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2843
printOutSource:aString on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2844
    "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
  2845
     comments are printed italic"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2846
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2847
    |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
  2848
    text := aString asStringCollection.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2849
    aPrintStream bold.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2850
    aPrintStream nextPutAll:(text at:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2851
    aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2852
    aPrintStream cr.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2853
    inComment := false.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2854
    textSize := text size.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2855
    textIndex := 2.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2856
    [textIndex <= textSize] whileTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2857
	line := text at:textIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2858
	((line occurrencesOf:Character doubleQuote) == 0) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2859
	    aPrintStream nextPutAll:line
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2860
	] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2861
	    lineSize := line size.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2862
	    lineIndex := 1.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2863
	    [lineIndex <= lineSize] whileTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2864
		aCharacter := line at:lineIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2865
		(aCharacter == Character doubleQuote) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2866
		    inComment ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2867
			aPrintStream normal.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2868
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2869
			inComment := false
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2870
		    ] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2871
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2872
			aPrintStream italic.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2873
			inComment := true
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2874
		    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2875
		] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2876
		    aPrintStream nextPut:aCharacter
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2877
		].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2878
		lineIndex := lineIndex + 1
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2879
	    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2880
	].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2881
	aPrintStream cr.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2882
	textIndex := textIndex + 1
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2883
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2884
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2885
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2886
printOutSourceProtocol:aMethod on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2887
    "given the source in aString, print the methods message specification
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2888
     and any method comments - without source; used to generate documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2889
     pages"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2890
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2891
    |text|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2892
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2893
    text := aMethod source asStringCollection.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2894
    (text size < 1) ifTrue:[^self].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2895
    aPrintStream bold.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2896
    aPrintStream nextPutAll:(text at:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2897
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2898
    (text size >= 2) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2899
	aPrintStream italic.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2900
	aPrintStream spaces:((text at:2) indexOfNonSeparatorStartingAt:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2901
	aPrintStream nextPutAll:aMethod comment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2902
	aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2903
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2904
    aPrintStream normal
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2905
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2906
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2907
      Float printOutProtocolOn:Stdout 
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2908
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2909
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2910
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2911
!Class methodsFor:'private'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2912
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2913
addAllCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2914
    "helper - add categories and all superclasses categories
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2915
     to the argument, aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2916
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2917
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2918
	superclass addAllCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2919
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2920
    self addCategoriesTo:aCollection
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2921
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2922
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2923
addAllClassVarNamesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2924
    "helper - add the name-strings of the class variables and of the class-vars
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2925
     of all superclasses to the argument, aCollection. Return aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2926
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2927
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2928
	superclass addAllClassVarNamesTo:aCollection
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
    classvars notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2931
	aCollection addAll:(classvars asCollectionOfWords).
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2932
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2933
    ^ aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2934
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2935
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2936
addCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2937
    "helper - add categories to the argument, aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2938
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2939
    methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2940
	|cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2941
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2942
	cat := aMethod category.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2943
	(aCollection includes:cat) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2944
	    aCollection add:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2945
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2946
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2947
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2948
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2949
getPrimitiveSpecsAt:index
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2950
    "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
  2951
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2952
    |pos stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2953
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2954
    primitiveSpec isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2955
    pos := primitiveSpec at:index.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2956
    pos isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2957
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2958
    "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
  2959
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2960
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2961
    pos isNumber ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2962
	classFilename notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2963
	    stream := self sourceStream. "/ Smalltalk sourceFileStreamFor:classFilename.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2964
	    stream notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2965
		stream position:pos+1.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2966
		string := stream nextChunk.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2967
		stream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2968
		^ string
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2969
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2970
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2971
	^ nil
544
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  2972
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2973
    ^ pos
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2974
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2975
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2976
setPrimitiveSpecsAt:index to:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2977
    "set a primitiveSpecification component to aString"
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
    primitiveSpec isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2980
	primitiveSpec := Array new:3
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2981
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2982
    primitiveSpec at:index put:aString
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  2983
!
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  2984
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  2985
askIfUpdatingChanges
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  2986
    UpdateChangeFileQuerySignal isHandled ifFalse:[^ UpdatingChanges].
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  2987
    ^ UpdateChangeFileQuerySignal raise
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2988
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2989
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2990
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2991
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2992
allCategories
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2993
    "Return a Collection of all method-category strings known in class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2994
     and all superclasses. The returned collection is not sorted by any order."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2995
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2996
    |coll|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2997
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2998
    coll := OrderedCollection new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2999
    self addAllCategoriesTo:coll.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3000
    ^ coll
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3001
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3002
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3003
     Point categories  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3004
     Point allCategories 
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3005
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3006
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3007
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3008
categories
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3009
    "Return a Collection of all method-category strings known in class.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3010
     The returned collection is not sorted by any order."
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3011
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3012
    |newList cat|
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3013
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3014
    newList := OrderedCollection new.
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3015
    methodArray do:[:aMethod |
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3016
	cat := aMethod category.
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3017
	newList indexOf:cat ifAbsent:[newList add:cat]
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3018
    ].
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3019
    ^ newList
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3020
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3021
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3022
     Point categories  
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  3023
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3024
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3025
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3026
isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3027
    "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
  3028
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3029
     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
  3030
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3031
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3032
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3033
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3034
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3035
     Point isClass  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3036
     1 isClass      
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3037
     Behavior new isBehavior  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3038
     Behavior new isClass       
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3039
     Class new isBehavior    
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3040
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3041
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3042
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3043
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3044
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3045
    "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
  3046
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3047
     This is not an attribute of the class, but instead remembered in
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3048
     Autoload. The interface here is for covenience."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3049
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3050
    ^ Autoload wasAutoloaded:self
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3051
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3052
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3053
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3054
    "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
  3055
     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
  3056
     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
  3057
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3058
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3059
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3060
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3061
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3062
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3063
	(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3064
	cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3065
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3066
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3067
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3068
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3069
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3070
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3071
    "
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3072
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3073
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3074
whichClassDefinesInstVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3075
    "return the class which defines the instance variable
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3076
     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
  3077
     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
  3078
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3079
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3080
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3081
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3082
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3083
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3084
	(cls instVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3085
	cls := cls superclass
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3086
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3087
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3088
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3089
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3090
     StandardSystemView whichClassDefinesInstVar:'label'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3091
     StandardSystemView whichClassDefinesInstVar:'paint'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3092
     StandardSystemView whichClassDefinesInstVar:'foo'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3093
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3094
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3095
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
  3096
!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
  3097
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3098
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
  3099
    "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
  3100
     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
  3101
     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
  3102
     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
  3103
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3104
    ^ 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
  3105
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3106
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3107
     Object 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
  3108
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3109
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3110
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3111
     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
  3112
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3113
     |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
  3114
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3115
     classes := Smalltalk allClasses 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3116
		    select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls 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
  3117
     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
  3118
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3119
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3120
    "Created: 7.12.1995 / 10:58:47 / 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
  3121
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3122
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3123
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
  3124
    "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
  3125
     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
  3126
     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
  3127
     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
  3128
     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
  3129
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3130
     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
  3131
     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
  3132
     If no such info is present in the class, 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
  3133
     (this happens with autoloaded and filed0in 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
  3134
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3135
     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
  3136
     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
  3137
     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
  3138
     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
  3139
     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
  3140
     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
  3141
     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
  3142
     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
  3143
     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
  3144
     (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
  3145
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3146
     For example: 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3147
	'....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3148
	'....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3149
	'....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3150
	'....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3151
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3152
     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
  3153
     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
  3154
     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
  3155
     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
  3156
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3157
     Caveat:
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3158
	Encoding this info in the package string seems somewhat kludgy.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3159
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3160
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3161
    |sourceInfo packageString idx1 idx2 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3162
     moduleString directoryString libraryString components|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3163
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3164
    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
  3165
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3166
    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
  3167
    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
  3168
    idx1 ~~ 0 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
  3169
	idx2 := packageString indexOf:$) startingAt:idx1+1.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3170
	idx2 ~~ 0 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
  3171
	    sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3172
	]
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3173
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3174
    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
  3175
    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
  3176
    components size == 0 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
  3177
	moduleString := '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
  3178
	directoryString := libraryString := ''.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3179
	^ 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
  3180
    ] ifFalse:[
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3181
	components size == 1 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
  3182
	    "/ a single name given - the module becomes '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
  3183
	    "/ if the component includes slashes, its the directory
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3184
	    "/ otherwise the 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
  3185
	    "/ 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3186
	    moduleString := '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
  3187
	    directoryString := libraryString := components at:1.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3188
	    (libraryString includes:$/) 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
  3189
		libraryString := libraryString asFilename baseName
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3190
	    ]
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3191
	] ifFalse:[
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
	    components size == 2 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
  3193
		"/ two components - assume its the directory and the 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
  3194
		moduleString := '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
  3195
		directoryString := components at:1.
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
		libraryString := components at:2.
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
	    ] ifFalse:[
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
		"/ all components given
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
		moduleString := components at:1.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3200
		directoryString := components at:2.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3201
		libraryString := components at:3.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3202
	    ]
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3203
	]
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3204
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3205
    libraryString isEmpty 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
  3206
	directoryString notEmpty 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
  3207
	    libraryString := directoryString asFilename baseName
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3208
	].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3209
	libraryString isEmpty 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
  3210
	    "/ lets extract the library from the liblist file ...
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3211
	    libraryString := Smalltalk libraryFileNameOfClass: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
  3212
	    libraryString 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
  3213
	]
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3214
    ].
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
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
    moduleString isEmpty 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
  3217
	moduleString := '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
  3218
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3219
    directoryString isEmpty 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
  3220
	directoryString := libraryString.
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
    ^ IdentityDictionary
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
	with:(#module->moduleString)
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
	with:(#directory->directoryString)
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
	with:(#library->libraryString)
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
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3228
    "
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
     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
  3230
     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
  3231
     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
  3232
     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
  3233
     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
  3234
     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
  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
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3237
    "Created: 4.11.1995 / 20:36:53 / 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
  3238
    "Modified: 25.11.1995 / 18:29:31 / 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
  3239
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3240
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3241
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
  3242
    "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
  3243
     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
  3244
     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
  3245
     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
  3246
     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
  3247
     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
  3248
     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
  3249
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3250
    |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
  3251
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3252
    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
  3253
    info notNil 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
  3254
	^ info at:#revision ifAbsent: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
  3255
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3256
    ^ 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
  3257
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3258
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3259
     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
  3260
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3261
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3262
    "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
  3263
    "Modified: 12.12.1995 / 20:30: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
  3264
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3265
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3266
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
  3267
    "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
  3268
     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
  3269
     The revisionInfo contains all or a subset of:
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3270
	#binaryRevision - the revision upon which the binary of this class is based
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3271
	#revision       - the revision upon which the class is based logically
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3272
			  (different, if a changed class was checked in, but not yet recompiled)
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3273
	#user           - the user who checked in the logical 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
  3274
	#date           - the date when the logical revision was checked in
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3275
	#time           - the time when the logical revision was checked in
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3276
	#fileName       - the classes source 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
  3277
	#repositoryPath - the classes source container
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3278
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3279
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3280
    |vsnString 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
  3281
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3282
    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
  3283
    vsnString notNil 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
  3284
	info := Class revisionInfoFromString:vsnString.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3285
	info notNil 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
  3286
	    info at:#binaryRevision put: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
  3287
	]
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3288
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3289
    ^ 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
  3290
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
    "
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
     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
  3293
     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
  3294
     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
  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
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
    "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
  3298
    "Modified: 9.12.1995 / 21:35:26 / 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
  3299
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3300
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
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
  3302
    "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
  3303
     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
  3304
     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
  3305
     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
  3306
     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
  3307
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
    |cls meta m src val|
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
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
    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
  3311
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
    self isMeta ifTrue:[
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  3313
	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
  3314
    ] ifFalse:[
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  3315
	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
  3316
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3317
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
    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
  3319
    m isNil ifTrue:[
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  3320
	m := cls compiledMethodAt:#version.
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  3321
	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
  3322
    ].
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
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3325
    "/ if its a method returning the 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
  3326
    "/ thats the returned value
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
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3328
    val := cls 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
  3329
    val isString ifTrue:[^ val].
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
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3331
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3332
    "/ 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
  3333
    "/ 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
  3334
    "/ 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
  3335
    "/ 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
  3336
    "/ 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
  3337
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3338
    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
  3339
    src 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
  3340
    ^ self revisionStringFromSource:src 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3341
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3342
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3343
     Smalltalk allClassesDo:[:cls |
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
  3344
	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
  3345
     ].
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
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
     Number 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
  3348
     FileDirectory 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
  3349
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3350
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3351
    "Created: 29.10.1995 / 19:28:03 / 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
  3352
    "Modified: 16.12.1995 / 13:21:00 / 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
  3353
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3354
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3355
revisionStringFromSource:aMethodSourceString
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3356
    "extract a revision string from a methods source 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
  3357
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3358
    |lines idx val|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3359
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3360
    lines := aMethodSourceString asCollectionOfLines.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3361
    lines do:[:l |
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3362
	|i|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3363
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3364
	i := l indexOfSubCollection:'$Header: '.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3365
	i ~~ 0 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
  3366
	    ^ l copyFrom:i
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3367
	]
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3368
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3369
    ^ 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
  3370
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3371
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3372
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
  3373
    "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
  3374
     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
  3375
     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
  3376
     (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
  3377
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3378
    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
  3379
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3380
    "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
  3381
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3382
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3383
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
  3384
    "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
  3385
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3386
    |source fileName aStream cls mgr|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3387
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3388
    self isMeta 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
  3389
	cls := self soleInstance
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3390
    ] ifFalse:[
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3391
	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
  3392
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3393
    classFilename notNil 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
  3394
	source := classFilename
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3395
    ] ifFalse:[
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3396
	source := (Smalltalk fileNameForClass:cls) , '.st'
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3397
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3398
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3399
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3400
    "/ if there is no SourceCodeManager, 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3401
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3402
    "/ 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
  3403
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3404
    ((mgr := self sourceCodeManager) isNil 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  3405
    or:[TryLocalSourceFirst == true]) ifTrue:[
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
  3406
	fileName := Smalltalk getSourceFileName: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
  3407
	fileName notNil 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
  3408
	    aStream := fileName asFilename readStream.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3409
	]
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
    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
  3413
	"/      
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3414
	"/ hard case - there is no source file for this 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
  3415
	"/ (in the source-dir-path).
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
	"/      
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
	"/ look if my binary is from a dynamically loaded module,
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
	"/ and, if so, look in the modules directory for 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
  3421
	"/ source file.
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
	"/      
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
	ObjectFileLoader notNil 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
  3424
	    ObjectFileLoader loadedObjectHandlesDo:[:h |
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
		|f 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
  3426
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3427
		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
  3428
		    (classes := h classes) notNil 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
  3429
			(classes includes:self) 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
  3430
			    f := h pathName.
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
			    f := f asFilename directory.
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
			    f := f construct: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
  3433
			    f exists 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
  3434
				aStream := f readStream.
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
			    ].
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
			].
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
		    ].
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
	    ].
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
    ].
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
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3443
    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
  3444
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3445
	"/ mhmh - still no source file.
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
	"/ If there is a SourceCodeManager, ask it to aquire 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
  3447
	"/ the source for my class, and return an open stream on it. 
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
	"/ if that one does not know about the source, look in
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
	"/ standard places
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
	mgr notNil 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
  3452
	    aStream := mgr sourceStreamFor:cls.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3453
	    aStream isNil ifTrue:[
888
14162557b90c *** empty log message ***
ah
parents: 887
diff changeset
  3454
		fileName := Smalltalk getSourceFileName: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
  3455
		fileName notNil 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
  3456
		    aStream := fileName asFilename readStream.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3457
		]
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3458
	    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3459
	].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3460
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3461
	"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3462
	"/ final chance: try current directory
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3463
	"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3464
	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
  3465
	    aStream := source asFilename readStream.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3466
	].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3467
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3468
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3469
    ^ 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
  3470
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3471
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3472
     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
  3473
     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
  3474
     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
  3475
    "
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
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
    "Created: 10.11.1995 / 21:05:13 / 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
  3478
    "Modified: 7.12.1995 / 13:21:16 / 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
  3479
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3480
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3481
updateVersionMethodFor: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
  3482
    "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
  3483
     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
  3484
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3485
    |cls vs m mgr|
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3486
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
    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
  3488
    self isMeta ifFalse:[
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3489
	cls := self 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
  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
"/    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
  3492
"/    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
  3493
"/    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
  3494
"/    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
  3495
"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3496
"/    (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
  3497
"/    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
  3498
"/    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
  3499
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3500
    Class withoutUpdatingChangesDo:[
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3501
	Compiler compile:'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
  3502
    ^ ''' , 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
  3503
'
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
		 forClass:cls inCategory:#documentation notifying: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
  3505
		     install:true skipIfSame:false silent: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
  3506
    ].
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
"/ ('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
  3508
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
    ^ 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
  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: 7.12.1995 / 20:42:22 / 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
  3512
    "Modified: 7.12.1995 / 23:34:43 / 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
  3513
! !
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
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3515
!Class methodsFor:'subclass creation'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3516
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3517
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3518
    "create a new class as a subclass of an existing class (the receiver).
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3519
     The subclass will have indexed variables if the receiving-class has."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3520
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3521
    self isVariable ifFalse:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3522
	^ self class
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3523
	    name:t
897
b293763e7c62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
  3524
	    inEnvironment:(Smalltalk currentNameSpace)
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3525
	    subclassOf:self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3526
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3527
	    variable:false
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3528
	    words:true
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3529
	    pointers:true
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3530
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3531
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3532
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3533
	    comment:nil
906
1ff45713ce4e dont write change records when reading binary classes
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
  3534
	    changed:true 
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3535
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3536
    self isBytes ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3537
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3538
	    variableByteSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3539
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3540
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3541
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3542
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3543
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3544
    self isLongs ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3545
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3546
	    variableLongSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3547
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3548
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3549
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3550
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3551
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3552
    self isFloats ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3553
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3554
	    variableFloatSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3555
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3556
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3557
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3558
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3559
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3560
    self isDoubles ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3561
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3562
	    variableDoubleSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3563
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3564
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3565
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3566
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3567
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3568
    self isWords ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3569
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3570
	    variableWordSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3571
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3572
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3573
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3574
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3575
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3576
    ^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3577
	variableSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3578
	instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3579
	classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3580
	poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3581
	category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3582
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3583
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3584
variableByteSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3585
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3586
     in which the subclass has indexable byte-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3587
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3588
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3589
	self isBytes ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3590
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3591
		'cannot make a variable byte subclass of a variable non-byte class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3592
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3593
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3594
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3595
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3596
	name:t
897
b293763e7c62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
  3597
	inEnvironment:(Smalltalk currentNameSpace)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3598
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3599
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3600
	variable:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3601
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3602
	pointers:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3603
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3604
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3605
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3606
	comment:nil
906
1ff45713ce4e dont write change records when reading binary classes
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
  3607
	changed:true 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3608
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3609
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3610
variableDoubleSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3611
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3612
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3613
     in which the subclass has indexable double-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3614
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3615
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3616
	self isDoubles ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3617
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3618
		'cannot make a variable double subclass of a variable non-double class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3619
	].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3620
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3621
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3622
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3623
	name:t
897
b293763e7c62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
  3624
	inEnvironment:(Smalltalk currentNameSpace)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3625
	subclassOf:self
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3626
	instanceVariableNames:f
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3627
	variable:#double 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3628
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3629
	pointers:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3630
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3631
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3632
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3633
	comment:nil
906
1ff45713ce4e dont write change records when reading binary classes
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
  3634
	changed:true 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3635
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3636
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3637
variableFloatSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3638
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3639
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3640
     in which the subclass has indexable float-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3641
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3642
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3643
	self isFloats ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3644
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3645
		'cannot make a variable float subclass of a variable non-float class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3646
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3647
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3648
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3649
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3650
	name:t
897
b293763e7c62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
  3651
	inEnvironment:(Smalltalk currentNameSpace)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3652
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3653
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3654
	variable:#float 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3655
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3656
	pointers:false
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3657
	classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3658
	poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3659
	category:cat
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3660
	comment:nil
906
1ff45713ce4e dont write change records when reading binary classes
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
  3661
	changed:true 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3662
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3663
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3664
variableLongSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3665
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3666
     in which the subclass has indexable long-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3667
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3668
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3669
	self isLongs ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3670
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3671
		'cannot make a variable long subclass of a variable non-long class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3672
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3673
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3674
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3675
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3676
	name:t
897
b293763e7c62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
  3677
	inEnvironment:(Smalltalk currentNameSpace)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3678
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3679
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3680
	variable:#long 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3681
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3682
	pointers:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3683
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3684
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3685
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3686
	comment:nil
906
1ff45713ce4e dont write change records when reading binary classes
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
  3687
	changed:true 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3688
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3689
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3690
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3691
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3692
     in which the subclass has indexable pointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3693
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3694
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3695
	self isPointers ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3696
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3697
		'cannot make a variable pointer subclass of a variable non-pointer class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3698
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3699
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3700
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3701
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3702
	name:t
897
b293763e7c62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
  3703
	inEnvironment:(Smalltalk currentNameSpace)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3704
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3705
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3706
	variable:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3707
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3708
	pointers:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3709
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3710
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3711
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3712
	comment:nil
906
1ff45713ce4e dont write change records when reading binary classes
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
  3713
	changed:true 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3714
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3715
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3716
variableWordSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3717
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3718
     in which the subclass has indexable word-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3719
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3720
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3721
	self isWords ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3722
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3723
		'cannot make a variable word subclass of a variable non-word class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3724
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3725
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3726
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3727
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3728
	name:t
897
b293763e7c62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
  3729
	inEnvironment:(Smalltalk currentNameSpace)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3730
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3731
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3732
	variable:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3733
	words:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3734
	pointers:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3735
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3736
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3737
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3738
	comment:nil
906
1ff45713ce4e dont write change records when reading binary classes
Claus Gittinger <cg@exept.de>
parents: 902
diff changeset
  3739
	changed:true 
2
claus
parents: 1
diff changeset
  3740
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3741
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3742
!Class class methodsFor:'documentation'!
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3743
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3744
version
934
1d07586a2283 dont fail when storing binary methods which cannot be compiled to bytecode
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
  3745
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.132 1996-02-05 00:46:37 cg Exp $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  3746
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3747
Class initialize!