Class.st
author Claus Gittinger <cg@exept.de>
Wed, 30 Oct 1996 00:37:41 +0100
changeset 1843 15df4adc5b70
parent 1824 71889773b28b
child 1846 b7042a82eee6
permissions -rw-r--r--
some methods are compiled for space
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
1714
35b39ee74145 moved subclass creation methods up to ClassDescription
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
    14
	instanceVariableNames:'classvars comment subclasses classFilename package revision hook'
741
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    15
	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
    16
		CatchMethodRedefinitions MethodRedefinitionSignal
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
    17
		UpdateChangeFileQuerySignal TryLocalSourceFirst
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
    18
		ChangeFileAccessLock NameSpaceQuerySignal'
741
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    19
	poolDictionaries:''
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    20
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    21
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    23
!Class class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    24
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    25
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    26
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    27
 COPYRIGHT (c) 1989 by Claus Gittinger
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    28
	       All Rights Reserved
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    29
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    30
 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
    31
 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
    32
 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
    33
 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
    34
 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
    35
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    36
"
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
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    39
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    40
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    41
    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
    42
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    43
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    44
    Also change management and recompilation is defined here (since the superclasses
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    45
    do not have enough symbolic information to support compilation).
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    46
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    47
    [Instance variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    48
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    49
        classvars       <String>        the names of the class variables
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    50
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    51
        comment         <String>        the classes comment; either a string,
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    52
                                        a number specifying the offset in classFilename, or nil
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    53
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    54
        subclasses      <Collection>    cached collection of subclasses
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    55
                                        (currently unused - but will be soon)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    56
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    57
        classFilename   <String>        the file (or nil) where the classes
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    58
                                        sources are found 
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    59
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    60
        package         <Symbol>        the package, in which the class was defined
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    61
                                        (inserted by compilers)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    62
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    63
        revision        <String>        revision string - inserted by stc
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    64
1711
3bea87e918cd nope - privateClasses was no good idea;
Claus Gittinger <cg@exept.de>
parents: 1709
diff changeset
    65
        hook            <any>           reserved: a place to add additional attributes,
1807
202f0af2c2e1 commentary
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
    66
                                        without a need to recompile all classes.
202f0af2c2e1 commentary
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
    67
                                        Currently unused.
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    68
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    69
    [Class variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    70
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    71
        UpdatingChanges <Boolean>       true if the changes-file shall be updated
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    72
                                        (except during startup and when filing in, this flag
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    73
                                         is usually true)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    74
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    75
        LockChangesFile <Boolean>       if true, the change file is locked for updates.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    76
                                        Required when multiple users operate on a common
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    77
                                        change file.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    78
                                        This is an experimental new feature, being evaluated.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    79
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    80
        UpdateChangeFileQuerySignal     used as an upQuery from the change management.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    81
                                        Whenever a changeRecord is to be written,
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    82
                                        this signal is raised and a handler (if present)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    83
                                        is supposed to return true or false.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    84
                                        If unhandled, the value of the global
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    85
                                        UpdatingChanges is returned for backward
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    86
                                        compatibility (which means that the old
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    87
                                        mechanism is used if no query-handler
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    88
                                        is present).
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    89
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    90
        FileOutErrorSignal              raised when an error occurs during fileOut
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    91
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    92
        CatchMethodRedefinitions        if true, classes protect themself 
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    93
        MethodRedefinitionSignal        (by raising MethodRedefinitionSignal)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    94
                                        from redefining any existing methods,
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    95
                                        which are defined in another package.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    96
                                        (i.e. a signal will be raised, if you
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    97
                                         fileIn something which redefines an
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    98
                                         existing method and the packages do not
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    99
                                         match).
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   100
                                        The default is (currently) true.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   101
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   102
        TryLocalSourceFirst             If true, local source files are tried
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   103
                                        first BEFORE the sourceCodeManager is
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   104
                                        consulted. If false, the sourceCodeManager
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   105
                                        is asked first.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   106
                                        Should be turned on, if you run an image from
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   107
                                        local sources which have not yet been checked in.
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   108
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
   109
                                        
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   110
    WARNING: layout known by compiler and runtime system
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   111
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   112
    [author:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   113
        Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   114
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   115
    [see also:]
1807
202f0af2c2e1 commentary
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
   116
        Behavior ClassDescription Metaclass
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   117
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   118
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   119
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   120
!Class class methodsFor:'initialization'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   121
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   122
initialize
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   123
    "the classvariable 'UpdatingChanges' controls if changes are put
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   124
     into the changes-file; normally this variable is set to true, but
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   125
     (for example) during fileIn or when changes are applied, it is set to false
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   126
     to avoid putting too much junk into the changes-file."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   127
     
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   128
    UpdatingChanges := true.
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
   129
    LockChangesFile := false.
362
claus
parents: 360
diff changeset
   130
    CatchMethodRedefinitions := true.
909
e20934aa134e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   131
    TryLocalSourceFirst := false.
362
claus
parents: 360
diff changeset
   132
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   133
    FileOutErrorSignal isNil ifTrue:[
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   134
        FileOutErrorSignal := ErrorSignal newSignalMayProceed:false.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   135
        FileOutErrorSignal nameClass:self message:#fileOutErrorSignal.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   136
        FileOutErrorSignal notifierString:'error during fileOut'.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   137
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   138
        MethodRedefinitionSignal := ErrorSignal newSignalMayProceed:true.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   139
        MethodRedefinitionSignal nameClass:self message:#methodRedefinitionSignal.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   140
        MethodRedefinitionSignal notifierString:'attempt to redefine method from different package'.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   141
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   142
        UpdateChangeFileQuerySignal := QuerySignal new mayProceed:true.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   143
        UpdateChangeFileQuerySignal nameClass:self message:#updateChangeFileQuerySignal.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   144
        UpdateChangeFileQuerySignal notifierString:'asking if changeFile update is wanted'.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   145
        UpdateChangeFileQuerySignal handlerBlock:[:ex | ex proceedWith:UpdatingChanges].
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   146
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   147
        NameSpaceQuerySignal := QuerySignal new mayProceed:true.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   148
        NameSpaceQuerySignal nameClass:self message:#updateChangeFileQuerySignal.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   149
        NameSpaceQuerySignal notifierString:'asking for nameSpace'.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   150
        NameSpaceQuerySignal handlerBlock:[:ex | ex proceedWith:Smalltalk currentNameSpace].
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   151
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   152
        ChangeFileAccessLock := Semaphore forMutualExclusion.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   153
    ]
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   154
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   155
    "Modified: 14.10.1996 / 21:00:34 / cg"
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   156
! !
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   157
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   158
!Class class methodsFor:'Signal constants'!
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   159
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   160
fileOutErrorSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   161
    "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
   162
     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
   163
     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
   164
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   165
    ^ FileOutErrorSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   166
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   167
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   168
methodRedefinitionSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   169
    "return the signal raised when a method is about to be installed
362
claus
parents: 360
diff changeset
   170
     which redefines an existing method and the methods packages are not
claus
parents: 360
diff changeset
   171
     equal. This helps when filing in alien code, to prevent existing
claus
parents: 360
diff changeset
   172
     methods to be overwritten or redefined by incompatible methods"
claus
parents: 360
diff changeset
   173
claus
parents: 360
diff changeset
   174
    ^ MethodRedefinitionSignal
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   175
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   176
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   177
nameSpaceQuerySignal
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   178
    "return the signal used as an upQuery for the current nameSpace.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   179
     Will be used when filing in code"
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   180
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   181
    ^ NameSpaceQuerySignal
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   182
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   183
    "
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   184
     Class nameSpaceQuerySignal raise
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   185
    "
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   186
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   187
    "Modified: 14.10.1996 / 21:01:30 / cg"
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   188
!
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   189
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   190
updateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   191
    "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
   192
     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
   193
     static handler."
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
    ^ UpdateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   196
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   197
    "
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   198
     Class updateChangeFileQuerySignal raise
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   199
    "
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   200
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   201
    "Modified: 14.10.1996 / 21:01:43 / cg"
362
claus
parents: 360
diff changeset
   202
! !
claus
parents: 360
diff changeset
   203
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   204
!Class class methodsFor:'accessing - flags'!
362
claus
parents: 360
diff changeset
   205
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   206
catchMethodRedefinitions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   207
    "return the redefinition catching flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   208
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   209
    ^ CatchMethodRedefinitions
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   210
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   211
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   212
catchMethodRedefinitions:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   213
    "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
   214
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   215
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   216
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   217
    prev := CatchMethodRedefinitions.
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   218
    CatchMethodRedefinitions := aBoolean.
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   219
    ^ prev
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   220
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   221
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   222
lockChangesFile
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   223
    "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
   224
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   225
    ^ LockChangesFile
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   226
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   227
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   228
lockChangesFile:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   229
    "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
   230
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   231
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   232
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   233
    prev := LockChangesFile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   234
    LockChangesFile := aBoolean.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   235
    ^ prev
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   236
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   237
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   238
tryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   239
    ^ TryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   240
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   241
    "Created: 24.1.1996 / 19:55:35 / cg"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   242
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   243
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   244
tryLocalSourceFirst:aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   245
    TryLocalSourceFirst := aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   246
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   247
    "Created: 24.1.1996 / 19:55:35 / cg"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   248
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   249
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   250
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   251
    "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
   252
     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
   253
     decide to return something else."
362
claus
parents: 360
diff changeset
   254
claus
parents: 360
diff changeset
   255
    |prev|
claus
parents: 360
diff changeset
   256
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   257
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   258
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   259
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   260
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   261
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   262
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   263
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   264
     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
   265
     decide to return something else."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   266
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   267
    ^ UpdatingChanges
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   268
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   269
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   270
!Class class methodsFor:'enumeration '!
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   271
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   272
allClassesInCategory:aCategory do:aBlock
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   273
    "evaluate aBlock for all classes in aCategory;
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   274
     no specific order is defined."
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   275
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
   276
    Smalltalk allBehaviorsDo:[:aClass |
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   277
	aClass isMeta ifFalse:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   278
	    (aClass category = aCategory) ifTrue:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   279
		aBlock value:aClass
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   280
	    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   281
	].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   282
    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   283
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   284
    "
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   285
     Class allClassesInCategory:'Kernel-Classes' 
1422
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
   286
			     do:[:class |Transcript showCR:class name]
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   287
    "
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   288
!
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   289
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   290
allClassesInCategory:aCategory inOrderDo:aBlock
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   291
    "evaluate aBlock for all classes in aCategory;
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   292
     superclasses come first - then subclasses."
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   293
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   294
    |classes|
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   295
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   296
    classes := OrderedCollection new.
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
   297
    Smalltalk allBehaviorsDo:[:aClass |
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   298
	aClass isMeta ifFalse:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   299
	    (aClass category = aCategory) ifTrue:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   300
		classes add:aClass
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   301
	    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   302
	]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   303
    ].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   304
    classes topologicalSort:[:a :b | b isSubclassOf:a].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   305
    classes do:aBlock
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   306
! !
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   307
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   308
!Class class methodsFor:'helpers'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   309
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   310
revisionInfoFromString:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   311
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   312
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   313
    "return a dictionary filled with revision info.
740
b647ebdc25ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   314
     This extracts the relevant info from aString.
b647ebdc25ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   315
     For now, this is a bad design - should always ask the
b647ebdc25ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   316
     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
   317
     here is a bad design ...)"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   318
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   319
    |words info nm mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   320
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   321
    info := IdentityDictionary new.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   322
    words := aString asCollectionOfWords.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   323
744
db7b733455b9 dont crash with bad revision strings (again)
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   324
    words notEmpty ifTrue:[
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   325
	"/
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   326
	"/ supported formats:
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   327
	"/
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   328
	"/ $-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
   329
	"/ $-Revision: rev $
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   330
	"/ $-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
   331
	"/
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   332
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   333
	((words at:1) = '$Header:') ifTrue:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   334
	    nm := words at:2.
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   335
	    info at:#repositoryPathName put:nm.
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   336
	    (nm endsWith:',v') ifTrue:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   337
		nm := nm copyWithoutLast:2
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   338
	    ].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   339
	    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
   340
	    (words at:3) = '$' ifFalse:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   341
		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
   342
		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
   343
		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
   344
		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
   345
		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
   346
	    ].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   347
	    ^ info
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   348
	].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   349
	((words at:1) = '$Revision:') ifTrue:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   350
	    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
   351
	    ^ info
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   352
	].
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   353
	((words at:1) = '$Id:') ifTrue:[
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   354
	    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
   355
	    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
   356
	    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
   357
	    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
   358
	    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
   359
	    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
   360
	    ^ info
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   361
	].
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   362
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   363
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   364
    "/
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   365
    "/ mhmh - maybe its some other source code system
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   366
    "/
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   367
    (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
   368
	^ mgr revisionInfoFromString:aString
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   369
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   370
    ^ nil
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   371
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   372
    "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
   373
    "Modified: 13.12.1995 / 17:11:28 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   374
!
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   375
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   376
revisionStringFromSource:aMethodSourceString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   377
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   378
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   379
    "extract a revision string from a methods source string"
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   380
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   381
    |lines line|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   382
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   383
    lines := aMethodSourceString asCollectionOfLines.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   384
    lines do:[:l |
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   385
        |i|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   386
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   387
        i := l indexOfSubCollection:'$Header: '.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   388
        i ~~ 0 ifTrue:[
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   389
            line := l copyFrom:i.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   390
            i := line lastIndexOf:$$.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   391
            i > 1 ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   392
                line := line copyTo:i.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   393
            ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   394
            ^ line
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   395
        ]
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   396
    ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   397
    ^ nil
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   398
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   399
    "Created: 15.10.1996 / 18:57:57 / cg"
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   400
    "Modified: 16.10.1996 / 16:54:40 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   401
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   402
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   403
!Class class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   404
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   405
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   406
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   407
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   408
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   409
    ^ self == Class class or:[self == Class]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   410
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   411
    "Created: 15.4.1996 / 17:17:13 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   412
    "Modified: 23.4.1996 / 15:56:58 / cg"
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   413
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   414
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   415
!Class methodsFor:'ST/V subclass creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   416
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   417
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   418
    "this method allows fileIn of ST/V classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   419
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   420
a27a279701f8 Initial revision
claus
parents:
diff changeset
   421
    ^ self subclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   422
	   instanceVariableNames:f
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   423
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   424
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   425
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   426
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   427
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   428
variableByteSubclass:t classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   429
    "this method allows fileIn of ST/V variable byte classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   430
     (which seem to have no category and no instvars)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   431
a27a279701f8 Initial revision
claus
parents:
diff changeset
   432
    ^ self variableByteSubclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   433
	   instanceVariableNames:''
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   434
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   435
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   436
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   437
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   438
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   439
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   440
    "this method allows fileIn of ST/V variable pointer classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   441
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   442
a27a279701f8 Initial revision
claus
parents:
diff changeset
   443
    ^ self variableSubclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   444
	   instanceVariableNames:f
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   445
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   446
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   447
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   448
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   449
a27a279701f8 Initial revision
claus
parents:
diff changeset
   450
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   451
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   452
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   453
    "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
   454
     Also writes a change record and notifies dependents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   455
     BUG: Currently, no recompilation is done - this will change."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   456
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   457
    (self classVarNames includes:aString) ifFalse:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   458
	self classVariableString:(self classVariableString , ' ' , aString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   459
	self addChangeRecordForClass:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   460
	self changed:#definition.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   461
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   462
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   463
    "Created: 29.10.1995 / 19:40:51 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   464
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   465
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   466
classFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   467
    "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
   468
     This is currently NOT used."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   469
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   470
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   471
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   472
    (owner := self owningClass) notNil ifTrue:[^ owner classFilename].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   473
    ^ classFilename
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   474
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   475
    "Modified: 15.10.1996 / 18:53:21 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   476
!
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
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   479
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   480
     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
   481
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   482
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   483
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   484
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   485
     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
   486
     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
   487
     no classPools yet.
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
    ^ Smalltalk at:(self name , ':' , aSymbol) asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   490
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   491
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   492
classVarAt:aSymbol put:something
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   493
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   494
     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
   495
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   496
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   497
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   498
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   499
     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
   500
     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
   501
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   502
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   503
    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
   504
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   505
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   506
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   507
    "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
   508
     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
   509
     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
   510
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   511
    classvars isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   512
	^ OrderedCollection new
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   513
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   514
    ^ classvars asCollectionOfWords
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
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   517
     Object classVarNames 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   518
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   519
    "
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   522
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   523
    "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
   524
     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
   525
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   526
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   527
    classvars isNil ifTrue:[^ ''].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   528
    ^ classvars
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   529
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   530
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   531
     Object classVariableString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   532
     Float classVariableString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   533
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   534
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   535
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   536
classVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   537
    "set the classes classvarnames string; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   538
     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
   539
     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
   540
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   541
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   542
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   543
    "ignore for metaclasses except the one"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   544
    (self isMeta) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   545
	(self == Metaclass) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   546
	    ^ self
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   547
	]
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   548
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   549
    (classvars = aString) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   550
	prevVarNames := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   551
	classvars := aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   552
	varNames := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   553
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   554
	"new ones get initialized to nil;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   555
	 - 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
   556
	any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   558
	varNames do:[:aName |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   559
	    (prevVarNames includes:aName) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   560
		"a new one"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   561
		self classVarAt:aName put:nil.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   562
		any := true.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   563
	    ] ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   564
		prevVarNames remove:aName
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   565
	    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   566
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   567
	"left overs are gone"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   568
	prevVarNames do:[:aName |
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   569
	    self classVarAt:aName put:nil.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   570
	    Smalltalk removeKey:(self name , ':' , aName) asSymbol.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   571
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   572
	any ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   573
	    Smalltalk changed:#classVariables with:self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   574
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   575
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   576
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   577
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   578
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   579
    "return the comment (aString) of the class"
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
    |stream string|
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
    "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
   584
     position within the classes sourcefile ...
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
    comment isNumber ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   587
	classFilename notNil ifTrue:[
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   588
	    stream := self sourceStream. 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   589
	    stream notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   590
		stream position:comment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   591
		string := String readFrom:stream onError:''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   592
		stream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   593
		^ string
887
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   594
	    ].
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   595
	    ^ nil
557
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
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   599
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   600
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   601
     Object comment 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   602
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   603
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   604
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   605
comment:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   606
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   607
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   608
    "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
   609
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   610
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   611
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   612
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   613
    newComment := aString.
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   614
    (aString notNil and:[aString isEmpty]) ifTrue:[
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   615
	newComment := nil
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   616
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   617
    comment ~= newComment ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   618
	oldComment := self comment.
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   619
	comment := newComment.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   620
	self changed:#comment with:oldComment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   621
	self addChangeRecordForClassComment:self.
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
definition
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   626
    "return an expression-string to define myself"
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
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   629
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   630
    s := WriteStream on:(String new).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   631
    self fileOutDefinitionOn:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   632
    ^ s contents
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   633
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   634
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   635
     Object definition 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   636
     Point definition  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   637
    "
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
package
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   641
    "return the package of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   642
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   643
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   644
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   645
    (owner := self owningClass) notNil ifTrue:[^ owner package].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   646
    ^ package
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   647
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
     Object package  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   650
    "
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   651
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   652
    "Modified: 15.10.1996 / 18:53:36 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   653
!
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
package:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   656
    "set the package of the class."
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
    package := aStringOrSymbol
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
primitiveDefinitions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   662
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   663
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   664
    "set the primitiveDefinition string"
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
    self setPrimitiveSpecsAt:1 to:aString.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   667
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   668
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   669
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   670
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   671
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   672
primitiveDefinitionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   673
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   674
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   675
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   676
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   677
    ^ self getPrimitiveSpecsAt:1
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   678
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   679
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   680
     Object primitiveDefinitionsString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   681
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   682
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   683
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   684
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   685
primitiveFunctions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   686
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   687
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   688
    "set the primitiveFunction string"
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
    self setPrimitiveSpecsAt:3 to:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   691
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   692
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   693
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   694
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   695
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   696
primitiveFunctionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   697
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   698
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   699
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   700
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   701
    ^ self getPrimitiveSpecsAt:3 
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
primitiveSpec
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   705
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   706
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   707
    "return the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   708
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   709
    ^  primitiveSpec
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   710
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   711
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   712
primitiveSpec:anArrayOf3ElementsOrNil
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   713
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   714
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   715
    "set the primitiveSpec or nil"
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
    primitiveSpec := anArrayOf3ElementsOrNil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   718
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   719
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   720
primitiveVariables:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   721
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   722
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   723
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   724
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   725
    self setPrimitiveSpecsAt:2 to:aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   726
    self addChangeRecordForPrimitiveVariables:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   727
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   728
    "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
   729
!
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
primitiveVariablesString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   732
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   733
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   734
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   735
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   736
    ^ self getPrimitiveSpecsAt:2 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   737
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   738
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   739
privateClasses
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   740
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   741
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   742
    "return a collection of my private classes (if any); nil otherwise"
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   743
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   744
    |classes myName|
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   745
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   746
    classes := IdentitySet new.
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   747
    myName := self name.
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   748
    Smalltalk keysAndValuesDo:[:aName :aValue|
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   749
        (aName startsWith:(myName , '::')) ifTrue:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   750
            "/ care for private-privateClasses
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   751
            (aName indexOf:$: startingAt:myName size + 3) == 0 ifTrue:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   752
                classes add:aValue.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   753
            ]
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   754
        ]
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   755
    ].
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   756
    classes size == 0 ifTrue:[
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   757
        ^ nil
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   758
    ].
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   759
    ^ classes
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   760
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   761
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   762
     Object privateClasses
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   763
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   764
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   765
    "Modified: 15.10.1996 / 11:08:01 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   766
!
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   767
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   768
privateClassesAt:aClassNameSymbol
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   769
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   770
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   771
    "return a private class if present; nil otherwise"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   772
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   773
    |class|
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   774
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   775
    class := self classVarAt:(':' , aClassNameSymbol) asSymbol.
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   776
    ^ class
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   777
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   778
    "Created: 11.10.1996 / 19:05:39 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   779
    "Modified: 14.10.1996 / 17:23:30 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   780
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   781
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   782
privateClassesAt:aClassNameSymbol put:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   783
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   784
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   785
    "return a private class if present"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   786
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   787
    self classVarAt:(':' , aClassNameSymbol) asSymbol put:aClass
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   788
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   789
    "Created: 11.10.1996 / 17:53:06 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   790
    "Modified: 14.10.1996 / 17:23:36 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   791
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   792
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   793
removeClassVarName:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   794
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   795
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   796
    "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
   797
     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
   798
     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
   799
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   800
    |names newNames|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   801
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   802
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   803
    (names includes:aString) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   804
	newNames := ''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   805
	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
   806
	self classVariableString:newNames withoutSpaces.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   807
	self addChangeRecordForClass:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   808
	self changed:#definition.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   809
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   810
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   811
    "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
   812
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   813
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   814
renameCategory:oldCategory to:newCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   815
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   816
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   817
    "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
   818
     Appends a change record and notifies dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   819
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   820
    |any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   821
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   822
    any := false.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
   823
    self methodDictionary do:[:aMethod |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
   824
        aMethod category = oldCategory ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
   825
            aMethod category:newCategory.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
   826
            any := true.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
   827
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   828
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   829
    any ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
   830
        self addChangeRecordForRenameCategory:oldCategory to:newCategory.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
   831
        self changed:#methodCategory.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   832
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   833
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   834
    "Created: 29.10.1995 / 19:42:15 / cg"
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
   835
    "Modified: 12.6.1996 / 11:49:08 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   836
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   837
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   838
setClassFilename:aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   839
    "set the classes filename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   840
     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
   841
     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
   842
     is set here."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   843
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   844
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   845
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   846
    "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
   847
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   848
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   849
setClassVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   850
    "set the classes classvarnames string. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   851
     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
   852
     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
   853
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   854
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   855
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   856
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   857
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   858
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   859
    "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
   860
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   861
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   862
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   863
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   864
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   865
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   866
    "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
   867
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   868
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   869
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   870
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   871
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   872
    categoryStringOrSymbol isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   873
	cat := ''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   874
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   875
	cat := categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   876
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   877
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   878
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   879
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   880
setPackage:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   881
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   882
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   883
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   884
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   885
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   886
sharedPools
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   887
    "ST/X does not (currently) support pools"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   888
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   889
    ^ #()
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   890
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   891
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   892
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   893
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   894
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   895
    |code aStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   896
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   897
" this is too slow for big classes ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   898
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   899
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   900
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   901
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   902
    aStream := FileStream newFileNamed:'__temp'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   903
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   904
	self notify:'cannot create temporary file.'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   905
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   906
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   907
    FileOutErrorSignal handle:[:ex |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   908
	aStream nextPutAll:'"no source available"'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   909
    ] do:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   910
	self fileOutOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   911
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   912
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   913
    aStream := FileStream oldFileNamed:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   914
    aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   915
	self notify:'oops - cannot reopen temp file'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   916
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   917
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   918
    code := aStream contents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   919
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   920
    OperatingSystem removeFile:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   921
    ^ code
385
claus
parents: 384
diff changeset
   922
!
claus
parents: 384
diff changeset
   923
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   924
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   925
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   926
     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
   927
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   928
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   929
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   930
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   931
    (owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager].
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   932
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   933
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   934
    "Created: 7.12.1995 / 13:16:46 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   935
    "Modified: 15.10.1996 / 18:54:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   936
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   937
a27a279701f8 Initial revision
claus
parents:
diff changeset
   938
!Class methodsFor:'adding/removing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   939
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   940
addSelector:newSelector withMethod:newMethod
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   941
    "add the method given by 2nd argument under the selector given by
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   942
     1st argument to the methodDictionary. 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   943
     Append a change record to the changes file and tell dependents."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   944
362
claus
parents: 360
diff changeset
   945
    |oldMethod|
claus
parents: 360
diff changeset
   946
claus
parents: 360
diff changeset
   947
    CatchMethodRedefinitions ifTrue:[
1651
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   948
        "check for attempts to redefine a method
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   949
         in a different package. Signal a resumable error if so.
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   950
         This allows tracing redefinitions of existing system methods
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   951
         when filing in alien code ....
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   952
         (which we may want to forbit sometimes)
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   953
        "
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   954
        oldMethod := self compiledMethodAt:newSelector.
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   955
        oldMethod notNil ifTrue:[
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   956
            oldMethod package ~= newMethod package ifTrue:[
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   957
                "
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   958
                 attempt to redefine an existing method, which was
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   959
                 defined in another package.
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   960
                 If you continue in the debugger, the new method gets installed.
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   961
                 Otherwise, the existing (old) method remains valid.
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   962
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   963
                 You can turn of the catching of redefinitions by setting
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   964
                   CatchMethodRedefinitions to false
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   965
                 (also found in the Launchers 'settings-misc' menu)
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   966
                "
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   967
                MethodRedefinitionSignal 
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   968
                    raiseErrorString:('redefinition of ' , name , '>>' , newSelector) 
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   969
            ]
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   970
        ]
362
claus
parents: 360
diff changeset
   971
    ].
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   972
    (super addSelector:newSelector withMethod:newMethod) ifTrue:[
1651
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   973
        self addChangeRecordForMethod:newMethod.
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   974
    ]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   975
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   976
    "Created: 29.10.1995 / 19:42:42 / cg"
1651
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
   977
    "Modified: 9.9.1996 / 22:39:32 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   978
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   979
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   980
removeSelector:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   981
    "remove the selector, aSelector and its associated method 
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   982
     from the methodDictionary.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   983
     Append a change record to the changes file and tell dependents."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   984
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
   985
    (super removeSelector:aSelector) ifTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   986
	self addChangeRecordForRemoveSelector:aSelector.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   987
	self changed:#methodDictionary with:aSelector.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   988
    ]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   989
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   990
    "Created: 29.10.1995 / 19:42:47 / cg"
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   991
!
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   992
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   993
unload
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   994
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   995
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   996
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
   997
     autoloaded. Can be used to get rid of no longer needed autoloaded
328
claus
parents: 326
diff changeset
   998
     classes. 
claus
parents: 326
diff changeset
   999
     (maybe, autoloaded classes should unload themselfes when no
claus
parents: 326
diff changeset
  1000
      longer needed - for example, after some delay when the last instance 
claus
parents: 326
diff changeset
  1001
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1002
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1003
    |nm|
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1004
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1005
    self wasAutoloaded ifFalse:[
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1006
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1007
        "
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1008
         can it be done ?
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1009
        "
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1010
        self methodDictionary do:[:aMethod |
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1011
            aMethod source isNil ifTrue:[^false].
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1012
            aMethod hasPrimitiveCode ifTrue:[^ false].
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1013
        ].
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1014
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1015
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1016
    self allSubclassesDo:[:aClass |
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1017
        aClass unload
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1018
    ].
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1019
    Transcript showCR:'unloading ' , name , ' ...'.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1020
359
claus
parents: 357
diff changeset
  1021
    Autoload removeClass:self.    
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1022
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1023
    Smalltalk at:nm put:nil.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1024
"/    name := (nm , ' (leftover)') asSymbol.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1025
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1026
    ObjectMemory flushMethodCache.
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1027
    Autoload addClass:nm inCategory:category.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1028
"/  category := #unloaded.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1029
    Smalltalk flushCachedClasses.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1030
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1031
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1032
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1033
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1034
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1035
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1036
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1037
    "
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1038
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1039
    "Modified: 18.5.1996 / 15:41:49 / cg"
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1040
    "Modified: 7.6.1996 / 09:15:05 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1041
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1042
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1043
!Class methodsFor:'binary storage'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1044
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1045
addGlobalsTo: globalDictionary manager: manager
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1046
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1047
    classPool == nil ifFalse: [
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1048
	classPool associationsDo: [:assoc|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1049
	    globalDictionary at: assoc put: self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1050
	]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1051
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1052
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1053
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1054
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1055
binaryClassDefinitionFrom:stream manager:manager
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1056
    "retrieve a class as stored previously with
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1057
     #storeBinaryClassOn:manager:
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1058
     The namespace, where the class is to be installed is queries via the
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1059
     NameSpaceQuerySignal - it should answer with nil, to suppress installation."
1699
42a53290bd5d allow for a class to be loaded into another environment
Claus Gittinger <cg@exept.de>
parents: 1687
diff changeset
  1060
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1061
    |superclassName name flags instvars classvars category classInstVars
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1062
     comment package superclassSig rev
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1063
     newClass superClass methods cmethods formatID environment
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1064
     ownerName owner nPrivate privateClass cls|
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1065
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1066
    "/ the following order must correlate to
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1067
    "/ the storing in #storeBinaryClassOn:manager:
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1068
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1069
    "/ retrieve
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1070
    "/   formatID
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1071
    "/   superclasses name,
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1072
    "/   superclasses signature
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1073
    "/   name,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1074
    "/   typeSymbol,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1075
    "/   instVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1076
    "/   classVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1077
    "/   category
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1078
    "/   classInstVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1079
    "/   comment
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1080
    "/   revision
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1081
    "/   package
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1082
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1083
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1084
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1085
    "/   number of private classes
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1086
    "/   private classes, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1087
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1088
    formatID := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1089
    formatID isInteger ifFalse:[       "/ backward compatibilty
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1090
        formatID := nil.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1091
        superclassName := formatID
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1092
    ] ifTrue:[
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1093
        superclassName := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1094
    ].
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1095
    superclassSig := manager nextObject.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1096
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1097
    superclassName notNil ifTrue:[
1439
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1098
        superClass := Smalltalk at:superclassName ifAbsent:nil.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1099
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1100
        superClass isNil ifTrue:[
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1101
            BinaryIOManager nonexistingClassSignal
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1102
                raiseRequestWith:'non existent superclass (in binaryLoad)'.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1103
            ^ nil
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1104
        ].
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1105
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1106
        "/ ('loading superclass: ' ,  superclassName ) printNL.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1107
        superClass autoload.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1108
        superClass := Smalltalk at:superclassName.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1109
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1110
        superclassSig ~= superClass signature ifTrue:[
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1111
            BinaryIOManager changedInstLayoutSignal
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1112
                raiseRequestWith:'incompatible superclass (in binaryLoad)'.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1113
            ^ nil
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1114
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1115
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1116
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1117
    name := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1118
    flags := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1119
    instvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1120
    instvars isNil ifTrue:[instvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1121
    classvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1122
    classvars isNil ifTrue:[classvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1123
    category := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1124
    classInstVars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1125
    classInstVars isNil ifTrue:[classInstVars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1126
    comment := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1127
    package := manager nextObject.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1128
    formatID == 1 ifTrue:[
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1129
        rev := manager nextObject.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1130
        ownerName := manager nextObject.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1131
        ownerName notNil ifTrue:[
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1132
            name := name copyFrom:(ownerName size + 2 + 1).
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1133
            owner := Smalltalk at:ownerName.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1134
        ]
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1135
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1136
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1137
"/    'got superName:' print. superclassName printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1138
"/    'got name:' print. name printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1139
"/    'got flags: ' print. flags printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1140
"/    'got instvars: ' print. instvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1141
"/    'got classvars: ' print. classvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1142
"/    'got category: ' print. category printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1143
"/    'got classInstvars: ' print. classInstVars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1144
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1145
"/ ('create class: ' ,  name ) printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1146
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1147
    owner notNil ifTrue:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1148
        environment := owner
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1149
    ] ifFalse:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1150
        environment := Class nameSpaceQuerySignal raise.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1151
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1152
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1153
    cls := superClass.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1154
    superClass isNil ifTrue:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1155
        cls := Object
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1156
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1157
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1158
    newClass := cls class
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1159
            name:name asSymbol
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1160
            in:environment
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1161
            subclassOf:cls
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1162
            instanceVariableNames:instvars
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1163
            variable:false
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1164
            words:false 
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1165
            pointers:true
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1166
            classVariableNames:classvars
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1167
            poolDictionaries:'' 
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1168
            category:category
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1169
            comment:comment 
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1170
            changed:false 
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1171
            classInstanceVariableNames:classInstVars.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1172
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1173
    newClass isNil ifTrue:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1174
        ^ nil.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1175
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1176
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1177
    superClass isNil ifTrue:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1178
        newClass setSuperclass:nil.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1179
        newClass class setSuperclass:Class.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1180
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1181
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1182
"/ Transcript showCR:'loaded ' , name , ' in ' , environment name.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1183
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1184
    newClass flags:flags.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1185
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1186
    "/ retrieve class methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1187
    cmethods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1188
    "/ retrieve inst methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1189
    methods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1190
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1191
    formatID == 1 ifTrue:[
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1192
        "/ privateClasses
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1193
        nPrivate := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1194
        nPrivate timesRepeat:[
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1195
            Class nameSpaceQuerySignal
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1196
                answer:newClass
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1197
                do:[
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1198
                    privateClass := manager nextObject
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1199
                ]
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1200
        ]
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1201
    ].
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1202
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1203
    (superClass isNil and:[superclassName notNil]) ifTrue:[^ nil].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1204
    newClass isNil ifTrue:[
1439
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1205
        ^ nil
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1206
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1207
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1208
    owner notNil ifTrue:[
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1209
        newClass category:nil.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1210
    ] ifFalse:[
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1211
        newClass package:package.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1212
    ].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1213
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1214
    newClass methodDictionary:methods.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1215
    newClass class methodDictionary:cmethods.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1216
    ^ newClass
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1217
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1218
    "Modified: 7.6.1996 / 13:43:06 / stefan"
1699
42a53290bd5d allow for a class to be loaded into another environment
Claus Gittinger <cg@exept.de>
parents: 1687
diff changeset
  1219
    "Created: 8.10.1996 / 17:57:02 / cg"
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1220
    "Modified: 22.10.1996 / 20:31:38 / cg"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1221
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1222
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1223
storeBinaryClassOn:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1224
    "store a classes complete description (i.e. including methods).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1225
     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
  1226
     be either present or autoloadable."
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1227
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1228
    |s sig owner privateClasses|
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1229
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1230
    stream nextPut: manager codeForClass.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1231
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1232
    "/ the following order must correlate to
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1233
    "/ the storing in #binaryDefinitionFrom:manager:
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1234
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1235
    "/ store
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1236
    "/   format ID
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1237
    "/   superclasses name
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1238
    "/   superclasses signature
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1239
    "/   name
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1240
    "/   typeSymbol,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1241
    "/   instVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1242
    "/   classVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1243
    "/   category
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1244
    "/   classInstVarNames
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1245
    "/   comment
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1246
    "/   package
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1247
    "/   revision
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1248
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1249
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1250
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1251
    "/   # of privateClass names
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1252
    "/   privateClasses, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1253
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1254
    1 storeBinaryOn:stream manager:manager.  "/ formatID
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1255
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1256
    owner := self owningClass.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1257
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1258
    superclass isNil ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1259
        s := nil.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1260
        sig := 0.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1261
    ] ifFalse:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1262
        s := superclass name.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1263
        sig := superclass signature.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1264
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1265
    s storeBinaryOn:stream manager:manager.
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1266
    sig storeBinaryOn:stream manager:manager.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1267
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1268
    name storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1269
    flags storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1270
    (instvars notNil and:[instvars isEmpty]) ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1271
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1272
    ] ifFalse:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1273
        s := instvars
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1274
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1275
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1276
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1277
    (classvars notNil and:[classvars isEmpty]) ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1278
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1279
    ] ifFalse:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1280
        s := classvars
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1281
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1282
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1283
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1284
    "/ the category
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1285
    owner notNil ifTrue:[
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1286
        nil storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1287
    ] ifFalse:[
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1288
        category storeBinaryOn:stream manager:manager.
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1289
    ].
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1290
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1291
    "/ the classInstVarString
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1292
    s := self class instanceVariableString.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1293
    (s notNil and:[s isEmpty]) ifTrue:[
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1294
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1295
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1296
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1297
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1298
    "/ the comment
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1299
    s := comment.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1300
    manager sourceMode == #discard ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1301
        s := nil
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1302
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1303
    s storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1304
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1305
    "/ the revision, package & owner
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1306
    owner notNil ifTrue:[
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1307
        nil storeBinaryOn:stream manager:manager.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1308
        nil storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1309
        owner name storeBinaryOn:stream manager:manager.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1310
    ] ifFalse:[
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1311
        package storeBinaryOn:stream manager:manager.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1312
        revision storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1313
        nil storeBinaryOn:stream manager:manager.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1314
    ].
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1315
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1316
    "/
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1317
    "/ store class method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1318
    "/ 
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1319
    self class methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1320
    "/ store inst method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1321
    self methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.    
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1322
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1323
    "/
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1324
    "/ names of private classes
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1325
    "/
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1326
    privateClasses := self privateClasses.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1327
    privateClasses size storeBinaryOn:stream manager:manager.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1328
    privateClasses size > 0 ifTrue:[
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1329
        privateClasses do:[:aClass |
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1330
            aClass storeBinaryClassOn:stream manager:manager
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1331
        ]
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1332
    ].
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1333
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1334
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1335
     |bos|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1336
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1337
     bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1338
     bos nextPutClasses:(Array with:FileBrowser).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1339
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1340
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1341
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1342
     |bos cls|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1343
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1344
     bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1345
     cls := bos next.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1346
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1347
     cls open.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1348
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1349
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1350
    "Modified: 7.6.1996 / 13:39:02 / stefan"
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1351
    "Modified: 15.10.1996 / 21:13:32 / cg"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1352
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1353
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1354
storeBinaryDefinitionOf: anAssociation on: stream manager: manager
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1355
    "not usable at the moment - there are no classpools currently"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1356
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1357
    | string |
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1358
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1359
    string := self name, ' classPool at: ', anAssociation key storeString.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1360
    stream nextNumber: 2 put: string size.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1361
    string do: [:char| stream nextPut: char asciiValue]
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1362
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1363
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1364
storeBinaryDefinitionOn: stream manager: manager
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1365
    "store the receiver in a binary format on stream.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1366
     This is an internal interface for binary storage mechanism.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1367
     classes only store the name, signature and instvar names.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1368
     They restore by looking for that name in the Smalltalk dictionary.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1369
     However, using the signature, a check for being valid is made at
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1370
     restore time.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1371
     This avoids a full recursive store of a class in the normal binary
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1372
     storage - however, it also means that a classes semantics cannot
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1373
     be stored with the basic storeBinary operation
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1374
     (we depend on the class being present at binaryLoad time.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1375
    To store classes, use #storeBinaryClassOn:manager: or BOSS>>nextPutClasses:."
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1376
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1377
    |varnames n sz|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1378
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1379
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1380
     output the signature
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1381
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1382
    stream nextNumber:4 put:self signature.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1383
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1384
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1385
     output the instance variable name string
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1386
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1387
    varnames := self allInstVarNames.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1388
    n := varnames size.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1389
    n == 0 ifTrue:[
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1390
        sz := 0
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1391
    ] ifFalse:[
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1392
        sz := varnames inject:0 into:[:sum :nm | sum + nm size].
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1393
        sz := sz + n - 1.
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1394
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1395
    stream nextNumber:2 put:sz.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1396
    varnames keysAndValuesDo:[:i :nm |
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1397
        nm do:[:c |
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1398
            stream nextPut:c asciiValue
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1399
        ].
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1400
        i ~~ n ifTrue:[stream nextPut:(Character space asciiValue)]
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1401
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1402
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1403
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1404
     output my name
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1405
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1406
    stream nextNumber:2 put:name size.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1407
    name do:[:c| 
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1408
        stream nextPut:c asciiValue
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1409
    ]
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1410
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1411
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1412
     |s|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1413
     s := WriteStream on:ByteArray new.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1414
     Rectangle storeBinaryOn:s.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1415
     Object readBinaryFrom:(ReadStream on:s contents)  
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1416
    "
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1417
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1418
    "Modified: 23.4.1996 / 09:30:36 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1419
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1420
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1421
!Class methodsFor:'c function interfacing'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1422
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1423
cInterfaceFunction:selector calling:cFunctionNameString args:argTypeArray returning:returnType
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1424
    "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
  1425
     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
  1426
     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
  1427
     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
  1428
     WARNING: 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1429
	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
  1430
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1431
    StubGenerator isNil ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1432
	^ 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
  1433
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1434
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1435
    StubGenerator 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1436
	createStubFor:selector 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1437
	calling:cFunctionNameString 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1438
	args:argTypeArray 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1439
	returning:returnType
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1440
	in:self                          
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1441
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1442
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1443
     Object subclass:#CInterface
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1444
	    instanceVariableNames:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1445
	    classVariableNames:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1446
	    poolDictionaries:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1447
	    category:'Examples'.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1448
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1449
     CInterface cInterfaceFunction:#printfOn:format:withFloat: 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1450
			   calling:'fprintf' 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1451
			      args:#(ExternalStream String Float) 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1452
			 returning:#SmallInteger.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1454
     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
  1455
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1456
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1457
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1458
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1459
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1460
addChangeRecordForChangeCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1461
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1462
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1463
    "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
  1464
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1465
    self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1466
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1467
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1468
addChangeRecordForClass:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1469
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1470
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1471
    "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
  1472
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1473
    self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1474
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1475
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1476
addChangeRecordForClassCheckIn:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1477
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1478
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1479
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1480
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  1481
    self addInfoRecord:('checkin ' , aClass name , ' (' , aClass revision , ')')
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1482
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1483
    "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
  1484
    "Modified: 7.12.1995 / 23:45:01 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1485
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1486
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1487
addChangeRecordForClassComment:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1488
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1489
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1490
    "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
  1491
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1492
    self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1493
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1494
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1495
addChangeRecordForClassContainerRemove:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1496
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1497
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1498
    "append a container-was-removed-record to the changes file"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1499
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1500
    self addInfoRecord:('removed source container of ' , aClass name)
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1501
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1502
    "Modified: 7.12.1995 / 23:45:01 / cg"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1503
    "Created: 11.9.1996 / 15:37:19 / cg"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1504
!
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1505
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1506
addChangeRecordForClassFileOut:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1507
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1508
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1509
    "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
  1510
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1511
    self addInfoRecord:('fileOut ' , aClass name) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1512
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1513
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1514
addChangeRecordForClassInstvars:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1515
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1516
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1517
    "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
  1518
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1519
    self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1522
addChangeRecordForClassRemove:oldName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1523
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1524
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1525
    "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
  1526
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1527
    self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName.
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1530
addChangeRecordForClassRename:oldName to:newName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1531
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1532
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1533
    "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
  1534
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1535
    self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1536
	self addChangeRecordForClassRename:oldName to:newName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1537
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1538
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1539
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1540
addChangeRecordForMethod:aMethod
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1541
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1542
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1543
    "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
  1544
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1545
    self askIfUpdatingChanges ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1546
	self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1547
	"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
  1548
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1549
	    Project addMethodChange:aMethod in:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1550
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1551
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1552
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1553
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1554
addChangeRecordForMethodCategory:aMethod category:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1555
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1556
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1557
    "add a methodCategory-change-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1558
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1559
    self askIfUpdatingChanges ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1560
	self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1561
	    self addChangeRecordForMethodCategory:aMethod category:aString to:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1562
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1563
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1564
	"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
  1565
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1566
	    Project addMethodCategoryChange:aMethod category:aString in:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1567
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1568
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1569
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1570
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1571
addChangeRecordForMethodPrivacy:aMethod
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1572
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1573
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1574
    "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
  1575
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1576
    self askIfUpdatingChanges ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1577
	self writingChangePerform:#addChangeRecordForMethodPrivacy:to: with:aMethod.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1578
	"this test allows a smalltalk without Projects/ChangeSets"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1579
	Project notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1580
	    Project addMethodPrivacyChange:aMethod in:self
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1581
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1582
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1583
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1584
    "Modified: 27.8.1995 / 22:47:32 / claus"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1585
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1586
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1587
addChangeRecordForPrimitiveDefinitions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1588
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1589
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1590
    "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
  1591
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1592
    self askIfUpdatingChanges ifTrue:[
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1593
	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
  1594
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1595
	    Project addPrimitiveDefinitionsChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1596
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1597
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1598
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1599
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1600
addChangeRecordForPrimitiveFunctions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1601
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1602
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1603
    "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
  1604
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1605
    self askIfUpdatingChanges ifTrue:[
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1606
	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
  1607
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1608
	    Project addPrimitiveFunctionsChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1609
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1610
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1611
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1612
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1613
addChangeRecordForPrimitiveVariables:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1614
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1615
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1616
    "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
  1617
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1618
    self askIfUpdatingChanges ifTrue:[
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1619
	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
  1620
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1621
	    Project addPrimitiveVariablesChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1622
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1623
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1624
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1625
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1626
addChangeRecordForRemoveSelector:aSelector
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1627
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1628
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1629
    "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
  1630
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1631
    self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1632
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1633
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1634
addChangeRecordForRenameCategory:oldCategory to:newCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1635
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1636
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1637
    "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
  1638
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1639
    self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1640
	self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1641
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1642
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1643
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1644
addChangeRecordForSnapshot:aFileName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1645
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1646
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1647
    "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
  1648
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1649
    self addInfoRecord:('snapshot ' , aFileName) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1650
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1651
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1652
addChangeRecordForSnapshot:aFileName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1653
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1654
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1655
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1656
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1657
    self addInfoRecord:('snapshot ' , aFileName) to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1658
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1659
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1660
addChangeTimeStampTo:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1661
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1662
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1663
    "a timestamp - prepended to any change, except infoRecords"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1664
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1665
    |info|
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
    info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1668
    self addInfoRecord:info to:aStream. aStream cr.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1669
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1670
    "Created: 18.11.1995 / 15:41:01 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1671
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1672
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1673
addInfoRecord:aMessage
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1674
    "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
  1675
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1676
    self writingChangeWithTimeStamp:false perform:#addInfoRecord:to: with:aMessage.
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1677
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1678
    "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
  1679
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1680
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1681
changesStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1682
    "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
  1683
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1684
    |streamType aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1685
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  1686
    self askIfUpdatingChanges ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1687
	fileName := ObjectMemory nameForChanges.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1688
        
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1689
	LockChangesFile ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1690
	    streamType := LockedFileStream. 
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1691
	] ifFalse:[
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1692
	    streamType := FileStream.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1693
	].
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1694
	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
  1695
	aStream isNil ifTrue:[
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1696
	    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
  1697
	    aStream isNil ifTrue:[
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1698
		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
  1699
		^ nil
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1700
	    ]
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1701
	].
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1702
	aStream setToEnd
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1703
    ].
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1704
    ^ aStream
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1705
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1706
    "Created: 28.10.1995 / 16:53:43 / cg"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1707
    "Modified: 28.10.1995 / 16:55:03 / cg"
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1708
!
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1709
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1710
sourcesStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1711
    "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
  1712
     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
  1713
     source file; typically each classes source is kept
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1714
     in a separate file."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1715
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1716
    |aStream fileName|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1717
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1718
    fileName := ObjectMemory nameForSources.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1719
    aStream := FileStream oldFileNamed:fileName.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1720
    aStream isNil ifTrue:[
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1721
        aStream := FileStream newFileNamed:fileName.
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1722
        aStream isNil ifTrue:[
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1723
            Transcript showCR:'cannot update sources file'.
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1724
            ^ nil
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1725
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1726
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1727
    aStream setToEnd.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1728
    ^ aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1729
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1730
    "Created: 28.10.1995 / 16:53:17 / cg"
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1731
    "Modified: 18.5.1996 / 15:41:47 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1732
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1733
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1734
withoutUpdatingChangesDo:aBlock
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1735
    "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
  1736
     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
  1737
     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
  1738
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1739
    UpdateChangeFileQuerySignal handle:[:ex | 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1740
	ex proceedWith:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1741
    ] do:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1742
	aBlock value
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1743
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1744
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1745
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1746
!Class methodsFor:'compiling'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1747
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1748
compile:code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1749
    "compile code, aString for this class; 
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1750
     if successful update the method dictionary.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1751
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1752
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1753
    ^ self compilerClass 
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1754
	compile:code 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1755
	forClass:self
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1756
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1757
    "Modified: 13.12.1995 / 10:56:00 / cg"
328
claus
parents: 326
diff changeset
  1758
!
claus
parents: 326
diff changeset
  1759
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1760
compile:code classified:category
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1761
    "compile code, aString for this class; 
671
53de87163ad5 spelling
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1762
     if successful update the method dictionary. 
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1763
     The method is classified under category.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1764
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1765
1234
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1766
    ^ self compile:code classified:category logged:true
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1767
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1768
    "Modified: 20.4.1996 / 12:30:51 / cg"
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1769
!
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1770
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1771
compile:code classified:category logged:logged
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1772
    "compile code, aString for this class; 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1773
     if successful update the method dictionary. 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1774
     The method is classified under category.
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1775
     If logged is true, a changeRecord is written.
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1776
     Returns the new method or nil (on failure)."
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1777
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1778
    logged ifFalse:[
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1779
        self withoutUpdatingChangesDo:[
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1780
            ^ self compilerClass 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1781
                compile:code 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1782
                forClass:self 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1783
                inCategory:category
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1784
        ]
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1785
    ] ifTrue:[
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1786
        ^ self compilerClass 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1787
            compile:code 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1788
            forClass:self 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1789
            inCategory:category
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1790
    ].
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1791
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1792
    "Modified: 13.12.1995 / 11:02:34 / cg"
1234
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  1793
    "Created: 20.4.1996 / 12:30:35 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1794
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1795
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1796
compile:code notifying:requestor
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1797
    "compile code, aString for this class; on any error, notify
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1798
     requestor, anObject with the error reason.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1799
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1800
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1801
    ^ self compilerClass 
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1802
	compile:code 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1803
	forClass:self 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1804
	notifying:requestor
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1805
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  1806
    "Modified: 13.12.1995 / 11:02:40 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1807
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1808
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1809
recompile
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1810
    "recompile all methods
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1811
     used when a class changes instances and therefore all methods
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1812
     have to be recompiled"
2
claus
parents: 1
diff changeset
  1813
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1814
    self methodDictionary keys do:[:aSelector |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1815
        self recompile:aSelector
2
claus
parents: 1
diff changeset
  1816
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1817
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1818
    "Modified: 12.6.1996 / 11:51:15 / stefan"
2
claus
parents: 1
diff changeset
  1819
!
claus
parents: 1
diff changeset
  1820
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1821
recompile:aSelector
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1822
    "recompile the method associated with the argument, aSelector;
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1823
     used when a superclass changes instances and we have to recompile
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1824
     subclasses"
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1825
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1826
    |cat code|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1827
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1828
    Class withoutUpdatingChangesDo:[
978
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  1829
        MethodRedefinitionSignal ignoreIn:[
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  1830
            cat := (self compiledMethodAt:aSelector) category.
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  1831
            code := self sourceCodeAt:aSelector.
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  1832
            self compilerClass compile:code forClass:self inCategory:cat
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  1833
        ]
2
claus
parents: 1
diff changeset
  1834
    ]
978
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  1835
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  1836
    "Modified: 20.2.1996 / 20:23:21 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1837
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1838
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1839
recompileAll
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1840
    "recompile this class and all subclasses"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1841
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1842
    |classes|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1843
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1844
    classes := self subclasses.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1845
    self recompile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1846
    classes do:[:aClass |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1847
	aClass recompileAll
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1848
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1849
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1850
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1851
recompileInvalidatedMethods:trap
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1852
    "recompile all invalidated methods"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1853
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1854
    |trapCode trapByteCode|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1855
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1856
    trapCode := trap code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1857
    trapByteCode := trap byteCode.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1858
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1859
    self methodDictionary keys do:[:aSelector |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1860
        |m|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1861
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1862
        m := self compiledMethodAt:aSelector.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1863
        ((m code = trapCode) and:[m byteCode == trapByteCode]) ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1864
            self recompile:aSelector
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1865
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1866
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1867
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1868
    "Modified: 12.6.1996 / 11:52:09 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1869
!
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
recompileMethodsAccessingAny:setOfNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1872
    "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
  1873
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1874
    self recompileMethodsAccessingAny:setOfNames orSuper:false 
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1877
recompileMethodsAccessingAny:setOfNames orSuper:superBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1878
    "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
  1879
     or super (if superBoolean is true)"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1880
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1881
    |p|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1882
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1883
    self methodDictionary keys do:[:aSelector |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1884
        |m|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1885
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1886
        m := self compiledMethodAt:aSelector.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1887
        p := Parser parseMethod:(m source) in:self.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1888
        (p isNil 
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1889
         or:[(p usedVars notNil and:[p usedVars includesAny:setOfNames])
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1890
         or:[superBoolean and:[p usesSuper]]]) ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1891
            self recompile:aSelector
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1892
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1893
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1894
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1895
    "Modified: 12.6.1996 / 11:52:35 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1896
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1897
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1898
!Class methodsFor:'enumerating'!
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1899
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1900
privateClassesDo:aBlock
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1901
    "evaluate aBlock on all of my private classes (if any)"
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1902
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1903
    |classes|
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1904
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1905
    (classes := self privateClasses) notNil ifTrue:[
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1906
        classes do:aBlock
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1907
    ].
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1908
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1909
    "Created: 26.10.1996 / 12:28:57 / cg"
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1910
! !
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1911
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1912
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1913
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1914
ignoredMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1915
    "this is a speciality of ST/X - it allows quick commenting of methods
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1916
     from a source-file by replacing the 'methodsFor:' by 'ignoredMethodsFor:'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1917
     Returns a ClassCategoryReader to read in and skip methods."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1918
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1919
    ^ (self methodsFor:aCategory) ignoredProtocol
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1920
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1921
    "Modified: 10.2.1996 / 12:53:25 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1922
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1923
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1924
methods
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1925
    "this method allows fileIn of ST/V methods -
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1926
     return a ClassCategoryReader to read in and compile methods for me.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1927
     Since ST/V does not support method categories, the loaded methods are
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1928
     categorized as 'ST/V methods'."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1929
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1930
    ^ ClassCategoryReader class:self category:'ST/V methods'
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1931
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1932
    "Modified: 10.2.1996 / 12:44:21 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1933
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1934
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1935
methodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1936
    "return a ClassCategoryReader to read in and compile methods for me."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1937
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1938
    ^ ClassCategoryReader class:self category:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1939
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1940
    "Modified: 10.2.1996 / 12:44:43 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1941
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1942
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1943
methodsForUndefined:categoryString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1944
    "ST-80 compatibility.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1945
     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
  1946
     For now, simply forward it."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1947
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1948
    ^ self methodsFor:categoryString
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1949
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1950
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1951
primitiveDefinitions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1952
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1953
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1954
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1955
     unprocessed contents in the classes primitiveDefinitions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1956
     Thus, although the definitions are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1957
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1959
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1960
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1961
    "Modified: 10.2.1996 / 12:47:12 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1962
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1963
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1964
primitiveFunctions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1965
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1966
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1967
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1968
     unprocessed contents in the classes primitiveFunctions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1969
     Thus, although the functions are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1970
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1971
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1972
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1973
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1974
    "Modified: 10.2.1996 / 12:47:07 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1975
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1976
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1977
primitiveVariables
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1978
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1979
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1980
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1981
     unprocessed contents in the classes primitiveVariables section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1982
     Thus, although the variables are NOT processed, they are still visible,
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1983
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1984
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1985
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1986
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1987
    "Modified: 10.2.1996 / 12:47:28 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1988
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1989
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1990
privateMethodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1991
    "this method allows fileIn of ENVY and ST/X private methods.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1992
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1993
     The following methods are only allowed to be executed if sent from a method
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1994
     within the current class. Subclass sends or out-of-class sends will raise
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1995
     a privatMethodError exception."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1996
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1997
    ^ (self methodsFor:aCategory) privateProtocol
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1998
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1999
    "Modified: 10.2.1996 / 12:48:44 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2000
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2001
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2002
protectedMethodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2003
    "this method allows fileIn of ENVY and ST/X protected methods. 
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2004
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2005
     The following methods are only allowed to be executed if sent from a method
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2006
     within the current class or a subclass. Out-of-class sends will raise
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2007
     a privatMethodError exception."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2008
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2009
    ^ (self methodsFor:aCategory) protectedProtocol
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2010
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2011
    "Modified: 10.2.1996 / 12:49:18 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2012
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2013
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2014
publicMethodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2015
    "this method allows fileIn of ENVY methods
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2016
     The publicMethods keyword is for documentation only; my default, methods
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2017
     are public anyway (for backward compatibility)."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2018
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2019
    ^ self methodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2020
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2021
    "Modified: 10.2.1996 / 12:50:11 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2022
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2023
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2024
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2025
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2026
basicFileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2027
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  2028
1735
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2029
    |s owner|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2030
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2031
    owner := self owningClass.
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2032
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
  2033
    "take care of nil-superclass"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2034
    superclass isNil ifTrue:[
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2035
        s := 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2036
    ] ifFalse:[
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2037
        s := (superclass name)
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2038
    ].
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  2039
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2040
    aStream nextPutAll:s.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2041
    aStream space.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2042
    self basicFileOutInstvarTypeKeywordOn:aStream.
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2043
    owner isNil ifTrue:[
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2044
        aStream nextPutAll:name storeString.
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2045
    ] ifFalse:[
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  2046
        aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix).
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2047
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2048
345
claus
parents: 333
diff changeset
  2049
    aStream crtab. 
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2050
    aStream nextPutAll:'instanceVariableNames:'''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2051
    self printInstVarNamesOn:aStream indent:16.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2052
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2053
345
claus
parents: 333
diff changeset
  2054
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2055
    aStream nextPutAll:'classVariableNames:'''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2056
    self printClassVarNamesOn:aStream indent:16.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2057
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2058
345
claus
parents: 333
diff changeset
  2059
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2060
    aStream nextPutAll:'poolDictionaries:'''''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2061
345
claus
parents: 333
diff changeset
  2062
    aStream crtab.
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2063
    owner isNil ifTrue:[
1735
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2064
        "/ a public class
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2065
        aStream nextPutAll:'category:'.
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2066
        category isNil ifTrue:[
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2067
            s := ''''''
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2068
        ] ifFalse:[
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2069
            s := category asString storeString
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2070
        ].
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2071
        aStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2072
    ] ifFalse:[
1735
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2073
        "/ a private class
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2074
        aStream nextPutAll:'privateIn:'.
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2075
        aStream nextPutAll:owner name.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2076
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2077
    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
  2078
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  2079
    "Modified: 15.10.1996 / 20:01:23 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2080
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2081
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2082
basicFileOutInstvarTypeKeywordOn:aStream
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2083
    "a helper for fileOutDefinition"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2084
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2085
    |isVar s|
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2086
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2087
    superclass isNil ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2088
        isVar := self isVariable
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2089
    ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2090
        "I cant remember what this is for ?"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2091
        isVar := (self isVariable and:[superclass isVariable not])
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2092
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2093
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2094
    isVar ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2095
        self isBytes ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2096
            s := 'variableByteSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2097
        ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2098
            self isWords ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2099
                s := 'variableWordSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2100
            ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2101
                self isLongs ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2102
                    s := 'variableLongSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2103
                ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2104
                    self isFloats ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2105
                        s := 'variableFloatSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2106
                    ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2107
                        self isDoubles ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2108
                            s := 'variableDoubleSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2109
                        ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2110
                            self isSignedWords ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2111
                                s := 'variableSignedWordSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2112
                            ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2113
                                self isSignedLongs ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2114
                                    s := 'variableSignedLongSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2115
                                ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2116
                                    s := 'variableSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2117
                                ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2118
                            ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2119
                        ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2120
                    ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2121
                ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2122
            ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2123
        ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2124
    ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2125
        s := 'subclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2126
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2127
    aStream nextPutAll:s.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2128
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2129
    "Created: 11.10.1996 / 18:57:29 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2130
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2131
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2132
binaryFileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2133
    "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
  2134
     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
  2135
     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
  2136
     That sourcefile needs to be present after reload in order to be
895
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
  2137
     browsable."
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2138
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2139
    self binaryFileOutWithSourceMode:#reference
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2140
!
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2141
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2142
binaryFileOutOn:aStream
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2143
    "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
  2144
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2145
    self binaryFileOutOn:aStream sourceMode:#reference 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2146
!
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2147
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2148
binaryFileOutOn:aStream sourceMode:sourceMode
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2149
    "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
  2150
     a portable binary format. 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2151
     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
  2152
	#keep - include the source
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2153
	#reference - include a reference to the sourceFile
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2154
	#discard - dont save sources.
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2155
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2156
     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
  2157
     in order to be browsable."
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2158
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2159
    |bos|
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2160
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2161
    bos := BinaryObjectStorage onNew:aStream.
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2162
    bos sourceMode:sourceMode.
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2163
    bos nextPutClasses:(Array with:self).
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2164
    bos close.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2165
!
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2166
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2167
binaryFileOutWithSourceMode:sourceMode
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2168
    "create a file 'class.cls' consisting of all methods in myself
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2169
     in a portable binary format. 
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2170
     The argument controls how sources are to be saved:
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2171
	#keep - include the source
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2172
	#reference - include a reference to the sourceFile
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2173
	#discard - dont save sources.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2174
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2175
     With #reference, the sourceFile needs to be present after reload 
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2176
     in order to be browsable."
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2177
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2178
    |baseName fileName aStream|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2179
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2180
    baseName := (Smalltalk fileNameForClass:self name).
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2181
    fileName := baseName , '.cls'.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2182
    aStream := FileStream newFileNamed:fileName.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2183
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2184
    aStream binary.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2185
    self binaryFileOutOn:aStream sourceMode:sourceMode.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2186
    aStream close.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2187
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2188
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2189
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2190
    "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
  2191
     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
  2192
     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
  2193
     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
  2194
     case of errors (for example: disk full). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2195
     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
  2196
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2197
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2198
    |aStream baseName dirName fileNameString fileName newFileName needRename
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2199
     mySourceFileName sameFile s mySourceFileID anySourceRef|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2200
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2201
    baseName := (Smalltalk fileNameForClass:self name).
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2202
    fileNameString := baseName , '.st'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2203
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2204
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2205
     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
  2206
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2207
    Project notNil ifTrue:[
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2208
        dirName := Project currentProjectDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2209
    ] ifFalse:[
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2210
        dirName := ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2211
    ].
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2212
    fileNameString := dirName , fileNameString.
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2213
    fileName := fileNameString asFilename.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2214
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2215
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2216
     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
  2217
     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
  2218
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2219
    "
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2220
    (fileName exists) ifTrue:[
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2221
        sameFile := false.
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2222
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2223
        "/ check carefully - maybe, my source does not really come from that
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2224
        "/ file (i.e. all of my methods have their source as string)
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2225
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2226
        anySourceRef := false.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2227
        self methodDictionary do:[:m|
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2228
            m sourcePosition notNil ifTrue:[
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2229
                anySourceRef := true
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2230
            ]
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2231
        ].
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2232
        self class methodDictionary do:[:m|
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2233
            m sourcePosition notNil ifTrue:[
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2234
                anySourceRef := true
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2235
            ]
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2236
        ].
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2237
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2238
        anySourceRef ifTrue:[
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2239
            s := self sourceStream.
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2240
            s notNil ifTrue:[
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2241
                mySourceFileID := s pathName asFilename info at:#id.
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2242
                sameFile := (fileName info at:#id) == mySourceFileID.
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2243
                s close.
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2244
            ] ifFalse:[
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2245
                classFilename notNil ifTrue:[
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2246
                    "
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2247
                     check for overwriting my current source file
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2248
                     this is not allowed, since it would clobber my methods source
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2249
                     file ... you have to save it to some other place.
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2250
                     This happens if you ask for a fileOut into the source-directory
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2251
                     (from which my methods get their source)
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2252
                    "
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2253
                    mySourceFileName := Smalltalk getSourceFileName:classFilename. 
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2254
                    sameFile := (fileNameString = mySourceFileName).
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2255
                    sameFile ifFalse:[
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2256
                        mySourceFileName notNil ifTrue:[
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2257
                            sameFile := (fileName info at:#id) == (mySourceFileName asFilename info at:#id)
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2258
                        ]
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2259
                    ].
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2260
                ]
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2261
            ].
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2262
        ].
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2263
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2264
        sameFile ifTrue:[
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2265
            ^ FileOutErrorSignal 
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2266
                raiseRequestWith:fileNameString
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2267
                errorString:('may not overwrite sourcefile:', fileNameString)
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2268
        ].
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2269
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2270
        fileName copyTo:('/tmp/' , baseName , '.sav').
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2271
        newFileName := dirName , baseName , '.new'.
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2272
        needRename := true
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2273
    ] ifFalse:[
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2274
        newFileName := fileNameString.
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2275
        needRename := false
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2276
    ].
557
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
    aStream := FileStream newFileNamed:newFileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2279
    aStream isNil ifTrue:[
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2280
        ^ FileOutErrorSignal 
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2281
                raiseRequestWith:newFileName
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2282
                errorString:('cannot create file:', newFileName)
557
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
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2285
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2286
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2287
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2288
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2289
     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
  2290
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2291
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2292
    needRename ifTrue:[
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2293
        newFileName asFilename copyTo:fileNameString.
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2294
        newFileName asFilename delete
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2295
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2296
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2297
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2298
     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
  2299
     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
  2300
     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
  2301
     applied again
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
    self addChangeRecordForClassFileOut:self
1107
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2304
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2305
    "Modified: 19.3.1996 / 19:43:17 / cg"
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2306
    "Modified: 7.6.1996 / 09:14:43 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2307
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2308
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2309
fileOutAllDefinitionsOn:aStream
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2310
    "append expressions on aStream, which defines myself and all of my private classes."
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2311
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2312
    |privateClasses|
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2313
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2314
    self fileOutDefinitionOn:aStream.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2315
    aStream nextPutChunkSeparator. 
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2316
    aStream cr; cr.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2317
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2318
    "/
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2319
    "/ optional classInstanceVariables
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2320
    "/
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2321
    self class instanceVariableString isBlank ifFalse:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2322
        self fileOutClassInstVarDefinitionOn:aStream.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2323
        aStream nextPutChunkSeparator. 
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2324
        aStream cr; cr
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2325
    ].
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2326
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2327
    (privateClasses := self privateClasses) notNil ifTrue:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2328
        privateClasses do:[:aClass |
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2329
            aClass fileOutAllDefinitionsOn:aStream
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2330
        ]
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2331
    ]
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2332
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2333
    "Created: 15.10.1996 / 11:15:19 / cg"
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2334
    "Modified: 15.10.1996 / 11:26:30 / cg"
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2335
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2336
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2337
fileOutAllMethodsOn:aStream
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2338
    |collectionOfCategories privateClasses|
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2339
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2340
    collectionOfCategories := self class categories asSortedCollection.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2341
    collectionOfCategories notNil ifTrue:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2342
        collectionOfCategories do:[:aCategory |
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2343
            self class fileOutCategory:aCategory on:aStream.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2344
            aStream cr
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2345
        ]
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2346
    ].
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2347
    collectionOfCategories := self categories asSortedCollection.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2348
    collectionOfCategories notNil ifTrue:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2349
        collectionOfCategories do:[:aCategory |
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2350
            self fileOutCategory:aCategory on:aStream.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2351
            aStream cr
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2352
        ]
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2353
    ].
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2354
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2355
    (privateClasses := self privateClasses) notNil ifTrue:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2356
        privateClasses do:[:aClass |
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2357
            aClass fileOutAllMethodsOn:aStream
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2358
        ]
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2359
    ].
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2360
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2361
    "Created: 15.10.1996 / 11:13:00 / cg"
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2362
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2363
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2364
fileOutCategory:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2365
    "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
  2366
     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
  2367
     directory."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2368
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2369
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2370
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2371
    fileName := name , '-' , aCategory , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2372
    fileName replaceAll:(Character space) by:$_.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2373
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2374
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2375
     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
  2376
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2377
    Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2378
	fileName := Project currentProjectDirectory , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2379
    ].
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2380
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2381
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2382
     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
  2383
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2384
    fileName asFilename exists ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2385
	fileName asFilename copyTo:(fileName , '.sav')
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2386
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2387
    aStream := FileStream newFileNamed:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2388
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2389
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2390
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2391
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2392
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2393
    self fileOutCategory:aCategory on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2394
    aStream close
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2395
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2396
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2397
fileOutCategory:aCategory except:skippedMethods only:savedMethods on:aStream
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2398
    "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
  2399
     If skippedMethods is nonNil, those are not saved.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2400
     If savedMethods is nonNil, only those are saved.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2401
     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
  2402
     fileOut for what this is needed."
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2403
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2404
    |dict source sortedSelectors first privacy interestingMethods|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2405
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2406
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2407
    dict notNil ifTrue:[
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2408
        interestingMethods := OrderedCollection new.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2409
        dict do:[:aMethod |
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2410
            |wanted|
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2411
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2412
            (aCategory = aMethod category) ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2413
                skippedMethods notNil ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2414
                    wanted := (skippedMethods includesIdentical:aMethod) not
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2415
                ] ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2416
                    savedMethods notNil ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2417
                        wanted := (savedMethods includesIdentical:aMethod).
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2418
                    ] ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2419
                        wanted := true
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2420
                    ]
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2421
                ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2422
                wanted ifTrue:[interestingMethods add:aMethod].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2423
            ]
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2424
        ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2425
        interestingMethods notEmpty ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2426
            first := true.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2427
            privacy := nil.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2428
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2429
            "/
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2430
            "/ sort by selector
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2431
            "/
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2432
            sortedSelectors := interestingMethods collect:[:m | self selectorAtMethod:m].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2433
            sortedSelectors sortWith:interestingMethods.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2434
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2435
            interestingMethods do:[:aMethod |
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2436
                first ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2437
                    privacy ~~ aMethod privacy ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2438
                        first := true.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2439
                        aStream space.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2440
                        aStream nextPutChunkSeparator.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2441
                    ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2442
                    aStream cr; cr
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2443
                ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2444
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2445
                privacy := aMethod privacy.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2446
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2447
                first ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2448
                    aStream nextPutChunkSeparator.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2449
                    self printClassNameOn:aStream.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2450
                    privacy ~~ #public ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2451
                        aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'''.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2452
                    ] ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2453
                        aStream nextPutAll:' methodsFor:'''.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2454
                    ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2455
                    aCategory notNil ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2456
                        aStream nextPutAll:aCategory
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2457
                    ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2458
                    aStream nextPut:$'; nextPutChunkSeparator; cr; cr.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2459
                    first := false.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2460
                ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2461
                source := aMethod source.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2462
                source isNil ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2463
                    FileOutErrorSignal 
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2464
                        raiseRequestWith:self
1546
0e91715409d0 pass name of method to exception, if fileOut fails due to
Claus Gittinger <cg@exept.de>
parents: 1514
diff changeset
  2465
                        errorString:'no source for method: ', (aMethod displayString)
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2466
                ] ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2467
                    aStream nextChunkPut:source.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2468
                ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2469
            ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2470
            aStream space.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2471
            aStream nextPutChunkSeparator.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2472
            aStream cr
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2473
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2474
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2475
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2476
    "Modified: 28.8.1995 / 14:30:41 / claus"
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2477
    "Modified: 12.6.1996 / 11:37:33 / stefan"
1546
0e91715409d0 pass name of method to exception, if fileOut fails due to
Claus Gittinger <cg@exept.de>
parents: 1514
diff changeset
  2478
    "Modified: 12.7.1996 / 23:36:21 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2479
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2480
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2481
fileOutCategory:aCategory on:aStream
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2482
    "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
  2483
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2484
    self fileOutCategory:aCategory except:nil only:nil on:aStream
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2485
!
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2486
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2487
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2488
    "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
  2489
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2490
    aStream nextPutAll:(name , ' class instanceVariableNames:''').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2491
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2492
    aStream nextPutAll:''''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2493
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2494
    "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
  2495
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2496
    aStream cr; cr; nextPut:(Character doubleQuote); cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2497
    aStream space; 
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2498
	    nextPutAll:'The following class instance variables are inherited by this class:';
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2499
	    cr; cr.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2500
    self allSuperclassesDo:[:aSuperClass |
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2501
	aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2502
	aStream nextPutAll:(aSuperClass class instanceVariableString); cr.
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2503
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2504
    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
  2505
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2506
    "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
  2507
    "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
  2508
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2509
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2510
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2511
    "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
  2512
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2513
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2514
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2515
    aStream nextPutAll:name; nextPutAll:' comment:'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2516
    (comment := self comment) isNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2517
        s := ''''''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2518
    ] ifFalse:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2519
        s := comment storeString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2520
    ].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2521
    aStream nextPutAllAsChunk:s.
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  2522
    aStream nextPutChunkSeparator.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2523
    aStream cr
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2524
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  2525
    "Modified: 4.3.1996 / 16:49:23 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2526
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2527
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2528
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2529
    "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
  2530
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2531
    ^ self basicFileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2532
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2533
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2534
fileOutIn:aFileDirectory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2535
    "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
  2536
     directory aFileDirectory (ignoring any directory setting in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2537
     the current porject). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2538
     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
  2539
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2540
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2541
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2542
    fileName := (Smalltalk fileNameForClass:self name) , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2543
    aStream := FileStream newFileNamed:fileName in:aFileDirectory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2544
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2545
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2546
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2547
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2548
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2549
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2550
    aStream close
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2551
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2552
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2553
fileOutMethod:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2554
    "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
  2555
     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
  2556
     directory."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2558
    |aStream fileName selector|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2559
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2560
    selector := self selectorAtMethod:aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2561
    selector notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2562
	fileName := name , '-' , selector, '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2563
	fileName replaceAll:$: by:$_.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2564
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2565
	 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
  2566
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2567
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2568
	    fileName := Project currentProjectDirectory , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2569
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2570
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2571
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2572
	 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
  2573
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2574
	fileName asFilename exists ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2575
	    fileName asFilename copyTo:(fileName , '.sav')
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
	aStream := FileStream newFileNamed:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2578
	aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2579
	    ^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2580
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2581
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2582
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2583
	self fileOutMethod:aMethod on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2584
	aStream close
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2585
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2586
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2587
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2588
fileOutMethod:aMethod on:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2589
    "file out the method, aMethod onto aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2590
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2591
    |dict cat source privacy|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2592
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2593
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2594
    dict notNil ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2595
        aStream nextPutChunkSeparator.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2596
        self printClassNameOn:aStream.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2597
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2598
        (privacy := aMethod privacy) ~~ #public ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2599
            aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'''.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2600
        ] ifFalse:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2601
            aStream nextPutAll:' methodsFor:'''.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2602
        ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2603
        cat := aMethod category.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2604
        cat notNil ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2605
            aStream nextPutAll:cat
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2606
        ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2607
        aStream nextPut:$'; nextPutChunkSeparator; cr; cr.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2608
        source := aMethod source.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2609
        source isNil ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2610
            FileOutErrorSignal 
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2611
                raiseRequestWith:self
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2612
                errorString:('no source for method: ' ,
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2613
                             self name , '>>' ,
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2614
                             (self selectorAtMethod:aMethod))
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2615
        ] ifFalse:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2616
            aStream nextChunkPut:source.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2617
        ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2618
        aStream space.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2619
        aStream nextPutChunkSeparator.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2620
        aStream cr
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2621
    ]
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
    "Modified: 27.8.1995 / 01:23:19 / claus"
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2624
    "Modified: 12.6.1996 / 11:44:41 / stefan"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2625
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2626
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2627
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2628
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2629
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2630
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2631
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2632
    "Created: 15.11.1995 / 12:53:32 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2633
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2634
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2635
fileOutOn:aStream withTimeStamp:stampIt
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2636
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2637
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2638
    |collectionOfCategories copyrightMethod copyrightText comment versionMethod skippedMethods
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2639
     meta privateClasses|
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2640
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2641
    self isLoaded ifFalse:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2642
        ^ FileOutErrorSignal 
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2643
            raiseRequestWith:self
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2644
                 errorString:'will not fileOut unloaded classes'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2645
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2646
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2647
    privateClasses := self privateClasses.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2648
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2649
    meta := self class.
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2650
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2651
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2652
     if there is a copyright method, add a copyright comment
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2653
     at the beginning, taking the string from the copyright method.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2654
     We cannot do this unconditionally - that would lead to my copyrights
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2655
     being put on your code ;-).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2656
     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
  2657
     copyright string at the beginning be preserved .... even if the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2658
     code was edited in the browser and filedOut.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2659
    "
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2660
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2661
        "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2662
         get the copyright methods source,
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2663
         and insert at beginning.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2664
        "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2665
        copyrightText := copyrightMethod source.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2666
        copyrightText isNil ifTrue:[
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2667
            "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2668
             no source available - trigger an error
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2669
            "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2670
            FileOutErrorSignal
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2671
                raiseRequestWith:'no source for class ' , name , ' available. Cannot fileOut'.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2672
            ^ self
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2673
        ].
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2674
        "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2675
         strip off the selector-line
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2676
        "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2677
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2678
        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
  2679
"/        copyrightText do:[:line | aStream nextPutAll:line. aStream cr.].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2680
        copyrightText := copyrightText asString.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2681
        aStream nextPutAllAsChunk:copyrightText.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2682
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2683
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2684
    stampIt ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2685
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2686
        "/ first, a timestamp
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2687
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2688
        aStream nextPutAll:(Smalltalk timeStamp).
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2689
        aStream nextPutChunkSeparator. 
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2690
        aStream cr; cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2691
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2692
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2693
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2694
    "/ then the definition
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2695
    "/
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2696
    self fileOutAllDefinitionsOn:aStream.
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2697
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2698
    "/
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2699
    "/ a comment - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2700
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2701
    (comment := self comment) notNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2702
        self fileOutCommentOn:aStream.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2703
        aStream cr.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2704
"/        aStream nextPutAll:name; nextPutAll:' comment:'.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2705
"/        aStream nextPutAll:(comment storeString).
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2706
"/        aStream nextPutChunkSeparator.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2707
"/        aStream cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2708
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2709
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2710
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2711
    "/ primitive definitions - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2712
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2713
    self fileOutPrimitiveSpecsOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2714
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2715
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2716
    "/ 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
  2717
    "/ 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
  2718
    "/         avoid sourcePosition-shifts when checked out later.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2719
    "/
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2720
    collectionOfCategories := meta categories asSortedCollection.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2721
    collectionOfCategories notNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2722
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2723
        "/ documentation first (if any), but not the version method
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2724
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2725
        (collectionOfCategories includes:'documentation') ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2726
            versionMethod := meta compiledMethodAt:#version.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2727
            versionMethod notNil ifTrue:[
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2728
                skippedMethods := Array with:versionMethod
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2729
            ].
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2730
            meta fileOutCategory:'documentation' except:skippedMethods only:nil on:aStream.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2731
            aStream cr.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2732
        ].
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2733
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2734
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2735
        "/ initialization next (if any)
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2736
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2737
        (collectionOfCategories includes:'initialization') ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2738
            meta fileOutCategory:'initialization' on:aStream.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2739
            aStream cr.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2740
        ].
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2741
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2742
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2743
        "/ instance creation next (if any)
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2744
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2745
        (collectionOfCategories includes:'instance creation') ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2746
            meta fileOutCategory:'instance creation' on:aStream.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2747
            aStream cr.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2748
        ].
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2749
        collectionOfCategories do:[:aCategory |
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2750
            ((aCategory ~= 'documentation')
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2751
            and:[(aCategory ~= 'initialization')
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2752
            and:[aCategory ~= 'instance creation']]) ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2753
                meta fileOutCategory:aCategory on:aStream.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2754
                aStream cr
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2755
            ]
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2756
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2757
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2758
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2759
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2760
    "/ methods from all categories in myself
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2761
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2762
    collectionOfCategories := self categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2763
    collectionOfCategories notNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2764
        collectionOfCategories do:[:aCategory |
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2765
            self fileOutCategory:aCategory on:aStream.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2766
            aStream cr
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2767
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2768
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2769
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2770
    "/
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2771
    "/ any private classes' methods
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2772
    "/
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2773
    privateClasses notNil ifTrue:[
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2774
        privateClasses do:[:aClass |
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2775
            aClass fileOutAllMethodsOn:aStream
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2776
        ].
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2777
    ].
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2778
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2779
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2780
    "/
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2781
    "/ finally, the previously skipped version method
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2782
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2783
    versionMethod notNil ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2784
        meta fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream.
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2785
    ].
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2786
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2787
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2788
    "/ optionally an initialize message
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2789
    "/
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2790
    (meta implements:#initialize) ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2791
        aStream nextPutAll:(name , ' initialize').
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2792
        aStream nextPutChunkSeparator.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2793
        aStream cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2794
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2795
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2796
    "Created: 15.11.1995 / 12:53:06 / cg"
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2797
    "Modified: 15.10.1996 / 11:25:59 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2798
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2799
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2800
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2801
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2802
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2803
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2804
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2805
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2806
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2807
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2808
    (s := self primitiveDefinitionsString) notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2809
	aStream nextPutChunkSeparator; 
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2810
		nextPutAll:name; nextPutAll:' primitiveDefinitions';
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2811
		nextPutChunkSeparator;
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2812
		cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2813
	aStream nextPutAll:s.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2814
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2815
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2816
    (s := self primitiveVariablesString) notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2817
	aStream nextPutChunkSeparator; 
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2818
		nextPutAll:name; nextPutAll:' primitiveVariables';
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2819
		nextPutChunkSeparator;
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2820
		cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2821
	aStream nextPutAll:s.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2822
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2823
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2824
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2825
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2826
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2827
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2828
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2829
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2830
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2831
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2832
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2833
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2834
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2835
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2836
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2837
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2838
    (s := self primitiveFunctionsString) notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2839
	aStream nextPutChunkSeparator; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2840
		nextPutAll:name; nextPutAll:' primitiveFunctions';
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2841
		nextPutChunkSeparator;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2842
		cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2843
	aStream nextPutAll:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2844
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2845
    ].
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2848
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2849
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  2850
nameWithoutPrefix
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  2851
    "helper for fileOut and others - return my names printString, 
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  2852
     without any privacy or nameSpace prefix"
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2853
1746
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  2854
    |nm idx|
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  2855
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  2856
    nm := self name.
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  2857
    idx := nm lastIndexOf:$:.
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  2858
    ^ nm copyFrom:idx+1.
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  2859
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  2860
    "Created: 15.10.1996 / 20:01:39 / cg"
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  2861
    "Modified: 15.10.1996 / 20:02:13 / cg"
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2862
!
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2863
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2864
printClassNameOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2865
    "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
  2866
     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
  2867
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2868
    |nm|
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2869
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2870
    self isMeta ifTrue:[
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2871
        nm := self name.
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2872
        (nm endsWith:' class') ifTrue:[
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2873
            nm := nm copyWithoutLast:6.
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2874
            aStream nextPutAll:nm; nextPutAll:' class'
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2875
        ] ifFalse:[
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2876
            aStream nextPutAll:nm 
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2877
        ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2878
    ] ifFalse:[
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2879
        name printOn:aStream
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2880
    ]
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2881
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  2882
    "Modified: 14.10.1996 / 17:36:01 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2883
!
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
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2886
    "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
  2887
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2888
    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
  2889
!
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
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2892
    "print myself and all subclasses on aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2893
     recursively calls itself to print subclasses. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2894
     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
  2895
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2896
    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
  2897
    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
  2898
    aStream nextPutAll:')'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2899
    aStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2900
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2901
    (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
  2902
	aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
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
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2905
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2906
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2907
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2908
     printStream close"
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
printHierarchyAnswerIndentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2912
    "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
  2913
     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
  2914
     for my description - used in the browser"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2915
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2916
    |indent|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2917
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2918
    indent := 0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2919
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2920
	indent := (superclass printHierarchyAnswerIndentOn:aStream) + 2
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2921
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2922
    aStream spaces:indent.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2923
    aStream nextPutAll:name; nextPutAll:' ('.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2924
    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
  2925
    aStream nextPutAll:')'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2926
    aStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2927
    ^ indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2928
!
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
printHierarchyOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2931
    "print my class hierarchy on aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2932
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2933
    self printHierarchyAnswerIndentOn:aStream
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
printInstVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2937
    "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
  2938
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2939
    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
  2940
!
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
printNameArray:anArray on:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2943
    "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
  2944
     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
  2945
     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
  2946
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2947
    |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
  2948
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2949
    arraySize := anArray size.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2950
    arraySize ~~ 0 ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2951
	pos := indent.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2952
	lenMax := aStream lineLength.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2953
	thisName := anArray at:1.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2954
	line := ''.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2955
	1 to:arraySize do:[:index |
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2956
	    line := line , thisName.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2957
	    pos := pos + thisName size.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2958
	    (index == arraySize) ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2959
		nextName := anArray at:(index + 1).
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2960
		mustBreak := false.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2961
		(lenMax > 0) ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2962
		    ((pos + nextName size) > lenMax) ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2963
			mustBreak := true
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2964
		    ]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2965
		].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2966
		mustBreak ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2967
		    aStream nextPutAll:line withTabs.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2968
		    aStream cr.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2969
		    spaces isNil ifTrue:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2970
			spaces := String new:indent
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2971
		    ].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2972
		    line := spaces.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2973
		    pos := indent
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2974
		] ifFalse:[
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2975
		    line := line , ' '.
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2976
		    pos := pos + 1
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2977
		].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2978
		thisName := nextName
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2979
	    ]
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2980
	].
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2981
	aStream nextPutAll:line withTabs
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2982
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2983
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2984
    "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
  2985
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2986
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2987
printOutCategory:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2988
    "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
  2989
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2990
    |dict any|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2991
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2992
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2993
    dict notNil ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2994
        any := false.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2995
        dict do:[:aMethod |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2996
            (aCategory = aMethod category) ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2997
                any := true
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2998
            ]
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2999
        ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3000
        any ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3001
             aPrintStream italic.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3002
             aPrintStream nextPutAll:aCategory.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3003
             aPrintStream normal.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3004
             aPrintStream cr; cr.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3005
             dict do:[:aMethod |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3006
                 (aCategory = aMethod category) ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3007
                     self printOutSource:(aMethod source) on:aPrintStream.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3008
                     aPrintStream cr; cr
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3009
                 ]
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3010
             ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3011
             aPrintStream cr
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3012
         ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3013
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3014
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3015
    "Modified: 12.6.1996 / 11:47:36 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3016
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3017
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3018
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3019
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3020
333
claus
parents: 328
diff changeset
  3021
    |comment s|
claus
parents: 328
diff changeset
  3022
claus
parents: 328
diff changeset
  3023
    aPrintStream nextPutAll:'class                '; bold; nextPutAll:name; normal; cr. 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3024
    aPrintStream nextPutAll:'superclass           '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3025
    superclass isNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  3026
	s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3027
    ] ifFalse:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  3028
	s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3029
    ].
333
claus
parents: 328
diff changeset
  3030
    aPrintStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3031
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3032
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3033
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3034
    self printInstVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3035
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3036
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3037
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3038
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3039
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3040
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3041
    category notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  3042
	aPrintStream nextPutAll:'category             '; nextPutAll:(category printString).
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  3043
	aPrintStream cr
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3044
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3045
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  3046
    (comment := self comment) notNil ifTrue:[
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  3047
	aPrintStream cr; nextPutAll:'comment:'; cr; italic; nextPutAll:comment; normal; cr
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3048
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3049
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3050
    "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
  3051
    "Modified: 10.12.1995 / 16:32:01 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3052
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3053
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3054
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3055
    "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
  3056
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3057
    |collectionOfCategories|
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
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3060
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3061
    collectionOfCategories := self class categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3062
    collectionOfCategories notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3063
	aPrintStream nextPutAll:'class protocol'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3064
	aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3065
	collectionOfCategories do:[:aCategory |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3066
	    self class printOutCategory:aCategory on:aPrintStream
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
    collectionOfCategories := self categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3070
    collectionOfCategories notNil ifTrue:[
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3071
	aPrintStream nextPutAll:'instance protocol'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3072
	aPrintStream cr; cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3073
	collectionOfCategories do:[:aCategory |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3074
	    self printOutCategory:aCategory on:aPrintStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3075
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3076
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3077
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3078
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3079
printOutSource:aString on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3080
    "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
  3081
     comments are printed italic"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3082
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3083
    |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
  3084
    text := aString asStringCollection.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3085
    aPrintStream bold.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3086
    aPrintStream nextPutAll:(text at:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3087
    aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3088
    aPrintStream cr.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3089
    inComment := false.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3090
    textSize := text size.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3091
    textIndex := 2.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3092
    [textIndex <= textSize] whileTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3093
	line := text at:textIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3094
	((line occurrencesOf:Character doubleQuote) == 0) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3095
	    aPrintStream nextPutAll:line
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3096
	] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3097
	    lineSize := line size.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3098
	    lineIndex := 1.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3099
	    [lineIndex <= lineSize] whileTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3100
		aCharacter := line at:lineIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3101
		(aCharacter == Character doubleQuote) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3102
		    inComment ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3103
			aPrintStream normal.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3104
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3105
			inComment := false
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3106
		    ] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3107
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3108
			aPrintStream italic.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3109
			inComment := true
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3110
		    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3111
		] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3112
		    aPrintStream nextPut:aCharacter
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3113
		].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3114
		lineIndex := lineIndex + 1
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3115
	    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3116
	].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3117
	aPrintStream cr.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3118
	textIndex := textIndex + 1
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3119
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3120
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3121
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3122
!Class methodsFor:'private changes management'!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3123
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3124
addChangeRecordForChangeCategory:category to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3125
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3126
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3127
    "append a category change record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3128
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3129
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3130
    aStream nextPutAll:(' category:' , category storeString).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3131
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3132
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3133
    "this test allows a smalltalk without Projects/ChangeSets"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3134
    Project notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3135
	Project addClassDefinitionChangeFor:self
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3136
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3137
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3138
    "Created: 3.12.1995 / 13:43:33 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3139
    "Modified: 3.12.1995 / 14:10:34 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3140
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3141
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3142
addChangeRecordForClass:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3143
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3144
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3145
    "append a class-definition-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3146
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3147
    aClass isLoaded ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3148
	aClass fileOutDefinitionOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3149
	aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3150
	Project notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3151
	    Project addClassDefinitionChangeFor:aClass 
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3152
	]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3153
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3154
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3155
    "Created: 3.12.1995 / 13:57:44 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3156
    "Modified: 3.12.1995 / 14:11:26 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3157
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3158
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3159
addChangeRecordForClassComment:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3160
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3161
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3162
    "append a class-comment-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3163
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3164
    aClass fileOutCommentOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3165
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3166
    "Modified: 4.3.1996 / 16:49:08 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3167
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3168
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3169
addChangeRecordForClassInstvars:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3170
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3171
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3172
    "append a class-instvars-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3173
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3174
    aClass fileOutClassInstVarDefinitionOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3175
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3176
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3177
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3178
addChangeRecordForClassRemove:oldName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3179
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3180
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3181
    "append a class-remove-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3182
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3183
    aStream nextPutAll:('Smalltalk removeClass:' , oldName).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3184
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3185
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3186
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3187
addChangeRecordForClassRename:oldName to:newName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3188
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3189
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3190
    "append a class-rename-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3191
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3192
    aStream nextPutAll:('Smalltalk renameClass:' , oldName , ' to:''' , newName , '''').
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3193
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3194
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3195
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3196
addChangeRecordForMethod:aMethod to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3197
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3198
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3199
    "append a method-change-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3200
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3201
    self fileOutMethod:aMethod on:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3202
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3203
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3204
addChangeRecordForMethodCategory:aMethod category:newCategory to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3205
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3206
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3207
    "append a methodCategory-change-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3208
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3209
    |selector|
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3210
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3211
    selector := aMethod selector.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3212
    selector notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3213
	aStream nextPutAll:'('.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3214
	self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3215
	aStream nextPutAll:(' compiledMethodAt:' , selector storeString).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3216
	aStream nextPutAll:(') category:' , newCategory storeString).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3217
	aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3218
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3219
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3220
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3221
addChangeRecordForMethodPrivacy:aMethod to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3222
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3223
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3224
    "append a method-privacy-change-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3225
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3226
    |selector|
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3227
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3228
    selector := aMethod selector.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3229
    selector notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3230
	aStream nextPutAll:'('.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3231
	self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3232
	aStream nextPutAll:(' compiledMethodAt:' , selector storeString).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3233
	aStream nextPutAll:(') privacy:' , aMethod privacy storeString).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3234
	aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3235
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3236
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3237
    "Modified: 27.8.1995 / 22:59:56 / claus"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3238
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3239
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3240
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3241
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3242
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3243
    "append a primitiveDefinitions-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3244
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3245
    aStream nextPutAll:aClass name; nextPutAll:' primitiveDefinitions:'''; cr; 
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3246
	    nextPutAll:(aClass primitiveDefinitionsString storeString copyFrom:2).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3247
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3248
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3249
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3250
addChangeRecordForPrimitiveFunctions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3251
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3252
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3253
    "append a primitiveFunctions-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3254
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3255
    aStream nextPutAll:aClass name; nextPutAll:' primitiveFunctions:'''; cr; 
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3256
	    nextPutAll:(aClass primitiveFunctionsString storeString copyFrom:2).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3257
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3258
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3259
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3260
addChangeRecordForPrimitiveVariables:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3261
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3262
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3263
    "append a primitiveVariables-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3264
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3265
    aStream nextPutAll:aClass name; nextPutAll:' primitiveVariables:'''; cr; 
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3266
	    nextPutAll:(aClass primitiveVariablesString storeString copyFrom:2).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3267
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3268
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3269
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3270
addChangeRecordForRemoveSelector:aSelector to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3271
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3272
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3273
    "append a method-remove-record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3274
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3275
    self printClassNameOn:aStream.
1509
fc4b99648f9f change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3276
    aStream nextPutAll:(' removeSelector:' , aSelector asSymbol storeString).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3277
    aStream nextPutChunkSeparator.
1509
fc4b99648f9f change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3278
fc4b99648f9f change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3279
    "Modified: 1.7.1996 / 21:27:55 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3280
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3281
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3282
addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3283
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3284
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3285
    "append a category-rename record to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3286
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3287
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3288
    aStream nextPutAll:(' renameCategory:' , oldCategory storeString).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3289
    aStream nextPutAll:(' to:' , newCategory storeString).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3290
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3291
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3292
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3293
addInfoRecord:aMessage to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3294
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3295
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3296
    "append an info-record (snapshot, class fileOut etc.) to aStream"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3297
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3298
    aStream nextPutAll:('''---- ' , aMessage , ' ',
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3299
			Date today printString , ' ' ,
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3300
			Time now printString ,
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3301
			' ----''').
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3302
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3303
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3304
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3305
writingChangeDo:aBlock
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3306
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3307
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3308
    "common helper to write a change record.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3309
     Opens the changefile and executes aBlock passing the stream
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3310
     as argument. WriteErrors are cought and will lead to a warning.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3311
     The changefile is not kept open, to force the change to go to disk
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3312
     as soon as possible - thus, in case of a crash, no changes should
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3313
     be lost due to buffering."
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3314
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3315
    self writingChangeWithTimeStamp:true do:aBlock
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3316
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3317
    "Modified: 18.11.1995 / 15:43:36 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3318
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3319
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3320
writingChangePerform:aSelector with:anArgument
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3321
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3322
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3323
    self writingChangeWithTimeStamp:true perform:aSelector with:anArgument
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3324
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3325
    "Created: 28.10.1995 / 16:50:48 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3326
    "Modified: 18.11.1995 / 15:44:53 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3327
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3328
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3329
writingChangeWithTimeStamp:doStampIt do:aBlock
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3330
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3331
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3332
    "common helper to write a change record.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3333
     Opens the changefile and executes aBlock passing the stream
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3334
     as argument. WriteErrors are cought and will lead to a warning.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3335
     The changefile is not kept open, to force the change to go to disk
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3336
     as soon as possible - thus, in case of a crash, no changes should
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3337
     be lost due to buffering."
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3338
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3339
    ChangeFileAccessLock critical:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3340
        |aStream|
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3341
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3342
        aStream := self changesStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3343
        aStream notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3344
            FileStream writeErrorSignal handle:[:ex |
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3345
                self warn:('could not update the changes-file\\' , ex errorString) withCRs.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3346
                ex return
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3347
            ] do:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3348
                doStampIt ifTrue:[self addChangeTimeStampTo:aStream].
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3349
                aBlock value:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3350
                aStream cr.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3351
            ].
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3352
            aStream close
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3353
        ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3354
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3355
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3356
    "Created: 18.11.1995 / 15:36:02 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3357
    "Modified: 21.3.1996 / 16:32:30 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3358
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3359
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3360
writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3361
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3362
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3363
    self writingChangeWithTimeStamp:stampIt do:[:stream |
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3364
	self perform:aSelector with:anArgument with:stream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3365
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3366
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3367
    "Created: 18.11.1995 / 15:44:28 / cg"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3368
! !
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3369
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3370
!Class methodsFor:'private helpers'!
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3371
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3372
addAllCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3373
    "helper - add categories and all superclasses categories
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3374
     to the argument, aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3375
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3376
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3377
	superclass addAllCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3378
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3379
    self addCategoriesTo:aCollection
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3380
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3381
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3382
addCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3383
    "helper - add categories to the argument, aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3384
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3385
    self methodDictionary do:[:aMethod |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3386
        |cat|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3387
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3388
        cat := aMethod category.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3389
        (aCollection includes:cat) ifFalse:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3390
            aCollection add:cat
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3391
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3392
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3393
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3394
    "Modified: 12.6.1996 / 11:46:24 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3395
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3396
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3397
askIfUpdatingChanges
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3398
    UpdateChangeFileQuerySignal isHandled ifFalse:[^ UpdatingChanges].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3399
    ^ UpdateChangeFileQuerySignal raise
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3400
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3401
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3402
getPrimitiveSpecsAt:index
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3403
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3404
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3405
    "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
  3406
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3407
    |pos stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3408
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3409
    primitiveSpec isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3410
    pos := primitiveSpec at:index.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3411
    pos isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3412
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3413
    "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
  3414
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3415
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3416
    pos isNumber ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3417
	classFilename notNil ifTrue:[
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3418
	    stream := self sourceStream. 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3419
	    stream notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3420
		stream position:pos+1.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3421
		string := stream nextChunk.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3422
		stream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3423
		^ string
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3424
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3425
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3426
	^ nil
544
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  3427
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3428
    ^ pos
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3429
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3430
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3431
setPrimitiveSpecsAt:index to:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3432
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3433
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3434
    "set a primitiveSpecification component to aString"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3435
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3436
    primitiveSpec isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3437
	primitiveSpec := Array new:3
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3438
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3439
    primitiveSpec at:index put:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3440
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3441
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3442
!Class methodsFor:'protocol printOut'!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3443
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3444
printOutCategoryProtocol:aCategory on:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3445
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3446
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3447
    |dict any|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3448
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3449
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3450
    dict notNil ifTrue:[
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3451
        any := false.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3452
        dict do:[:aMethod |
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3453
            (aCategory = aMethod category) ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3454
                any := true
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3455
            ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3456
        ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3457
        any ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3458
            aPrintStream italic.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3459
            aPrintStream nextPutAll:aCategory.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3460
            aPrintStream normal.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3461
            aPrintStream cr; cr.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3462
            dict do:[:aMethod |
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3463
                (aCategory = aMethod category) ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3464
                    self printOutMethodProtocol:aMethod on:aPrintStream.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3465
                    aPrintStream cr; cr
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3466
                ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3467
            ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3468
            aPrintStream cr
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3469
        ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3470
    ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3471
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3472
    "Modified: 20.4.1996 / 18:20:26 / cg"
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3473
    "Modified: 12.6.1996 / 11:48:46 / stefan"
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3474
!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3475
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3476
printOutMethodProtocol:aMethod on:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3477
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3478
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3479
    "given the source in aString, print the methods message specification
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3480
     and any method comments - without source; used to generate documentation
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3481
     pages"
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3482
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3483
    |text comment|
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3484
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3485
    text := aMethod source asStringCollection.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3486
    (text size < 1) ifTrue:[^self].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3487
    aPrintStream bold.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3488
    aPrintStream nextPutAll:(text at:1).
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3489
    aPrintStream cr.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3490
    (text size >= 2) ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3491
        (comment := aMethod comment) notNil ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3492
            aPrintStream italic.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3493
            aPrintStream spaces:((text at:2) indexOfNonSeparatorStartingAt:1).
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3494
            aPrintStream nextPutAll:aMethod comment.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3495
            aPrintStream cr.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3496
        ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3497
    ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3498
    aPrintStream normal
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3499
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3500
    "
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3501
      Float printOutProtocolOn:Stdout 
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3502
    "
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3503
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3504
    "Modified: 20.4.1996 / 17:54:50 / cg"
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3505
    "Created: 20.4.1996 / 18:20:31 / cg"
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3506
!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3507
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3508
printOutProtocolOn:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3509
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3510
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3511
    |collectionOfCategories|
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3512
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3513
    self printOutDefinitionOn:aPrintStream.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3514
    aPrintStream cr.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3515
    collectionOfCategories := self class categories.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3516
    collectionOfCategories notNil ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3517
        aPrintStream nextPutAll:'class protocol'.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3518
        aPrintStream cr; cr.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3519
        collectionOfCategories do:[:aCategory |
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3520
            self class printOutCategoryProtocol:aCategory on:aPrintStream
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3521
        ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3522
    ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3523
    collectionOfCategories := self categories.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3524
    collectionOfCategories notNil ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3525
        aPrintStream nextPutAll:'instance protocol'.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3526
        aPrintStream cr; cr.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3527
        collectionOfCategories do:[:aCategory |
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3528
            self printOutCategoryProtocol:aCategory on:aPrintStream
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3529
        ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3530
    ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3531
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3532
    "Modified: 20.4.1996 / 17:55:42 / cg"
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3533
! !
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3534
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3535
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3536
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3537
allCategories
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3538
    "Return a collection of all method-categories known in class
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3539
     and all superclasses. This does NOT include the metaclass categories.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3540
     The returned collection is not sorted by any order."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3541
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3542
    |coll|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3543
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3544
    coll := OrderedCollection new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3545
    self addAllCategoriesTo:coll.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3546
    ^ coll
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3547
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3548
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3549
     Point categories  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3550
     Point allCategories 
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3551
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3552
     Point class categories   
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3553
     Point class allCategories  
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3554
    "
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3555
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3556
    "Modified: 21.3.1996 / 16:28:57 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3557
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3558
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3559
categories
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3560
    "Return a collection of all method-categories known in the receiver class.
1193
5784d6b2b918 moved some protocol from Class to upper levels
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  3561
     This does NOT include the metaclasses categories or the superclass categories.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3562
     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
  3563
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3564
    |newList cat|
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3565
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3566
    newList := OrderedCollection new.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3567
    self methodDictionary do:[:aMethod |
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3568
        cat := aMethod category.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3569
        newList indexOf:cat ifAbsent:[newList add:cat]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3570
    ].
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3571
    ^ newList
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3572
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3573
    "
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3574
     Point categories    
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3575
     Point class categories  
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  3576
    "
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3577
1193
5784d6b2b918 moved some protocol from Class to upper levels
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  3578
    "Modified: 16.4.1996 / 18:06:11 / cg"
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3579
    "Modified: 12.6.1996 / 11:25:59 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3580
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3581
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3582
isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3583
    "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
  3584
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3585
     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
  3586
     See also Behavior>>isBehavior."
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
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3589
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3590
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3591
     Point isClass  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3592
     1 isClass      
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3593
     Behavior new isBehavior  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3594
     Behavior new isClass       
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3595
     Class new isBehavior    
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3596
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3597
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3598
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3599
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3600
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3601
    "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
  3602
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3603
     This is not an attribute of the class, but instead remembered in
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3604
     Autoload. The interface here is for your convenience."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3605
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3606
    ^ Autoload wasAutoloaded:self
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3607
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3608
    "Modified: 21.3.1996 / 16:27:09 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3609
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3610
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3611
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3612
    "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
  3613
     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
  3614
     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
  3615
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3616
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3617
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3618
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3619
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3620
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3621
	(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3622
	cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3623
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3624
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3625
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3626
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3627
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3628
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3629
    "
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3630
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3631
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3632
whichClassDefinesInstVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3633
    "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
  3634
     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
  3635
     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
  3636
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3637
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3638
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3639
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3640
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3641
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3642
	(cls instVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3643
	cls := cls superclass
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3644
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3645
    ^ nil
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
     StandardSystemView whichClassDefinesInstVar:'label'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3649
     StandardSystemView whichClassDefinesInstVar:'paint'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3650
     StandardSystemView whichClassDefinesInstVar:'foo'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3651
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3652
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3653
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
  3654
!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
  3655
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3656
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
  3657
    "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
  3658
     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
  3659
     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
  3660
     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
  3661
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3662
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3663
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3664
    (owner := self owningClass) notNil ifTrue:[^ owner binaryRevision].
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3665
    self isMeta ifTrue:[
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3666
        ^ self soleInstance binaryRevision
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3667
    ].
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
  3668
    ^ 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
  3669
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3670
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3671
     Object binaryRevision
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3672
     Object class binaryRevision
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3673
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3674
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3675
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3676
     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
  3677
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3678
     |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
  3679
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3680
     classes := Smalltalk allClasses 
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3681
                    select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3682
     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
  3683
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3684
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3685
    "Created: 7.12.1995 / 10:58:47 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3686
    "Modified: 15.10.1996 / 18:55:28 / 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
  3687
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3688
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3689
packageSourceCodeInfo
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3690
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3691
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
  3692
    "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
  3693
     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
  3694
     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
  3695
     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
  3696
     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
  3697
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3698
     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
  3699
     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
  3700
     If no such info is present in the class, nil is returned.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3701
     (this happens with autoloaded and filed-in classes)
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3702
     Auotloaded classes set their package from the revisionInfo, if present.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3703
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3704
     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
  3705
     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
  3706
     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
  3707
     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
  3708
     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
  3709
     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
  3710
     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
  3711
     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
  3712
     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
  3713
     (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
  3714
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3715
     For example: 
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3716
        '....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3717
        '....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3718
        '....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3719
        '....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase 
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3720
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3721
     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
  3722
     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
  3723
     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
  3724
     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
  3725
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3726
     Caveat:
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3727
        Encoding this info in the package string seems somewhat kludgy.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3728
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3729
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3730
    |owner sourceInfo packageString idx1 idx2 
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
  3731
     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
  3732
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3733
    (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3734
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
  3735
    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
  3736
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3737
    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
  3738
    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
  3739
    idx1 ~~ 0 ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3740
        idx2 := packageString indexOf:$) startingAt:idx1+1.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3741
        idx2 ~~ 0 ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3742
            sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3743
        ]
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
  3744
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3745
    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
  3746
    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
  3747
    components size == 0 ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3748
        moduleString := 'stx'.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3749
        directoryString := libraryString := ''.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3750
        ^ 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
  3751
    ] ifFalse:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3752
        components size == 1 ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3753
            "/ a single name given - the module becomes 'stx',
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3754
            "/ if the component includes slashes, its the directory
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3755
            "/ otherwise the library
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3756
            "/ 
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3757
            moduleString := 'stx'.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3758
            directoryString := libraryString := components at:1.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3759
            (libraryString includes:$/) ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3760
                libraryString := libraryString asFilename baseName
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3761
            ]
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3762
        ] ifFalse:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3763
            components size == 2 ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3764
                "/ two components - assume its the module and the directory; 
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3765
                "/ the library is assumed to be named after the directory
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3766
                "/ except, if slashes are in the name; then the libraryname
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3767
                "/ is the last component.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3768
                "/
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3769
                moduleString := components at:1.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3770
                directoryString := libraryString := components at:2.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3771
                (libraryString includes:$/) ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3772
                    libraryString := libraryString asFilename baseName
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3773
                ]
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3774
            ] ifFalse:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3775
                "/ all components given
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3776
                moduleString := components at:1.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3777
                directoryString := components at:2.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3778
                libraryString := components at:3.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3779
            ]
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3780
        ]
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
  3781
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3782
    libraryString isEmpty ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3783
        directoryString notEmpty ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3784
            libraryString := directoryString asFilename baseName
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3785
        ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3786
        libraryString isEmpty ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3787
            "/ lets extract the library from the liblist file ...
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3788
            libraryString := Smalltalk libraryFileNameOfClass:self.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3789
            libraryString isNil ifTrue:[^ nil].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3790
        ]
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
  3791
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3792
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3793
    moduleString isEmpty ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3794
        moduleString := 'stx'.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3795
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3796
    directoryString isEmpty ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3797
        directoryString := libraryString.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3798
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3799
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3800
    ^ IdentityDictionary
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3801
        with:(#module->moduleString)
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3802
        with:(#directory->directoryString)
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3803
        with:(#library->libraryString)
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3804
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3805
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3806
     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
  3807
     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
  3808
     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
  3809
     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
  3810
     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
  3811
     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
  3812
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3813
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3814
    "Created: 4.11.1995 / 20:36:53 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3815
    "Modified: 15.10.1996 / 18:56:03 / 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
  3816
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3817
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3818
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
  3819
    "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
  3820
     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
  3821
     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
  3822
     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
  3823
     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
  3824
     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
  3825
     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
  3826
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3827
    |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
  3828
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3829
    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
  3830
    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
  3831
	^ 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
  3832
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3833
    ^ 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
  3834
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3835
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3836
     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
  3837
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3838
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3839
    "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
  3840
    "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
  3841
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3842
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3843
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
  3844
    "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
  3845
     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
  3846
     The revisionInfo contains all or a subset of:
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3847
        #binaryRevision - the revision upon which the binary of this class is based
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3848
        #revision       - the revision upon which the class is based logically
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3849
                          (different, if a changed class was checked in, but not yet recompiled)
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3850
        #user           - the user who checked in the logical revision
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3851
        #date           - the date when the logical revision was checked in
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3852
        #time           - the time when the logical revision was checked in
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3853
        #fileName       - the classes source file name
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3854
        #repositoryPath - the classes source container
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3855
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3856
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3857
    |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
  3858
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3859
    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
  3860
    vsnString notNil ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3861
        info := Class revisionInfoFromString:vsnString.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3862
        info notNil ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3863
            info at:#binaryRevision put:revision.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3864
        ]
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
  3865
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3866
    ^ 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
  3867
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3868
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3869
     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
  3870
     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
  3871
     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
  3872
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3873
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3874
    "Created: 11.11.1995 / 14:27:20 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3875
    "Modified: 15.10.1996 / 18:56:44 / 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
  3876
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3877
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3878
revisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3879
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3880
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
  3881
    "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
  3882
     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
  3883
     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
  3884
     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
  3885
     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
  3886
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3887
    |owner cls meta m src val|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3888
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3889
    (owner := self owningClass) notNil ifTrue:[^ owner revisionString].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3890
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3891
    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
  3892
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3893
    self isMeta ifTrue:[
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3894
        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
  3895
    ] ifFalse:[
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3896
        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
  3897
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3898
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3899
    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
  3900
    m isNil ifTrue:[
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3901
        m := cls compiledMethodAt:#version.
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3902
        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
  3903
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3904
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3905
    m isExecutable ifTrue:[
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3906
        "/
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3907
        "/ if its a method returning the string,
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3908
        "/ thats the returned value
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3909
        "/
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3910
        val := cls version.
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3911
        val isString ifTrue:[^ val].
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  3912
    ].
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
  3913
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3914
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3915
    "/ 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
  3916
    "/ 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
  3917
    "/ 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
  3918
    "/ 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
  3919
    "/ 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
  3920
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3921
    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
  3922
    src isNil ifTrue:[^ nil].
1811
8afb43250471 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
  3923
    ^ Class revisionStringFromSource:src 
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3924
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3925
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3926
     Smalltalk allClassesDo:[:cls |
1422
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
  3927
        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
  3928
     ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3929
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3930
     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
  3931
     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
  3932
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3933
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3934
    "Created: 29.10.1995 / 19:28:03 / cg"
1811
8afb43250471 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
  3935
    "Modified: 23.10.1996 / 18:23:56 / 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
  3936
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3937
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3938
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
  3939
    "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
  3940
     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
  3941
     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
  3942
     (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
  3943
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3944
    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
  3945
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3946
    "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
  3947
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3948
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3949
setPackageFromRevision
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3950
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3951
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3952
    "set my package from the info found in the revisionString if present.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3953
     This is used to set some useful packageInfo after autoloading
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3954
     (otherwise, autoloaded classes/methods would go into your current
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3955
      package - which is probably not a good idea)"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3956
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3957
    |info mgr dir lib mod p|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3958
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  3959
    self owningClass notNil ifTrue:[^ self].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  3960
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3961
    mgr := self sourceCodeManager.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3962
    mgr notNil ifTrue:[
1430
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3963
        info := mgr sourceInfoOfClass:self
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3964
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3965
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  3966
    info notNil ifTrue:[
1430
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3967
        mod := info at:#module ifAbsent:nil.    "/ stx, aeg, <your-organization>
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3968
        dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ...
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3969
        lib := info at:#library ifAbsent:dir.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3970
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3971
        p := ''.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3972
        mod notNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3973
            mod ~= 'stx' ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3974
                p := p , mod
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3975
            ]
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3976
        ].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3977
        dir notNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3978
            p notEmpty ifTrue:[p := p , ':'].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3979
            p := p , dir.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3980
        ].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3981
        lib notNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3982
            lib ~= dir ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3983
                p notEmpty ifTrue:[p := p , ':'].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3984
                p := p , lib.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3985
            ]
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3986
        ].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3987
        p notEmpty ifTrue:[
1661
3d9c07c3390d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1658
diff changeset
  3988
"/            p := '(' , p , ')'.
1430
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3989
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3990
            package notNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3991
                (name , ': changing packageID to ''' , p , '''') infoPrintCR.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3992
            ].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3993
            package := p.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3994
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3995
            self methodDictionary do:[:aMethod |
1430
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3996
                aMethod package isNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3997
                    aMethod package:p
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3998
                ]
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  3999
            ]
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4000
        ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4001
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4002
    ^ self
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4003
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4004
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4005
     MemoryMonitor autoload.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4006
     MemoryMonitor setPackageFromRevision
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4007
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4008
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4009
    "Modified: 12.6.1996 / 11:49:31 / stefan"
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4010
    "Modified: 15.10.1996 / 19:38:24 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4011
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4012
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
  4013
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
  4014
    "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
  4015
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4016
    |owner source cls|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4017
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4018
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStream].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4019
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4020
    self isMeta ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4021
        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
  4022
    ] ifFalse:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4023
        cls := self
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
  4024
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4025
    classFilename notNil ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4026
        source := classFilename
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4027
    ] ifFalse:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4028
        source := (Smalltalk fileNameForClass:cls) , '.st'
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4029
    ].
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4030
    ^ cls sourceStreamFor:source
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4031
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4032
    "Modified: 15.10.1996 / 18:59:40 / cg"
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4033
!
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4034
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4035
sourceStreamFor:source
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4036
    "return an open stream on a sourcefile, nil if that is not available"
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4037
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4038
    |owner fileName aStream mgr|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4039
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4040
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor: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
  4041
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4042
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4043
    "/ if there is no SourceCodeManager, 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4044
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4045
    "/ 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
  4046
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4047
    ((mgr := self sourceCodeManager) isNil 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4048
    or:[TryLocalSourceFirst == true]) ifTrue:[
1712
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4049
        fileName := Smalltalk getSourceFileName:source.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4050
        fileName notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4051
            aStream := fileName asFilename readStream.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4052
        ]
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
  4053
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4054
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4055
    aStream isNil ifTrue:[
1712
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4056
        "/      
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4057
        "/ hard case - there is no source file for this class
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4058
        "/ (in the source-dir-path).
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4059
        "/      
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4060
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4061
        "/      
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4062
        "/ look if my binary is from a dynamically loaded module,
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4063
        "/ and, if so, look in the modules directory for the
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4064
        "/ source file.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4065
        "/      
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4066
        ObjectFileLoader notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4067
            ObjectFileLoader loadedObjectHandlesDo:[:h |
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4068
                |f classes|
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4069
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4070
                aStream isNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4071
                    (classes := h classes) notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4072
                        (classes includes:self) ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4073
                            f := h pathName.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4074
                            f := f asFilename directory.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4075
                            f := f construct:source.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4076
                            f exists ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4077
                                aStream := f readStream.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4078
                            ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4079
                        ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4080
                    ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4081
                ]
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4082
            ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4083
        ].
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
  4084
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4085
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4086
    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
  4087
1712
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4088
        "/ mhmh - still no source file.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4089
        "/ If there is a SourceCodeManager, ask it to aquire the
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4090
        "/ the source for my class, and return an open stream on it. 
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4091
        "/ if that one does not know about the source, look in
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4092
        "/ standard places
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4093
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4094
        mgr notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4095
            aStream := mgr getSourceStreamFor:self.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4096
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4097
            (self validateSourceStream:aStream) ifFalse:[
1779
4dba26f3765d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  4098
                ('CLASS: repositories source for `' 
4dba26f3765d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  4099
                 , (self isMeta ifTrue:[self soleInstance name]
4dba26f3765d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  4100
                                ifFalse:[name])
4dba26f3765d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  4101
                 , ''' is invalid') infoPrintCR.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4102
                aStream close.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4103
                aStream := nil
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4104
            ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4105
1712
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4106
            aStream isNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4107
                fileName := Smalltalk getSourceFileName:source.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4108
                fileName notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4109
                    aStream := fileName asFilename readStream.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4110
                ]
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4111
            ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4112
        ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4113
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4114
        "/
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4115
        "/ final chance: try current directory
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4116
        "/
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4117
        aStream isNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4118
            aStream := source asFilename readStream.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4119
        ].
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
  4120
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4121
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4122
    ^ 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
  4123
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4124
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4125
     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
  4126
     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
  4127
     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
  4128
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4129
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4130
    "Created: 10.11.1995 / 21:05:13 / cg"
1779
4dba26f3765d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  4131
    "Modified: 18.10.1996 / 13:28:29 / 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
  4132
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4133
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4134
updateVersionMethodFor:newRevisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4135
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4136
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
  4137
    "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
  4138
     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
  4139
986
c3a9f590146d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
  4140
    |cls "vs m mgr"|
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4141
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4142
    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
  4143
    self isMeta ifFalse:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4144
        cls := self class
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4145
    ].
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4146
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
  4147
"/    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
  4148
"/    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
  4149
"/    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
  4150
"/    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
  4151
"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4152
"/    (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
  4153
"/    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
  4154
"/    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
  4155
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4156
    Class withoutUpdatingChangesDo:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4157
        Compiler compile:'version
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4158
    ^ ''' , 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
  4159
'
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4160
                 forClass:cls inCategory:#documentation notifying:nil 
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4161
                     install:true skipIfSame:false silent:true. 
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
  4162
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4163
"/ ('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
  4164
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4165
    ^ 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
  4166
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4167
    "Created: 7.12.1995 / 20:42:22 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4168
    "Modified: 15.10.1996 / 18:59:58 / cg"
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4169
!
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4170
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4171
validateSourceStream:aStream
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4172
    "check if aStream really contains my source.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4173
     This is done by checking the version methods return value
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4174
     against the version string as contained in the version method"
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4175
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4176
    |cls meta cannotCheckReason versionMethod info
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4177
     versionFromCode versionFromSource oldPos pos src rev|
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4178
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4179
    self isMeta ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4180
        meta := self. cls := self soleInstance
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4181
    ] ifFalse:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4182
        cls := self. meta := self class
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4183
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4184
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4185
    cannotCheckReason := nil.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4186
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4187
    versionMethod := meta compiledMethodAt:#version.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4188
    (versionMethod isNil 
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4189
    or:[versionMethod isExecutable not]) ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4190
        versionMethod := cls compiledMethodAt:#version.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4191
        (versionMethod isNil
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4192
        or:[versionMethod isExecutable not]) ifTrue:[
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4193
            cannotCheckReason := 'no version method'.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4194
        ]
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4195
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4196
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4197
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4198
    "/ if its a method returning the string,
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4199
    "/ thats the returned value
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4200
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4201
    versionFromCode := cls version.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4202
    versionFromCode isString ifFalse:[
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4203
        cannotCheckReason := 'version method does not return a string'
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4204
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4205
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4206
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4207
    "/ if its a method consisting of a comment only
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4208
    "/ extract it - this may lead to a recursive call
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4209
    "/ to myself (thats what the #isRecursive is for)
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4210
    "/ in case we need to access the source code manager
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4211
    "/ for the source ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4212
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4213
    pos := versionMethod sourcePosition.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4214
    pos isInteger ifFalse:[
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4215
        "/ mhmh - either no version method,
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4216
        "/ or updated due to a checkin.
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4217
        "/ in any case, this should be a good source.
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4218
        ^ true.
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4219
        "/ cannotCheckReason := 'no source position for version-method'
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4220
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4221
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4222
    cannotCheckReason notNil ifTrue:[
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4223
        ('CLASS: ' , cannotCheckReason) infoPrintCR.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4224
        'CLASS: cannot validate source; trusting source' infoPrintCR.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4225
        ^ true
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4226
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4227
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4228
    oldPos := aStream position.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4229
    aStream position:pos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4230
    src := aStream nextChunk.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4231
    aStream position:oldPos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4232
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4233
    (src isNil or:[src isEmpty]) ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4234
"/ 'empty source for version-method' printCR.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4235
        ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4236
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4237
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4238
    versionFromSource := Class revisionStringFromSource:src.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4239
    versionFromSource = versionFromCode ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4240
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  4241
    versionFromSource isNil ifTrue:[^ false].
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  4242
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4243
    "/ mhmh - check my binary version ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4244
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4245
    info := Class revisionInfoFromString:versionFromSource.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4246
    info notNil ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4247
        rev := info at:#revision.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4248
        rev = self binaryRevision ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4249
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4250
    ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4251
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  4252
    "Modified: 18.10.1996 / 21:56:21 / 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
  4253
! !
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4254
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4255
!Class class methodsFor:'documentation'!
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4256
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4257
version
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4258
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.199 1996-10-29 23:37:41 cg Exp $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  4259
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4260
Class initialize!