Class.st
author ca
Tue, 01 Apr 1997 18:05:27 +0200
changeset 2516 b99fff48c6c6
parent 2500 c217e646447e
child 2544 c3a2791de289
permissions -rw-r--r--
flush cached environment, when name changes
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
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
    14
	instanceVariableNames:'classvars comment subclasses classFilename package revision
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
    15
		environment 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
    16
	classVariableNames:'UpdatingChanges LockChangesFile FileOutErrorSignal
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
    17
		CatchMethodRedefinitions MethodRedefinitionSignal
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
    18
		UpdateChangeFileQuerySignal TryLocalSourceFirst
1915
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
    19
		ChangeFileAccessLock NameSpaceQuerySignal PackageQuerySignal
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
    20
		UsedNameSpaceQuerySignal CreateNameSpaceQuerySignal OldMethods
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
    21
		FileOutNameSpaceQuerySignal'
741
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    22
	poolDictionaries:''
c6b4e7f026be dont crash in #revision if info is there, but has no revision field
Claus Gittinger <cg@exept.de>
parents: 740
diff changeset
    23
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    24
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    25
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    26
!Class class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    27
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    28
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    29
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    30
 COPYRIGHT (c) 1989 by Claus Gittinger
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    31
	       All Rights Reserved
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    32
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    33
 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
    34
 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
    35
 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
    36
 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
    37
 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
    38
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    39
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    40
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    41
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    42
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    43
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    44
    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
    45
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    46
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    47
    Also change management and recompilation is defined here (since the superclasses
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    48
    do not have enough symbolic information to support compilation).
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    49
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    50
    [Instance variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    51
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    52
        classvars       <String>        the names of the class variables
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    53
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    54
        comment         <String>        the classes comment; either a string,
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    55
                                        a number specifying the offset in classFilename, or nil
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    56
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    57
        subclasses      <Collection>    cached collection of subclasses
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    58
                                        (currently unused - but will be soon)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    59
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    60
        classFilename   <String>        the file (or nil) where the classes
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    61
                                        sources are found 
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    62
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    63
        package         <Symbol>        the package, in which the class was defined
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    64
                                        (inserted by compilers)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    65
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    66
        revision        <String>        revision string - inserted by stc
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    67
1711
3bea87e918cd nope - privateClasses was no good idea;
Claus Gittinger <cg@exept.de>
parents: 1709
diff changeset
    68
        hook            <any>           reserved: a place to add additional attributes,
1807
202f0af2c2e1 commentary
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
    69
                                        without a need to recompile all classes.
202f0af2c2e1 commentary
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
    70
                                        Currently unused.
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    71
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    72
    [Class variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    73
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    74
        UpdatingChanges <Boolean>       true if the changes-file shall be updated
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    75
                                        (except during startup and when filing in, this flag
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    76
                                         is usually true)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    77
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    78
        UpdateChangeFileQuerySignal     used as an upQuery from the change management.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    79
                                        Whenever a changeRecord is to be written,
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    80
                                        this signal is raised and a handler (if present)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    81
                                        is supposed to return true or false.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    82
                                        If unhandled, the value of the global
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    83
                                        UpdatingChanges is returned for backward
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    84
                                        compatibility (which means that the old
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    85
                                        mechanism is used if no query-handler
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    86
                                        is present).
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    87
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    88
        LockChangesFile <Boolean>       if true, the change file is locked for updates.
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    89
                                        Required when multiple users operate on a common
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    90
                                        change file.
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    91
                                        This is an experimental new feature, being evaluated.
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    92
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    93
        FileOutErrorSignal              raised when an error occurs during fileOut
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    94
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    95
        CatchMethodRedefinitions        if true, classes protect themself 
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    96
        MethodRedefinitionSignal        (by raising MethodRedefinitionSignal)
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    97
                                        from redefining any existing methods,
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    98
                                        which are defined in another package.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    99
                                        (i.e. a signal will be raised, if you
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   100
                                         fileIn something which redefines an
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   101
                                         existing method and the packages do not
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   102
                                         match).
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   103
                                        The default is (currently) true.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   104
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   105
        TryLocalSourceFirst             If true, local source files are tried
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   106
                                        first BEFORE the sourceCodeManager is
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   107
                                        consulted. If false, the sourceCodeManager
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   108
                                        is asked first.
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   109
                                        Should be turned on, if you run an image from
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   110
                                        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
   111
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   112
        NameSpaceQuerySignal            used as an upQuery to ask for a namespace into
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   113
                                        which new classes are to be installed.
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   114
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   115
        PackageQuerySignal              used as an upQuery to ask for a packageSymbol with
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   116
                                        which new classes/methods are to be marked.
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   117
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   118
        CreateNameSpaceQuerySignal      used as an upQuery to ask if unknown namespaces
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   119
                                        should be silently created (without asking the user)
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   120
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   121
        OldMethods                      if nonNil, this must be an IdentityDictionary,
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   122
                                        which is filled with method->previousversionMethod
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   123
                                        associations. Can be used for undo-last-method-change
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   124
                                        Notice: this may fillup your memory over time.
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   125
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   126
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   127
    WARNING: layout known by compiler and runtime system
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   128
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   129
    [author:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   130
        Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   131
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   132
    [see also:]
1807
202f0af2c2e1 commentary
Claus Gittinger <cg@exept.de>
parents: 1802
diff changeset
   133
        Behavior ClassDescription Metaclass
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   134
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   135
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   136
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   137
!Class class methodsFor:'initialization'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   138
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   139
initialize
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   140
    "the classvariable 'UpdatingChanges' controls if changes are put
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   141
     into the changes-file; normally this variable is set to true, but
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   142
     (for example) during fileIn or when changes are applied, it is set to false
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   143
     to avoid putting too much junk into the changes-file."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   144
     
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   145
    UpdatingChanges := true.
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
   146
    LockChangesFile := false.
362
claus
parents: 360
diff changeset
   147
    CatchMethodRedefinitions := true.
909
e20934aa134e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 906
diff changeset
   148
    TryLocalSourceFirst := false.
362
claus
parents: 360
diff changeset
   149
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   150
    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
   151
        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
   152
        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
   153
        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
   154
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   155
        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
   156
        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
   157
        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
   158
2020
a561439fa03c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   159
        UpdateChangeFileQuerySignal := QuerySignal new.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   160
        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
   161
        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
   162
        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
   163
2020
a561439fa03c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   164
        NameSpaceQuerySignal := QuerySignal new.
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   165
        NameSpaceQuerySignal nameClass:self message:#nameSpaceQuerySignal.
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   166
        NameSpaceQuerySignal notifierString:'asking for nameSpace'.
2003
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   167
        NameSpaceQuerySignal handlerBlock:[:ex | ex proceedWith:Smalltalk defaultNameSpace].
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   168
2020
a561439fa03c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   169
        UsedNameSpaceQuerySignal := QuerySignal new.
2003
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   170
        UsedNameSpaceQuerySignal nameClass:self message:#usedNameSpaceQuerySignal.
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   171
        UsedNameSpaceQuerySignal notifierString:'asking for used nameSpaced'.
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   172
2020
a561439fa03c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   173
        CreateNameSpaceQuerySignal := QuerySignal new.
1915
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   174
        CreateNameSpaceQuerySignal nameClass:self message:#createNameSpaceQuerySignal.
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   175
        CreateNameSpaceQuerySignal notifierString:'asking for nameSpace creation'.
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
   176
        CreateNameSpaceQuerySignal defaultAnswer:false.
1915
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   177
2020
a561439fa03c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   178
        PackageQuerySignal := QuerySignal new.
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   179
        PackageQuerySignal nameClass:self message:#packageQuerySignal.
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   180
        PackageQuerySignal notifierString:'asking for package'.
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   181
        PackageQuerySignal handlerBlock:[:ex | ex proceedWith:(Project isNil 
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   182
                                                                    ifTrue:[
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   183
                                                                        'no package'
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   184
                                                                    ] ifFalse:[
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   185
                                                                        Project currentPackageName
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   186
                                                                    ])].
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   187
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
   188
        FileOutNameSpaceQuerySignal := QuerySignal new.
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
   189
        FileOutNameSpaceQuerySignal defaultAnswer:false.
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
   190
2262
4c4d810f006f semaphore names
Claus Gittinger <cg@exept.de>
parents: 2256
diff changeset
   191
        ChangeFileAccessLock := Semaphore forMutualExclusion name:'ChangeFileAccessLock'.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   192
    ]
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   193
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
   194
    "Modified: 3.1.1997 / 15:16:05 / cg"
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   195
! !
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   196
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   197
!Class class methodsFor:'Signal constants'!
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   198
1915
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   199
createNameSpaceQuerySignal
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   200
    "return the signal used as an upQuery if a new nameSpace should be
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   201
     silently created without user confirmation.
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   202
     Only used when installing autoloaded classes"
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   203
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   204
    ^ CreateNameSpaceQuerySignal
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   205
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   206
    "Created: 7.11.1996 / 12:55:01 / cg"
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   207
!
c3ca595d0846 added createNameSpaceQuerySignal
Claus Gittinger <cg@exept.de>
parents: 1909
diff changeset
   208
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   209
fileOutErrorSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   210
    "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
   211
     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
   212
     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
   213
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   214
    ^ FileOutErrorSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   215
!
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
methodRedefinitionSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   218
    "return the signal raised when a method is about to be installed
362
claus
parents: 360
diff changeset
   219
     which redefines an existing method and the methods packages are not
claus
parents: 360
diff changeset
   220
     equal. This helps when filing in alien code, to prevent existing
claus
parents: 360
diff changeset
   221
     methods to be overwritten or redefined by incompatible methods"
claus
parents: 360
diff changeset
   222
claus
parents: 360
diff changeset
   223
    ^ MethodRedefinitionSignal
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   224
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   225
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   226
nameSpaceQuerySignal
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   227
    "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
   228
     Will be used when filing in code"
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   229
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   230
    ^ NameSpaceQuerySignal
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   231
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   232
    "
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   233
     Transcript showCR:Class nameSpaceQuerySignal raise
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   234
    "
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   235
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   236
    "Modified: 5.11.1996 / 20:08:38 / cg"
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   237
!
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   238
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   239
packageQuerySignal
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   240
    "return the signal used as an upQuery for the current packages name.
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   241
     Will be used when filing in code"
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   242
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   243
    ^ PackageQuerySignal
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   244
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   245
    "
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   246
     Transcript showCR:Class packageQuerySignal raise
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   247
    "
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   248
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   249
    "Created: 5.11.1996 / 20:07:22 / cg"
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   250
    "Modified: 5.11.1996 / 20:08:35 / cg"
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   251
!
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   252
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   253
updateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   254
    "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
   255
     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
   256
     static handler."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   257
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   258
    ^ UpdateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   259
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   260
    "
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   261
     Transcript showCR:Class updateChangeFileQuerySignal raise
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   262
    "
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
   263
1895
f91b76019bf0 fixes for package query
Claus Gittinger <cg@exept.de>
parents: 1876
diff changeset
   264
    "Modified: 5.11.1996 / 20:08:44 / cg"
2003
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   265
!
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   266
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   267
usedNameSpaceQuerySignal
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   268
    "return the signal used as an upQuery for the used nameSpace.
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   269
     Will be used when filing in code"
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   270
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   271
    ^ UsedNameSpaceQuerySignal
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   272
453ab548bd52 prepare for 'Uses:' directive
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   273
    "Created: 19.12.1996 / 23:57:27 / cg"
362
claus
parents: 360
diff changeset
   274
! !
claus
parents: 360
diff changeset
   275
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   276
!Class class methodsFor:'accessing - flags'!
362
claus
parents: 360
diff changeset
   277
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   278
catchMethodRedefinitions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   279
    "return the redefinition catching flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   280
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   281
    ^ CatchMethodRedefinitions
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   282
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   283
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   284
catchMethodRedefinitions:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   285
    "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
   286
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   287
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   288
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   289
    prev := CatchMethodRedefinitions.
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   290
    CatchMethodRedefinitions := aBoolean.
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   291
    ^ prev
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   292
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   293
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   294
keepMethodHistory:aBoolean
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   295
    "turn on/off oldMethod remembering. If on, a methods previous version
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   296
     is kept locally, for later undo (or compare)."
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   297
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   298
    aBoolean ifTrue:[
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   299
        OldMethods isNil ifTrue:[
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   300
            OldMethods := IdentityDictionary new.
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   301
        ]
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   302
    ] ifFalse:[
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   303
        OldMethods := nil
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   304
    ].
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   305
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   306
    "
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   307
     Class keepMethodHistory:true
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   308
     Class keepMethodHistory:false
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   309
    "
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   310
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   311
    "Modified: 7.11.1996 / 18:36:00 / cg"
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   312
    "Created: 7.11.1996 / 19:05:57 / cg"
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   313
!
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
   314
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   315
lockChangesFile
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   316
    "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
   317
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   318
    ^ LockChangesFile
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   319
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   320
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   321
lockChangesFile:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   322
    "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
   323
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   324
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   325
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   326
    prev := LockChangesFile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   327
    LockChangesFile := aBoolean.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   328
    ^ prev
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   329
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   330
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   331
tryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   332
    ^ TryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   333
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   334
    "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
   335
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   336
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   337
tryLocalSourceFirst:aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   338
    TryLocalSourceFirst := aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   339
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   340
    "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
   341
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   342
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   343
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   344
    "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
   345
     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
   346
     decide to return something else."
362
claus
parents: 360
diff changeset
   347
claus
parents: 360
diff changeset
   348
    |prev|
claus
parents: 360
diff changeset
   349
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   350
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   351
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   352
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   353
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   354
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   355
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   356
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   357
     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
   358
     decide to return something else."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   359
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   360
    ^ UpdatingChanges
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   361
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   362
1924
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   363
!Class class methodsFor:'accessing - history'!
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   364
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   365
flushMethodHistory
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   366
    "flush any method->previousVersion associations,
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   367
     all history is lost."
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   368
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   369
    OldMethods notNil ifTrue:[
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   370
        OldMethods := IdentityDictionary new
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   371
    ].
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   372
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   373
    "Created: 7.11.1996 / 19:07:25 / cg"
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   374
!
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   375
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   376
methodHistory
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   377
    "return a dictionary containing method->previousVersion associations,
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   378
     nil if method remembering has been turned off"
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   379
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   380
    ^ OldMethods 
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   381
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   382
    "
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   383
     Class oldMethods
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   384
    "
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   385
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   386
    "Modified: 7.11.1996 / 18:36:00 / cg"
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   387
    "Created: 7.11.1996 / 19:06:28 / cg"
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   388
! !
0103d478f8a4 added flush for history
Claus Gittinger <cg@exept.de>
parents: 1923
diff changeset
   389
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   390
!Class class methodsFor:'enumeration '!
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   391
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   392
allClassesInCategory:aCategory do:aBlock
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   393
    "evaluate aBlock for all classes in aCategory;
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   394
     no specific order is defined."
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   395
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
   396
    Smalltalk allBehaviorsDo:[:aClass |
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   397
	aClass isMeta ifFalse:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   398
	    (aClass category = aCategory) ifTrue:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   399
		aBlock value:aClass
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   400
	    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   401
	].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   402
    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   403
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   404
    "
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   405
     Class allClassesInCategory:'Kernel-Classes' 
1422
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
   406
			     do:[:class |Transcript showCR:class name]
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   407
    "
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   408
!
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   409
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   410
allClassesInCategory:aCategory inOrderDo:aBlock
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   411
    "evaluate aBlock for all classes in aCategory;
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   412
     superclasses come first - then subclasses."
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   413
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   414
    |classes|
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   415
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   416
    classes := OrderedCollection new.
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
   417
    Smalltalk allBehaviorsDo:[:aClass |
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   418
	aClass isMeta ifFalse:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   419
	    (aClass category = aCategory) ifTrue:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   420
		classes add:aClass
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   421
	    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   422
	]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   423
    ].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   424
    classes topologicalSort:[:a :b | b isSubclassOf:a].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   425
    classes do:aBlock
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   426
! !
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   427
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   428
!Class class methodsFor:'helpers'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   429
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   430
revisionInfoFromString:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   431
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   432
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   433
    "return a dictionary filled with revision info.
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   434
     This extracts the relevant info from aString, asking
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   435
     the sourceCode manager (if there is one)"
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   436
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   437
    "
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   438
     For now, this is a bad design - since the sourceCodeManager
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   439
     is not always delivered, here, a fallBack is provided.
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   440
     (should probably deliver some RCS-header extractor in any case,
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   441
      even if no AbstractSourceCodeManager is present)
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   442
     (knowing about the details of RCS headers here is a bad design ...)
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   443
    "
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   444
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   445
    |words info nm mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   446
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   447
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   448
    "/ mhmh - ask the default manager
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   449
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   450
    (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   451
        info := mgr revisionInfoFromString:aString.
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   452
        info notNil ifTrue:[
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   453
            ^ info
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   454
        ]
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   455
    ].
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   456
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   457
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   458
    "/ fallBack - handles some RCS headers only
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   459
    "/ is this really needed ?
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   460
    "/
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   461
    info := IdentityDictionary new.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   462
    words := aString asCollectionOfWords.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   463
744
db7b733455b9 dont crash with bad revision strings (again)
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   464
    words notEmpty ifTrue:[
1994
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   465
        "/
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   466
        "/ supported formats:
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   467
        "/
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   468
        "/ $-Header: pathName rev date time user state $
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   469
        "/ $-Revision: rev $
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   470
        "/ $-Id: fileName rev date time user state $
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   471
        "/
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   472
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   473
        ((words at:1) = '$Header:') ifTrue:[
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   474
            nm := words at:2.
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   475
            info at:#repositoryPathName put:nm.
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   476
            (nm endsWith:',v') ifTrue:[
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   477
                nm := nm copyWithoutLast:2
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   478
            ].
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   479
            info at:#fileName put:nm asFilename baseName.
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   480
            words size > 2 ifTrue:[
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   481
                (words at:3) = '$' ifFalse:[
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   482
                    info at:#revision put:(words at:3).
2006
7ae5a89ed40a fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
   483
                    (words at:4) = '$' ifFalse:[
7ae5a89ed40a fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
   484
                        info at:#date put:(words at:4).
7ae5a89ed40a fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
   485
                        info at:#time put:(words at:5).
7ae5a89ed40a fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
   486
                        info at:#user put:(words at:6).
7ae5a89ed40a fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
   487
                        info at:#state put:(words at:7).
7ae5a89ed40a fixed no-version checkin into an existing container
Claus Gittinger <cg@exept.de>
parents: 2003
diff changeset
   488
                    ]
1994
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   489
                ].
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   490
            ].
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   491
            ^ info
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   492
        ].
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   493
        ((words at:1) = '$Revision:') ifTrue:[
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   494
            info at:#revision put:(words at:2).
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   495
            ^ info
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   496
        ].
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   497
        ((words at:1) = '$Id:') ifTrue:[
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   498
            info at:#fileName put:(words at:2).
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   499
            info at:#revision put:(words at:3).
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   500
            info at:#date put:(words at:4).
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   501
            info at:#time put:(words at:5).
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   502
            info at:#user put:(words at:6).
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   503
            info at:#state put:(words at:7).
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   504
            ^ info
53f3334a23d5 handle partially corrupted version strings
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
   505
        ].
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   506
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   507
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   508
    ^ nil
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   509
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   510
    "Created: 15.11.1995 / 14:58:35 / cg"
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   511
    "Modified: 29.1.1997 / 19:36:31 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   512
!
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   513
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   514
revisionStringFromSource:aMethodSourceString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   515
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   516
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   517
    "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
   518
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   519
    |lines line|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   520
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   521
    lines := aMethodSourceString asCollectionOfLines.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   522
    lines do:[:l |
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   523
        |i|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   524
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   525
        i := l indexOfSubCollection:'$Header: '.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   526
        i ~~ 0 ifTrue:[
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   527
            line := l copyFrom:i.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   528
            i := line lastIndexOf:$$.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   529
            i > 1 ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   530
                line := line copyTo:i.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   531
            ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   532
            ^ line
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   533
        ]
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   534
    ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   535
    ^ nil
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   536
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   537
    "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
   538
    "Modified: 16.10.1996 / 16:54:40 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   539
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   540
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   541
!Class class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   542
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   543
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   544
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   545
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   546
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   547
    ^ self == Class class or:[self == Class]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   548
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   549
    "Created: 15.4.1996 / 17:17:13 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   550
    "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
   551
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   552
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   553
!Class methodsFor:'ST/V subclass creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   554
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   555
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   556
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   557
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   558
    "this method allows fileIn of ST/V classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   559
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   560
a27a279701f8 Initial revision
claus
parents:
diff changeset
   561
    ^ self subclass:t 
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   562
           instanceVariableNames:f
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   563
           classVariableNames:d
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   564
           poolDictionaries:s
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   565
           category:'ST/V classes'
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   566
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   567
    "Modified: 5.1.1997 / 19:59:30 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   568
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   569
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   570
variableByteSubclass:t classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   571
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   572
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   573
    "this method allows fileIn of ST/V variable byte classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   574
     (which seem to have no category and no instvars)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   575
a27a279701f8 Initial revision
claus
parents:
diff changeset
   576
    ^ self variableByteSubclass:t 
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   577
           instanceVariableNames:''
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   578
           classVariableNames:d
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   579
           poolDictionaries:s
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   580
           category:'ST/V classes'
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   581
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   582
    "Modified: 5.1.1997 / 19:59:33 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   583
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   584
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   585
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   586
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   587
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   588
    "this method allows fileIn of ST/V variable pointer classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   589
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   590
a27a279701f8 Initial revision
claus
parents:
diff changeset
   591
    ^ self variableSubclass:t 
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   592
           instanceVariableNames:f
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   593
           classVariableNames:d
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   594
           poolDictionaries:s
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   595
           category:'ST/V classes'
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   596
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   597
    "Modified: 5.1.1997 / 19:59:36 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   598
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   599
a27a279701f8 Initial revision
claus
parents:
diff changeset
   600
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   601
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   602
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   603
    "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
   604
     Also writes a change record and notifies dependents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   605
     BUG: Currently, no recompilation is done - this will change."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   606
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   607
    (self classVarNames includes:aString) ifFalse:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   608
	self classVariableString:(self classVariableString , ' ' , aString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   609
	self addChangeRecordForClass:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   610
	self changed:#definition.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   611
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   612
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   613
    "Created: 29.10.1995 / 19:40:51 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   614
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   615
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   616
classFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   617
    "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
   618
     This is currently NOT used."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   619
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   620
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   621
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   622
    (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
   623
    ^ classFilename
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   624
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   625
    "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
   626
!
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
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   629
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   630
     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
   631
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   632
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
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   635
     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
   636
     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
   637
     no classPools yet.
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
    ^ Smalltalk at:(self name , ':' , aSymbol) asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   640
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   641
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   642
classVarAt:aSymbol put:something
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   643
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   644
     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
   645
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   646
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   647
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   648
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   649
     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
   650
     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
   651
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   652
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   653
    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
   654
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   655
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   656
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   657
    "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
   658
     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
   659
     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
   660
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   661
    classvars isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   662
	^ OrderedCollection new
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   663
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   664
    ^ classvars asCollectionOfWords
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   665
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   666
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   667
     Object classVarNames 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   668
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   669
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   670
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   671
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   672
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   673
    "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
   674
     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
   675
     returned string."
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
    classvars isNil ifTrue:[^ ''].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   678
    ^ classvars
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   679
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   680
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   681
     Object classVariableString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   682
     Float classVariableString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   683
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   684
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   685
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   686
classVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   687
    "set the classes classvarnames string; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   688
     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
   689
     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
   690
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   691
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   692
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   693
    "ignore for metaclasses except the one"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   694
    (self isMeta) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   695
	(self == Metaclass) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   696
	    ^ self
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   697
	]
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   698
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   699
    (classvars = aString) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   700
	prevVarNames := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   701
	classvars := aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   702
	varNames := self classVarNames.
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
	"new ones get initialized to nil;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   705
	 - 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
   706
	any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   707
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   708
	varNames do:[:aName |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   709
	    (prevVarNames includes:aName) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   710
		"a new one"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   711
		self classVarAt:aName put:nil.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   712
		any := true.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   713
	    ] ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   714
		prevVarNames remove:aName
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   715
	    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   716
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   717
	"left overs are gone"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   718
	prevVarNames do:[:aName |
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   719
	    self classVarAt:aName put:nil.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   720
	    Smalltalk removeKey:(self name , ':' , aName) asSymbol.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   721
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   722
	any ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   723
	    Smalltalk changed:#classVariables with:self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   724
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   725
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   726
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   727
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   728
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   729
    "return the comment (aString) of the class"
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
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   732
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   733
    "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
   734
     position within the classes sourcefile ...
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
    comment isNumber ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   737
	classFilename notNil ifTrue:[
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   738
	    stream := self sourceStream. 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   739
	    stream notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   740
		stream position:comment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   741
		string := String readFrom:stream onError:''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   742
		stream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   743
		^ string
887
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   744
	    ].
9d1780436f5a use new metaclass entry when loading binary classes
Claus Gittinger <cg@exept.de>
parents: 881
diff changeset
   745
	    ^ nil
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   746
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   747
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   748
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   749
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   750
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   751
     Object comment 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   752
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   753
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   754
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   755
comment:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   756
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   757
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   758
    "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
   759
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   760
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   761
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   762
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   763
    newComment := aString.
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   764
    (aString notNil and:[aString isEmpty]) ifTrue:[
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   765
	newComment := nil
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   766
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   767
    comment ~= newComment ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   768
	oldComment := self comment.
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   769
	comment := newComment.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   770
	self changed:#comment with:oldComment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   771
	self addChangeRecordForClassComment:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   772
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   773
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   774
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   775
definition
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   776
    "return an expression-string to define myself"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   777
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   778
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   779
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   780
    s := WriteStream on:(String new).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   781
    self fileOutDefinitionOn:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   782
    ^ s contents
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   783
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   784
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   785
     Object definition 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   786
     Point definition  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   787
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   788
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   789
2444
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   790
environment
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   791
    "return the namespace I am contained in; ST-80 compatible name"
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   792
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   793
    ^ self nameSpace
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   794
!
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   795
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   796
nameSpace
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   797
    "return the namespace I am contained in;
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   798
     For private or anonymous classes, nil is returned -
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   799
     for public classes, Smalltalk is returned."
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   800
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   801
    |idx nsName|
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   802
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   803
    environment notNil ifTrue:[^ environment].
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   804
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   805
    "/ due to the implementation, extract this from my name
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   806
    "/ (physically, all classes are found in Smalltalk)
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   807
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   808
    idx := name lastIndexOf:$:.
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   809
    idx == 0 ifTrue:[
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   810
        environment := Smalltalk.
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   811
        ^ Smalltalk
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   812
    ].
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   813
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   814
    (name at:idx-1) ~~ $: ifTrue:[
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   815
        environment := Smalltalk.
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   816
        ^ Smalltalk
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   817
    ].
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   818
    nsName := name copyTo:(idx - 2).
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   819
    environment := Smalltalk at:nsName asSymbol.
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   820
    ^ environment
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   821
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   822
    "Modified: 24.3.1997 / 11:12:09 / cg"
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   823
!
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   824
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   825
package
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   826
    "return the package of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   827
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   828
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   829
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   830
    (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
   831
    ^ package
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
     Object package  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   835
    "
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   836
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   837
    "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
   838
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   839
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   840
package:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   841
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   842
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   843
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   844
!
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
primitiveDefinitions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   847
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   848
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   849
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   850
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   851
    self setPrimitiveSpecsAt:1 to:aString.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   852
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   853
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   854
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   855
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   856
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   857
primitiveDefinitionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   858
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   859
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   860
    "return the primitiveDefinition string or nil"
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
    ^ self getPrimitiveSpecsAt:1
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   863
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   864
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   865
     Object primitiveDefinitionsString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   866
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   867
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   868
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   869
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   870
primitiveFunctions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   871
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   872
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   873
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   874
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   875
    self setPrimitiveSpecsAt:3 to:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   876
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   877
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   878
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   879
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   880
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   881
primitiveFunctionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   882
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   883
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   884
    "return the primitiveFunctions string or nil"
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
    ^ self getPrimitiveSpecsAt:3 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   887
!
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
primitiveSpec
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   890
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   891
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   892
    "return the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   893
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   894
    ^  primitiveSpec
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   895
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   896
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   897
primitiveSpec:anArrayOf3ElementsOrNil
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   898
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   899
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   900
    "set the primitiveSpec or nil"
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
    primitiveSpec := anArrayOf3ElementsOrNil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   903
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   904
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   905
primitiveVariables:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   906
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   907
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   908
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   909
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   910
    self setPrimitiveSpecsAt:2 to:aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   911
    self addChangeRecordForPrimitiveVariables:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   912
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   913
    "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
   914
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   915
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   916
primitiveVariablesString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   917
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   918
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   919
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   920
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   921
    ^ self getPrimitiveSpecsAt:2 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   922
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   923
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   924
privateClasses
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   925
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   926
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   927
    "return a collection of my private classes (if any); nil otherwise.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   928
     The classes are in any order."
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   929
2489
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   930
    |classes myName myNamePrefix|
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   931
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   932
    classes := IdentitySet new.
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   933
    myName := self name.
2489
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   934
    myNamePrefix := myName , '::'.
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   935
2490
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   936
    Smalltalk allBehaviorsDo:[:aClass |
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   937
        |nm owner|
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   938
2489
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   939
        aClass isBehavior ifTrue:[
2490
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   940
            (owner := aClass owningClass) notNil ifTrue:[
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   941
"/                owner == self ifTrue:[
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   942
"/                    classes add:aClass.
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   943
"/                ].
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   944
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   945
                nm := aClass name.
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   946
                (nm startsWith:myNamePrefix) ifTrue:[
2489
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   947
                    "/ care for private-privateClasses
2490
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   948
                    (nm indexOf:$: startingAt:myName size + 3) == 0 ifTrue:[
2489
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   949
                        classes add:aClass.
20b454c692df faster #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2486
diff changeset
   950
                    ]
2009
3f5fad3c9fa9 faster search for privateClasses (less garbage creation)
Claus Gittinger <cg@exept.de>
parents: 2006
diff changeset
   951
                ]
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
   952
            ]
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   953
        ]
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   954
    ].
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   955
    ^ classes
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   956
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   957
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   958
     Object privateClasses
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   959
     ObjectMemory privateClasses
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   960
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   961
2490
c0c52cc5e107 better #privateClasses
Claus Gittinger <cg@exept.de>
parents: 2489
diff changeset
   962
    "Modified: 22.3.1997 / 19:20:53 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   963
!
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   964
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   965
privateClassesAt:aClassNameSymbol
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   966
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   967
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   968
    "return a private class if present; nil otherwise"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   969
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   970
    |class|
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   971
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   972
    class := self classVarAt:(':' , aClassNameSymbol) asSymbol.
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   973
    ^ class
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   974
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   975
    "Created: 11.10.1996 / 19:05:39 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   976
    "Modified: 14.10.1996 / 17:23:30 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   977
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   978
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   979
privateClassesAt:aClassNameSymbol put:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   980
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   981
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   982
    "return a private class if present"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   983
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   984
    self classVarAt:(':' , aClassNameSymbol) asSymbol put:aClass
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   985
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   986
    "Created: 11.10.1996 / 17:53:06 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   987
    "Modified: 14.10.1996 / 17:23:36 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   988
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   989
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   990
privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   991
    "{ Pragma: +optSpace }"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   992
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   993
    "return a collection of my private classes (if any); nil otherwise.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   994
     The classes are sorted by inheritance."
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   995
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   996
    |classes|
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   997
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   998
    classes := self privateClasses.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   999
    (classes notNil and:[classes notEmpty]) ifTrue:[
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1000
        classes := classes asOrderedCollection topologicalSort:[:a :b | b isSubclassOf:a].
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1001
    ].
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1002
    ^ classes.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1003
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1004
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1005
     Object privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1006
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1007
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1008
    "Created: 22.3.1997 / 16:10:42 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1009
    "Modified: 22.3.1997 / 16:11:20 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1010
!
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1011
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1012
removeClassVarName:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1013
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1014
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1015
    "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
  1016
     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
  1017
     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
  1018
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1019
    |names newNames|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1020
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1021
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1022
    (names includes:aString) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1023
	newNames := ''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1024
	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
  1025
	self classVariableString:newNames withoutSpaces.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1026
	self addChangeRecordForClass:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1027
	self changed:#definition.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1028
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1029
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1030
    "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
  1031
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1032
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1033
renameCategory:oldCategory to:newCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1034
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1035
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1036
    "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
  1037
     Appends a change record and notifies dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1038
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1039
    |any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1040
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1041
    any := false.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1042
    self methodDictionary do:[:aMethod |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1043
        aMethod category = oldCategory ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1044
            aMethod category:newCategory.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1045
            any := true.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1046
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1047
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1048
    any ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1049
        self addChangeRecordForRenameCategory:oldCategory to:newCategory.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1050
        self changed:#methodCategory.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1051
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1052
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1053
    "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
  1054
    "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
  1055
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1056
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1057
setClassFilename:aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1058
    "set the classes filename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1059
     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
  1060
     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
  1061
     is set here."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1062
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1063
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1064
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1065
    "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
  1066
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1067
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1068
setClassVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1069
    "set the classes classvarnames string. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1070
     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
  1071
     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
  1072
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1073
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1074
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1075
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1076
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1077
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1078
    "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
  1079
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1080
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1081
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1082
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1083
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1084
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1085
    "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
  1086
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1087
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1088
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1089
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1090
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1091
    categoryStringOrSymbol isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1092
	cat := ''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1093
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1094
	cat := categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1095
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1096
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1097
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1098
2516
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1099
setName:aString
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1100
    "set the classes name - be careful, it will be still
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1101
     in the Smalltalk dictionary - under another key.
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1102
     This is NOT for general use - see renameTo:"
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1103
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1104
    environment := nil.
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1105
    super setName:aString
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1106
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1107
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1108
!
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  1109
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1110
setPackage:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1111
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1112
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1113
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1114
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1115
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1116
sharedPools
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1117
    "ST/X does not (currently) support pools"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1118
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1119
    ^ #()
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1120
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1121
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1122
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1123
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1124
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1125
    |code aStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1126
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1127
" this is too slow for big classes ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1128
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1129
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1130
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1131
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1132
    aStream := FileStream newFileNamed:'__temp'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1133
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1134
	self notify:'cannot create temporary file.'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1135
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1136
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1137
    FileOutErrorSignal handle:[:ex |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1138
	aStream nextPutAll:'"no source available"'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1139
    ] do:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1140
	self fileOutOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1141
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1142
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1143
    aStream := FileStream oldFileNamed:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1144
    aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1145
	self notify:'oops - cannot reopen temp file'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1146
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1147
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1148
    code := aStream contents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1149
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1150
    OperatingSystem removeFile:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1151
    ^ code
385
claus
parents: 384
diff changeset
  1152
!
claus
parents: 384
diff changeset
  1153
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1154
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1155
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1156
     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
  1157
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1158
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1159
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1160
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1161
    (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
  1162
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1163
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1164
    "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
  1165
    "Modified: 15.10.1996 / 18:54:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1166
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1167
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1168
!Class methodsFor:'adding/removing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1169
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1170
addSelector:newSelector withMethod:newMethod
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
  1171
    "add the method given by 2nd argument under the selector given by
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1172
     1st argument to the methodDictionary. 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1173
     Append a change record to the changes file and tell dependents."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1174
362
claus
parents: 360
diff changeset
  1175
    |oldMethod|
claus
parents: 360
diff changeset
  1176
2277
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1177
    oldMethod := self compiledMethodAt:newSelector.
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1178
362
claus
parents: 360
diff changeset
  1179
    CatchMethodRedefinitions ifTrue:[
1651
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1180
        "check for attempts to redefine a method
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1181
         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
  1182
         This allows tracing redefinitions of existing system methods
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1183
         when filing in alien code ....
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1184
         (which we may want to forbit sometimes)
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1185
        "
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1186
        oldMethod notNil ifTrue:[
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1187
            oldMethod package ~= newMethod package ifTrue:[
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1188
                "
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1189
                 attempt to redefine an existing method, which was
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1190
                 defined in another package.
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1191
                 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
  1192
                 Otherwise, the existing (old) method remains valid.
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1193
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1194
                 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
  1195
                   CatchMethodRedefinitions to false
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1196
                 (also found in the Launchers 'settings-misc' menu)
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1197
                "
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  1198
                (MethodRedefinitionSignal
1927
a6c8e3b01436 pass old -> new methods as parameter in
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
  1199
                    raiseRequestWith:(oldMethod -> newMethod)
a6c8e3b01436 pass old -> new methods as parameter in
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
  1200
                    errorString:('redefinition of ' , name , '>>' , newSelector) 
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  1201
                ) == #keep ifTrue:[
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  1202
                    newMethod package:oldMethod package
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  1203
                ].
1927
a6c8e3b01436 pass old -> new methods as parameter in
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
  1204
a6c8e3b01436 pass old -> new methods as parameter in
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
  1205
                "/ if proceeded, install as usual.
1651
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1206
            ]
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1207
        ]
362
claus
parents: 360
diff changeset
  1208
    ].
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1209
2277
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1210
    "/ remember new->old association in the OldMethods dictionary (if non-nil)
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1211
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1212
    OldMethods notNil ifTrue:[
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1213
        oldMethod notNil ifTrue:[
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1214
"/            oldMethod source:(oldMethod source).
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1215
            OldMethods at:newMethod put:oldMethod
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1216
        ]
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1217
    ].
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1218
2277
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1219
    "/ remember in the projects overwritten dictionary
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1220
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1221
    oldMethod notNil ifTrue:[
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1222
        oldMethod package ~= newMethod package ifTrue:[
2335
a0e7564d47c7 remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents: 2321
diff changeset
  1223
            Project notNil ifTrue:[
a0e7564d47c7 remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents: 2321
diff changeset
  1224
                "/ allow configurations without Project
a0e7564d47c7 remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents: 2321
diff changeset
  1225
                Project rememberOverwrittenMethod:newMethod from:oldMethod
a0e7564d47c7 remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents: 2321
diff changeset
  1226
            ]
2277
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1227
        ]
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1228
    ].
fc4b06d2cf78 remember overwritten methods in project
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  1229
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1230
    (super addSelector:newSelector withMethod:newMethod) ifTrue:[
1651
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1231
        self addChangeRecordForMethod:newMethod.
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1232
    ]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1233
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1234
    "Created: 29.10.1995 / 19:42:42 / cg"
1651
fc6505852b73 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  1235
    "Modified: 9.9.1996 / 22:39:32 / stefan"
2335
a0e7564d47c7 remember methods sent to Project
Claus Gittinger <cg@exept.de>
parents: 2321
diff changeset
  1236
    "Modified: 30.1.1997 / 21:08:14 / cg"
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1237
!
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1238
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1239
basicAddSelector:newSelector withMethod:newMethod
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1240
    "add the method given by 2nd argument under the selector given by
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1241
     1st argument to the methodDictionary. 
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1242
     This does NOT append a change record to the changes file and tell 
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1243
     dependents. Also, no methodHistory is kept or redefinition is checked."
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1244
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1245
    super addSelector:newSelector withMethod:newMethod
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1246
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
  1247
    "Created: 7.11.1996 / 18:48:35 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1248
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1249
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1250
removeFromSystem
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1251
    "ST-80 compatibility
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1252
     remove myself from the system"
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1253
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1254
    ^ Smalltalk removeClass:self
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1255
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1256
    "Created: 6.2.1996 / 11:32:58 / stefan"
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1257
!
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1258
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1259
removeSelector:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1260
    "remove the selector, aSelector and its associated method 
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1261
     from the methodDictionary.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1262
     Append a change record to the changes file and tell dependents."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1263
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1264
    (super removeSelector:aSelector) ifTrue:[
2095
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1265
        self addChangeRecordForRemoveSelector:aSelector.
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1266
        "/
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1267
        "/ also notify a change of mySelf;
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1268
        "/
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1269
        self changed:#methodDictionary with:aSelector.
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1270
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1271
        "/
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1272
        "/ also notify a change of Smalltalk;
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1273
        "/ this allows a dependent of Smalltalk to watch all class
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1274
        "/ changes (no need for observing all classes)
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1275
        "/ - this allows for watchers to find out if its a new method or a method-change
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1276
        "/
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1277
        Smalltalk changed:#methodInClassRemoved with:(Array with:self with:aSelector).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1278
    ]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1279
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1280
    "Created: 29.10.1995 / 19:42:47 / cg"
2095
fa85d9f387ac beside notifying a self-changed,
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1281
    "Modified: 8.1.1997 / 23:03:49 / cg"
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1282
!
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1283
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1284
unload
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1285
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1286
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1287
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1288
     autoloaded. Can be used to get rid of no longer needed autoloaded
328
claus
parents: 326
diff changeset
  1289
     classes. 
claus
parents: 326
diff changeset
  1290
     (maybe, autoloaded classes should unload themselfes when no
claus
parents: 326
diff changeset
  1291
      longer needed - for example, after some delay when the last instance 
claus
parents: 326
diff changeset
  1292
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1294
    |nm|
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1295
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1296
    self wasAutoloaded ifFalse:[
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1297
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1298
        "
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1299
         can it be done ?
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1300
        "
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1301
        self methodDictionary do:[:aMethod |
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1302
            aMethod source isNil ifTrue:[^false].
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1303
            aMethod hasPrimitiveCode ifTrue:[^ false].
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1304
        ].
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1305
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1306
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1307
    self allSubclassesDo:[:aClass |
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1308
        aClass unload
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1309
    ].
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1310
    Transcript showCR:'unloading ' , name , ' ...'.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1311
359
claus
parents: 357
diff changeset
  1312
    Autoload removeClass:self.    
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1313
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1314
    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
  1315
"/    name := (nm , ' (leftover)') asSymbol.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1316
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1317
    ObjectMemory flushMethodCache.
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1318
    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
  1319
"/  category := #unloaded.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1320
    Smalltalk flushCachedClasses.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1321
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1322
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1323
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1324
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1325
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1326
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1327
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1328
    "
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1329
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1330
    "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
  1331
    "Modified: 7.6.1996 / 09:15:05 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1332
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1333
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1334
!Class methodsFor:'binary storage'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1335
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1336
addGlobalsForBinaryStorageTo:globalDictionary
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1337
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1338
    classPool == nil ifFalse: [
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1339
        classPool associationsDo: [:assoc|
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1340
            globalDictionary at: assoc put: self
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1341
        ]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1342
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1343
"
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1344
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1345
    "Created: 21.3.1997 / 15:40:45 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1346
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1347
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1348
binaryClassDefinitionFrom:stream manager:manager
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1349
    "retrieve a class as stored previously with
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1350
     #storeBinaryClassOn:manager:
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1351
     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
  1352
     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
  1353
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1354
    |superclassName name flags instvars classvars category classInstVars
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1355
     comment package superclassSig rev
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1356
     newClass superClass methods cmethods formatID environment
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1357
     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
  1358
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1359
    "/ 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
  1360
    "/ the storing in #storeBinaryClassOn:manager:
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1361
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1362
    "/ retrieve
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1363
    "/   formatID
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1364
    "/   superclasses name,
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1365
    "/   superclasses signature
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1366
    "/   name,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1367
    "/   typeSymbol,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1368
    "/   instVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1369
    "/   classVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1370
    "/   category
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1371
    "/   classInstVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1372
    "/   comment
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1373
    "/   revision
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1374
    "/   package
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1375
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1376
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1377
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1378
    "/   number of private classes
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1379
    "/   private classes, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1380
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1381
    formatID := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1382
    formatID isInteger ifFalse:[       "/ backward compatibilty
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1383
        formatID := nil.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1384
        superclassName := formatID
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1385
    ] ifTrue:[
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1386
        superclassName := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1387
    ].
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1388
    superclassSig := manager nextObject.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1389
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1390
    superclassName notNil ifTrue:[
1439
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1391
        superClass := Smalltalk at:superclassName ifAbsent:nil.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1392
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1393
        superClass isNil ifTrue:[
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1394
            BinaryIOManager nonexistingClassSignal
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1395
                raiseRequestWith:'non existent superclass (in binaryLoad)'.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1396
            ^ nil
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1397
        ].
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1398
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1399
        "/ ('loading superclass: ' ,  superclassName ) printNL.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1400
        superClass autoload.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1401
        superClass := Smalltalk at:superclassName.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1402
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1403
        superclassSig ~= superClass signature ifTrue:[
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1404
            BinaryIOManager changedInstLayoutSignal
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1405
                raiseRequestWith:'incompatible superclass (in binaryLoad)'.
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1406
            ^ nil
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1407
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1408
    ].
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
    name := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1411
    flags := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1412
    instvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1413
    instvars isNil ifTrue:[instvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1414
    classvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1415
    classvars isNil ifTrue:[classvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1416
    category := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1417
    classInstVars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1418
    classInstVars isNil ifTrue:[classInstVars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1419
    comment := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1420
    package := manager nextObject.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1421
    formatID == 1 ifTrue:[
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1422
        rev := manager nextObject.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1423
        ownerName := manager nextObject.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1424
        ownerName notNil ifTrue:[
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1425
            name := name copyFrom:(ownerName size + 2 + 1).
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1426
            owner := Smalltalk at:ownerName.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1427
        ]
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1428
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1429
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1430
"/    'got superName:' print. superclassName printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1431
"/    'got name:' print. name printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1432
"/    'got flags: ' print. flags printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1433
"/    'got instvars: ' print. instvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1434
"/    'got classvars: ' print. classvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1435
"/    'got category: ' print. category printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1436
"/    'got classInstvars: ' print. classInstVars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1437
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1438
"/ ('create class: ' ,  name ) printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1439
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1440
    owner notNil ifTrue:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1441
        environment := owner
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1442
    ] ifFalse:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1443
        environment := Class nameSpaceQuerySignal raise.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1444
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1445
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1446
    cls := superClass.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1447
    superClass isNil ifTrue:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1448
        cls := Object
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1449
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1450
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1451
    newClass := cls class
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1452
            name:name asSymbol
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1453
            in:environment
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1454
            subclassOf:cls
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1455
            instanceVariableNames:instvars
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1456
            variable:false
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1457
            words:false 
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1458
            pointers:true
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1459
            classVariableNames:classvars
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1460
            poolDictionaries:'' 
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1461
            category:category
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1462
            comment:comment 
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1463
            changed:false 
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1464
            classInstanceVariableNames:classInstVars.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1465
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1466
    newClass isNil ifTrue:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1467
        ^ nil.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1468
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1469
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1470
    superClass isNil ifTrue:[
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1471
        newClass setSuperclass:nil.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1472
        newClass class setSuperclass:Class.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1473
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1474
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1475
"/ Transcript showCR:'loaded ' , name , ' in ' , environment name.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1476
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1477
    newClass flags:flags.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1478
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1479
    "/ retrieve class methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1480
    cmethods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1481
    "/ retrieve inst methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1482
    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
  1483
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1484
    formatID == 1 ifTrue:[
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1485
        "/ privateClasses
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1486
        nPrivate := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1487
        nPrivate timesRepeat:[
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1488
            Class nameSpaceQuerySignal
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1489
                answer:newClass
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1490
                do:[
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1491
                    privateClass := manager nextObject
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1492
                ]
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1493
        ]
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1494
    ].
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1495
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1496
    (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
  1497
    newClass isNil ifTrue:[
1439
d8a58d20a93c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1430
diff changeset
  1498
        ^ nil
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1499
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1500
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1501
    owner notNil ifTrue:[
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1502
        newClass category:nil.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1503
    ] ifFalse:[
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1504
        newClass package:package.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1505
    ].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1506
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1507
    newClass methodDictionary:methods.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1508
    newClass class methodDictionary:cmethods.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1509
    ^ newClass
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1510
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1511
    "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
  1512
    "Created: 8.10.1996 / 17:57:02 / cg"
1900
9e814ffbebbc namespace support
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
  1513
    "Modified: 5.11.1996 / 22:01:09 / cg"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1514
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1515
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1516
storeBinaryClassOn:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1517
    "store a classes complete description (i.e. including methods).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1518
     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
  1519
     be either present or autoloadable."
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1520
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1521
    |s sig owner privateClasses|
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1522
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1523
    stream nextPut: manager codeForClass.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1524
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1525
    "/ the following order must correlate to
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1526
    "/ the storing in #binaryDefinitionFrom:manager:
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1527
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1528
    "/ store
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1529
    "/   format ID
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1530
    "/   superclasses name
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1531
    "/   superclasses signature
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1532
    "/   name
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1533
    "/   typeSymbol,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1534
    "/   instVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1535
    "/   classVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1536
    "/   category
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1537
    "/   classInstVarNames
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1538
    "/   comment
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1539
    "/   package
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1540
    "/   revision
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1541
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1542
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1543
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1544
    "/   # of privateClass names
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1545
    "/   privateClasses, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1546
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1547
    1 storeBinaryOn:stream manager:manager.  "/ formatID
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1548
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1549
    owner := self owningClass.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1550
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1551
    superclass isNil ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1552
        s := nil.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1553
        sig := 0.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1554
    ] ifFalse:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1555
        s := superclass name.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1556
        sig := superclass signature.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1557
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1558
    s storeBinaryOn:stream manager:manager.
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1559
    sig storeBinaryOn:stream manager:manager.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1560
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1561
    name storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1562
    flags storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1563
    (instvars notNil and:[instvars isEmpty]) ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1564
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1565
    ] ifFalse:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1566
        s := instvars
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1567
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1568
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1569
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1570
    (classvars notNil and:[classvars isEmpty]) ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1571
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1572
    ] ifFalse:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1573
        s := classvars
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1574
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1575
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1576
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1577
    "/ the category
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1578
    owner notNil ifTrue:[
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1579
        nil storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1580
    ] ifFalse:[
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1581
        category storeBinaryOn:stream manager:manager.
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1582
    ].
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1583
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1584
    "/ the classInstVarString
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1585
    s := self class instanceVariableString.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1586
    (s notNil and:[s isEmpty]) ifTrue:[
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1587
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1588
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1589
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1590
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1591
    "/ the comment
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1592
    s := comment.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1593
    manager sourceMode == #discard ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1594
        s := nil
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1595
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1596
    s storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1597
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1598
    "/ the revision, package & owner
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1599
    owner notNil ifTrue:[
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1600
        nil storeBinaryOn:stream manager:manager.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1601
        nil storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1602
        owner name storeBinaryOn:stream manager:manager.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1603
    ] ifFalse:[
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1604
        package storeBinaryOn:stream manager:manager.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1605
        revision storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1606
        nil storeBinaryOn:stream manager:manager.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1607
    ].
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1608
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1609
    "/
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1610
    "/ store class method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1611
    "/ 
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1612
    self class methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1613
    "/ store inst method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1614
    self methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.    
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1615
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1616
    "/
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1617
    "/ names of private classes
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1618
    "/
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1619
    privateClasses := self privateClassesSorted.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1620
    privateClasses size storeBinaryOn:stream manager:manager.
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1621
    privateClasses size > 0 ifTrue:[
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1622
        privateClasses do:[:aClass |
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1623
            aClass storeBinaryClassOn:stream manager:manager
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1624
        ]
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1625
    ].
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1626
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1627
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1628
     |bos|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1629
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1630
     bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1631
     bos nextPutClasses:(Array with:FileBrowser).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1632
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1633
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1634
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1635
     |bos cls|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1636
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1637
     bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1638
     cls := bos next.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1639
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1640
     cls open.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1641
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1642
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1643
    "Modified: 7.6.1996 / 13:39:02 / stefan"
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1644
    "Modified: 22.3.1997 / 16:13:02 / cg"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1645
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1646
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1647
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
  1648
    "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
  1649
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1650
    | string |
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1651
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1652
    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
  1653
    stream nextNumber: 2 put: string size.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1654
    stream nextPutBytes:(string size) from:string startingAt:1.
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1655
"/    string do: [:char| stream nextPut: char asciiValue]
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1656
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1657
    "Modified: 19.3.1997 / 18:49:54 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1658
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1659
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1660
storeBinaryDefinitionOn: stream manager: manager
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1661
    "store the receiver in a binary format on stream.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1662
     This is an internal interface for binary storage mechanism.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1663
     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
  1664
     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
  1665
     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
  1666
     restore time.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1667
     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
  1668
     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
  1669
     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
  1670
     (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
  1671
    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
  1672
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1673
    |varnames n sz|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1674
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1675
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1676
     output the signature
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1677
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1678
    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
  1679
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1680
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1681
     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
  1682
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1683
    varnames := self allInstVarNames.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1684
    n := varnames size.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1685
    n == 0 ifTrue:[
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1686
        sz := 0
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1687
    ] ifFalse:[
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1688
        sz := varnames inject:0 into:[:sum :nm | sum + nm size].
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1689
        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
  1690
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1691
    stream nextNumber:2 put:sz.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1692
    varnames keysAndValuesDo:[:i :nm |
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1693
        stream nextPutBytes:(nm size) from:nm startingAt:1.
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1694
"/        nm do:[:c |
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1695
"/            stream nextPut:c asciiValue
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1696
"/        ].
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1697
        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
  1698
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1699
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1700
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1701
     output my name
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1702
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1703
    stream nextNumber:2 put:name size.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1704
    stream nextPutBytes:(name size) from:name startingAt:1.
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1705
"/    name do:[:c| 
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1706
"/        stream nextPut:c asciiValue
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1707
"/    ]
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1708
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1709
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1710
     |s|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1711
     s := WriteStream on:ByteArray new.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1712
     Rectangle storeBinaryOn:s.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1713
     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
  1714
    "
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1715
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1716
    "Modified: 19.3.1997 / 18:47:10 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1717
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1718
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1719
!Class methodsFor:'c function interfacing'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1720
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1721
cInterfaceFunction:selector calling:cFunctionNameString args:argTypeArray returning:returnType
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1722
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1723
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1724
    "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
  1725
     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
  1726
     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
  1727
     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
  1728
     WARNING: 
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1729
        this interface is EXPERIMENTAL - it may change or even be removed."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1730
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1731
    StubGenerator isNil ifTrue:[
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1732
        ^ self error:'this system does not support dynamic C Interface functions'.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1733
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1734
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1735
    StubGenerator 
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1736
        createStubFor:selector 
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1737
        calling:cFunctionNameString 
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1738
        args:argTypeArray 
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1739
        returning:returnType
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1740
        in:self                          
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1741
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1742
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1743
     Object subclass:#CInterface
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1744
            instanceVariableNames:''
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1745
            classVariableNames:''
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1746
            poolDictionaries:''
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1747
            category:'Examples'.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1748
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1749
     CInterface cInterfaceFunction:#printfOn:format:withFloat: 
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1750
                           calling:'fprintf' 
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1751
                              args:#(ExternalStream String Float) 
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1752
                         returning:#SmallInteger.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1753
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1754
     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
  1755
    "
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1756
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  1757
    "Modified: 5.1.1997 / 19:58:22 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1758
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1759
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1760
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1761
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1762
addChangeRecordForChangeCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1763
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1764
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1765
    "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
  1766
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1767
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1768
        self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1769
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1770
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1771
    "Modified: 24.1.1997 / 19:09:34 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1772
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1773
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1774
addChangeRecordForClass:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1775
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1776
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1777
    "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
  1778
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1779
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1780
        self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1781
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1782
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1783
    "Modified: 24.1.1997 / 19:09:41 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1784
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1785
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1786
addChangeRecordForClassCheckIn:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1787
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1788
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1789
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1790
1938
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1791
    |rv|
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1792
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1793
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1794
        rv := aClass revision.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1795
        rv isNil ifTrue:[rv := '???'].
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1796
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1797
        self 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1798
            writingChangeWithTimeStamp:false 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1799
            perform:#addInfoRecord:to: 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1800
            with:('checkin ' , aClass name , ' (' , rv , ')').
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1801
    ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1802
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1803
    "Created: 18.11.1995 / 17:04:58 / cg"
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1804
    "Modified: 24.1.1997 / 19:11:55 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1805
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1806
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1807
addChangeRecordForClassComment:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1808
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1809
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1810
    "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
  1811
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1812
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1813
        self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1814
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1815
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1816
    "Modified: 24.1.1997 / 19:09:59 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1817
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1818
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1819
addChangeRecordForClassContainerRemove:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1820
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1821
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1822
    "append a container-was-removed-record to the changes file"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1823
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1824
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1825
        self 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1826
            writingChangeWithTimeStamp:false 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1827
            perform:#addInfoRecord:to: 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1828
            with:('removed source container of ' , aClass name).
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1829
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1830
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1831
    "Created: 11.9.1996 / 15:37:19 / cg"
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1832
    "Modified: 24.1.1997 / 19:12:05 / cg"
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1833
!
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1834
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1835
addChangeRecordForClassFileOut:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1836
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1837
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1838
    "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
  1839
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1840
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1841
        self 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1842
            writingChangeWithTimeStamp:false 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1843
            perform:#addInfoRecord:to: 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1844
            with:('fileOut ' , aClass name).
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1845
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1846
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1847
    "Modified: 24.1.1997 / 19:12:14 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  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
addChangeRecordForClassInstvars:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1851
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1852
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1853
    "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
  1854
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1855
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1856
        self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1857
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1858
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1859
    "Modified: 24.1.1997 / 19:10:18 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1860
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1861
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1862
addChangeRecordForClassRemove:oldName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1863
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1864
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1865
    "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
  1866
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1867
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1868
        self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1869
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1870
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1871
    "Modified: 24.1.1997 / 19:10:25 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1872
!
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
addChangeRecordForClassRename:oldName to:newName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1875
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1876
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1877
    "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
  1878
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1879
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1880
        self writingChangeDo:[:aStream |
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1881
            self addChangeRecordForClassRename:oldName to:newName to:aStream
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1882
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1883
    ]
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1884
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1885
    "Modified: 24.1.1997 / 19:10:35 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1886
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1887
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1888
addChangeRecordForMethod:aMethod
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1889
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1890
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1891
    "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
  1892
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1893
    UpdateChangeFileQuerySignal raise ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1894
        self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod.
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1895
        "this test allows a smalltalk without Projects/ChangeSets"
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1896
        Project notNil ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1897
            Project addMethodChange:aMethod in:self
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1898
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1899
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1900
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1901
    "Modified: 20.1.1997 / 12:36:02 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1902
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1903
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1904
addChangeRecordForMethodCategory:aMethod category:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1905
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1906
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1907
    "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
  1908
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1909
    UpdateChangeFileQuerySignal raise ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1910
        self writingChangeDo:[:aStream |
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1911
            self addChangeRecordForMethodCategory:aMethod category:aString to:aStream.
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1912
        ].
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1913
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1914
        "this test allows a smalltalk without Projects/ChangeSets"
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1915
        Project notNil ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1916
            Project addMethodCategoryChange:aMethod category:aString in:self
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1917
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1918
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1919
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1920
    "Modified: 20.1.1997 / 12:36:05 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1921
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1922
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1923
addChangeRecordForMethodPrivacy:aMethod
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1924
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1925
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1926
    "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
  1927
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1928
    UpdateChangeFileQuerySignal raise ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1929
        self writingChangePerform:#addChangeRecordForMethodPrivacy:to: with:aMethod.
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1930
        "this test allows a smalltalk without Projects/ChangeSets"
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1931
        Project notNil ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1932
            Project addMethodPrivacyChange:aMethod in:self
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1933
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1934
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1935
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1936
    "Modified: 27.8.1995 / 22:47:32 / claus"
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1937
    "Modified: 20.1.1997 / 12:36:08 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1938
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1939
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1940
addChangeRecordForPrimitiveDefinitions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1941
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1942
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1943
    "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
  1944
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1945
    UpdateChangeFileQuerySignal raise ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1946
        self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1947
        Project notNil ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1948
            Project addPrimitiveDefinitionsChangeFor:aClass
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1949
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1950
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1951
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1952
    "Modified: 20.1.1997 / 12:36:10 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1953
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1954
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1955
addChangeRecordForPrimitiveFunctions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1956
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1957
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1958
    "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
  1959
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1960
    UpdateChangeFileQuerySignal raise ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1961
        self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1962
        Project notNil ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1963
            Project addPrimitiveFunctionsChangeFor:aClass
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1964
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1965
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1966
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1967
    "Modified: 20.1.1997 / 12:36:13 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1968
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1969
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1970
addChangeRecordForPrimitiveVariables:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1971
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1972
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1973
    "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
  1974
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1975
    UpdateChangeFileQuerySignal raise ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1976
        self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1977
        Project notNil ifTrue:[
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1978
            Project addPrimitiveVariablesChangeFor:aClass
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1979
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1980
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1981
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1982
    "Modified: 20.1.1997 / 12:36:16 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1983
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1984
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1985
addChangeRecordForRemoveSelector:aSelector
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1986
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1987
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1988
    "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
  1989
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1990
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1991
        self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1992
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1993
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1994
    "Modified: 24.1.1997 / 19:10:48 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1995
!
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
addChangeRecordForRenameCategory:oldCategory to:newCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1998
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1999
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2000
    "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
  2001
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2002
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2003
        self writingChangeDo:[:aStream |
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2004
            self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2005
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2006
    ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2007
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2008
    "Modified: 24.1.1997 / 19:10:57 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2009
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2010
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2011
addChangeRecordForSnapshot:aFileName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2012
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2013
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2014
    "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
  2015
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2016
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2017
        self 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2018
            writingChangeWithTimeStamp:false 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2019
            perform:#addInfoRecord:to: 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2020
            with:('snapshot ' , aFileName).
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2021
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2022
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2023
    "Modified: 24.1.1997 / 19:12:25 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2024
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2025
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2026
addChangeRecordForSnapshot:aFileName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2027
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2028
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2029
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2030
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2031
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2032
        self addInfoRecord:('snapshot ' , aFileName) to:aStream
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2033
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2034
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2035
    "Modified: 24.1.1997 / 19:11:08 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2036
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2037
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2038
addChangeTimeStampTo:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2039
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2040
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2041
    "a timestamp - prepended to any change, except infoRecords"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2042
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2043
    |info|
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2044
2486
311a7ffb2793 no need to check for updatingChanges in #addChangeTimeStamp.
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2045
    info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName.
311a7ffb2793 no need to check for updatingChanges in #addChangeTimeStamp.
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2046
    self addInfoRecord:info to:aStream. aStream cr.
311a7ffb2793 no need to check for updatingChanges in #addChangeTimeStamp.
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2047
311a7ffb2793 no need to check for updatingChanges in #addChangeTimeStamp.
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  2048
    "Modified: 22.3.1997 / 17:14:10 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2049
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2050
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2051
addInfoRecord:aMessage
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2052
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2053
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2054
    "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
  2055
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2056
    UpdateChangeFileQuerySignal raise ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2057
        self writingChangeWithTimeStamp:false 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2058
             perform:#addInfoRecord:to: 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2059
             with:aMessage.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2060
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2061
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2062
    "Modified: 24.1.1997 / 19:13:14 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2063
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2064
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2065
changesStream
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2066
    "return a Stream for the writing changes file.
2195
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2067
     This returns a regular stream or a locked stream - according to
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2068
     the LockChangesFile settings 
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2069
     (recommended if multiple images operate on a common changes file)"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2070
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2071
    |streamType aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2072
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2073
    fileName := ObjectMemory nameForChanges.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2074
    
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2075
    LockChangesFile ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2076
        streamType := LockedFileStream. 
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2077
    ] ifFalse:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2078
        streamType := FileStream.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2079
    ].
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2080
    aStream := streamType oldFileNamed:fileName.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2081
    aStream isNil ifTrue:[
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2082
        aStream := streamType newFileNamed:fileName.
2195
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2083
        aStream isNil ifTrue:[
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2084
            self warn:'cannot create/update the changes file'.
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2085
            ^ nil
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2086
        ]
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  2087
    ].
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2088
    aStream setToEnd.
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  2089
    ^ aStream
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  2090
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  2091
    "Created: 28.10.1995 / 16:53:43 / cg"
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2092
    "Modified: 24.1.1997 / 19:14:27 / cg"
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  2093
!
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  2094
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2095
sourcesStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2096
    "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
  2097
     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
  2098
     source file; typically each classes source is kept
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2099
     in a separate file."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2100
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2101
    |aStream fileName|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2102
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2103
    fileName := ObjectMemory nameForSources.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2104
    aStream := FileStream oldFileNamed:fileName.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2105
    aStream isNil ifTrue:[
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  2106
        aStream := FileStream newFileNamed:fileName.
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  2107
        aStream isNil ifTrue:[
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  2108
            Transcript showCR:'cannot update sources file'.
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  2109
            ^ nil
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  2110
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2111
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2112
    aStream setToEnd.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2113
    ^ aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2114
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2115
    "Created: 28.10.1995 / 16:53:17 / cg"
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  2116
    "Modified: 18.5.1996 / 15:41:47 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2117
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2118
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2119
withoutUpdatingChangesDo:aBlock
2195
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2120
    "turn off change file update while evaluating aBlock."
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2121
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2122
    UpdateChangeFileQuerySignal 
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2123
    answer:false
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2124
    do:[
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2125
        aBlock value
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2126
    ].
2195
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2127
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  2128
    "Modified: 17.1.1997 / 20:48:05 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2129
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2130
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2131
!Class methodsFor:'compiling'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2132
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2133
compile:code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2134
    "compile code, aString for this class; 
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2135
     if successful update the method dictionary.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2136
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2137
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2138
    ^ self compilerClass 
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2139
	compile:code 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2140
	forClass:self
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2141
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2142
    "Modified: 13.12.1995 / 10:56:00 / cg"
328
claus
parents: 326
diff changeset
  2143
!
claus
parents: 326
diff changeset
  2144
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2145
compile:code classified:category
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2146
    "compile code, aString for this class; 
671
53de87163ad5 spelling
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2147
     if successful update the method dictionary. 
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2148
     The method is classified under category.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2149
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2150
1234
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2151
    ^ 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
  2152
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2153
    "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
  2154
!
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2155
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2156
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
  2157
    "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
  2158
     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
  2159
     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
  2160
     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
  2161
     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
  2162
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2163
    logged ifFalse:[
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2164
        self withoutUpdatingChangesDo:[
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2165
            ^ self compilerClass 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2166
                compile:code 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2167
                forClass:self 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2168
                inCategory:category
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2169
        ]
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2170
    ] ifTrue:[
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2171
        ^ self compilerClass 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2172
            compile:code 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2173
            forClass:self 
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2174
            inCategory:category
593af1cdd6ac added #compile:classified:logged: (to allow compilation without log)
Claus Gittinger <cg@exept.de>
parents: 1193
diff changeset
  2175
    ].
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2176
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2177
    "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
  2178
    "Created: 20.4.1996 / 12:30:35 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2179
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2180
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2181
compile:code notifying:requestor
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2182
    "compile code, aString for this class; on any error, notify
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2183
     requestor, anObject with the error reason.
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2184
     Returns the new method or nil (on failure)."
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2185
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2186
    ^ self compilerClass 
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2187
	compile:code 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2188
	forClass:self 
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2189
	notifying:requestor
742
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2190
a02a40052d0a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
  2191
    "Modified: 13.12.1995 / 11:02:40 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2192
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2193
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2194
recompile
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2195
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2196
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2197
    "recompile all methods
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2198
     used when a class changes instances and therefore all methods
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2199
     have to be recompiled"
2
claus
parents: 1
diff changeset
  2200
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2201
    self methodDictionary keys do:[:aSelector |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2202
        self recompile:aSelector
2
claus
parents: 1
diff changeset
  2203
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2204
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2205
    "Modified: 12.6.1996 / 11:51:15 / stefan"
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2206
    "Modified: 5.1.1997 / 19:56:23 / cg"
2
claus
parents: 1
diff changeset
  2207
!
claus
parents: 1
diff changeset
  2208
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2209
recompile:aSelector
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2210
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2211
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2212
    "recompile the method associated with the argument, aSelector;
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2213
     used when a superclass changes instances and we have to recompile
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2214
     subclasses"
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2215
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2216
    |cat code|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2217
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2218
    Class withoutUpdatingChangesDo:[
978
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2219
        MethodRedefinitionSignal ignoreIn:[
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2220
            cat := (self compiledMethodAt:aSelector) category.
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2221
            code := self sourceCodeAt:aSelector.
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2222
            self compilerClass compile:code forClass:self inCategory:cat
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2223
        ]
2
claus
parents: 1
diff changeset
  2224
    ]
978
e4957d71aadf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2225
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2226
    "Modified: 5.1.1997 / 19:56:54 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2227
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2228
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2229
recompileAll
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2230
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2231
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2232
    "recompile this class and all subclasses"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2233
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2234
    |classes|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2235
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2236
    classes := self subclasses.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2237
    self recompile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2238
    classes do:[:aClass |
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2239
        aClass recompileAll
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2240
    ]
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2241
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2242
    "Modified: 5.1.1997 / 19:56:29 / cg"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2243
!
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2244
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2245
recompileForSpeed:aSelector
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2246
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2247
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2248
    "recompile the method associated with the argument, aSelector;
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2249
     for highest speed (i.e. using the stc compiler, if supported by
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2250
     the architecture)."
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2251
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2252
    |cat code prev savedMethod|
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2253
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2254
    Class withoutUpdatingChangesDo:[
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2255
        MethodRedefinitionSignal ignoreIn:[
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2256
            savedMethod := self compiledMethodAt:aSelector.
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2257
            cat := savedMethod category.
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2258
            code := self sourceCodeAt:aSelector.
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2259
        
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2260
            prev := Compiler stcCompilation:#always.
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2261
            [
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2262
                self compilerClass compile:code forClass:self inCategory:cat
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2263
            ] valueNowOrOnUnwindDo:[
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2264
                Compiler stcCompilation:prev.
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2265
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2266
                (self compiledMethodAt:aSelector) isNil ifTrue:[
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2267
                    self primAddSelector:aSelector withMethod:savedMethod
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2268
                ]
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2269
            ]
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2270
        ]
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2271
    ]
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2272
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2273
    "Created: 5.1.1997 / 19:22:41 / cg"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2274
    "Modified: 5.1.1997 / 19:55:33 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2275
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2276
1876
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2277
recompileInvalidatedMethods
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2278
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2279
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2280
    "recompile all invalidated methods"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2281
1876
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2282
    self methodDictionary keysAndValuesDo:[:aSelector :aMethod |
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2283
        |trap trapCode trapByteCode|
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2284
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2285
        trap := aMethod trapMethodForNumArgs:aMethod numArgs.
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2286
        trapCode := trap code.
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2287
        trapByteCode := trap byteCode.
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2288
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2289
        (aMethod code = trapCode
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2290
        or:[aMethod byteCode == trapByteCode]) ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2291
            self recompile:aSelector
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2292
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2293
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2294
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2295
    "Modified: 12.6.1996 / 11:52:09 / stefan"
1876
c6904184e1c8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2296
    "Created: 4.11.1996 / 22:12:47 / cg"
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2297
    "Modified: 5.1.1997 / 19:56:59 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2298
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2299
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2300
recompileMethodsAccessingAny:setOfNames
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2301
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2302
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2303
    "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
  2304
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2305
    self recompileMethodsAccessingAny:setOfNames orSuper:false
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2306
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2307
    "Modified: 5.1.1997 / 19:57:05 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2308
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2309
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2310
recompileMethodsAccessingAny:setOfNames orSuper:superBoolean
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2311
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
  2312
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2313
    "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
  2314
     or super (if superBoolean is true)"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2315
2105
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2316
    |p|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2317
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2318
    self methodDictionary keys do:[:aSelector |
2105
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2319
        |m mustCompile lits source|
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2320
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2321
        m := self compiledMethodAt:aSelector.
2105
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2322
        mustCompile := nil.
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2323
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2324
        source := m source.
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2325
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2326
        "/ avoid parsing, if possible
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2327
        superBoolean ifFalse:[
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2328
            setOfNames size == 1 ifTrue:[
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2329
                (source findString:(setOfNames first)) == 0 ifTrue:[
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2330
                    mustCompile := false.
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2331
                ]
2104
fefe5f88f2e0 quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2332
            ]
2105
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2333
        ].
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2334
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2335
        mustCompile isNil ifTrue:[
2104
fefe5f88f2e0 quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2336
            p := Parser parseMethod:(m source) in:self.
fefe5f88f2e0 quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2337
            (p isNil 
fefe5f88f2e0 quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2338
             or:[(p usedVars notNil and:[p usedVars includesAny:setOfNames])
fefe5f88f2e0 quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2339
             or:[superBoolean and:[p usesSuper]]]) ifTrue:[
2105
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2340
                mustCompile := true
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2341
            ]
2104
fefe5f88f2e0 quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2342
        ].
fefe5f88f2e0 quicker recompilation if only a classVar has changed
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2343
2105
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2344
        mustCompile == true ifTrue:[
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2345
            self recompile:aSelector
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2346
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2347
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2348
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2349
    "Modified: 12.6.1996 / 11:52:35 / stefan"
2105
815fb9413872 oops - the last one wasn't good
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2350
    "Modified: 9.1.1997 / 02:07:40 / cg"
2309
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2351
!
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2352
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2353
recompileMethodsAccessingGlobal:aGlobalKey
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2354
    "{ Pragma: +optSpace }"
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2355
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2356
    "recompile all methods accessing the global variable aGlobalKey"
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2357
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2358
    self methodDictionary keys do:[:aSelector |
2321
2fdc6e08cd05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  2359
        |m lits|
2309
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2360
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2361
        m := self compiledMethodAt:aSelector.
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2362
        "/ can look at the methods literalArray ..
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2363
        m isWrapped ifTrue:[
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2364
            m := m originalMethod
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2365
        ].
2321
2fdc6e08cd05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  2366
        lits := m literals.
2fdc6e08cd05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  2367
        lits notNil ifTrue:[
2fdc6e08cd05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  2368
            (lits includes:aGlobalKey) ifTrue:[
2fdc6e08cd05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  2369
                self recompile:aSelector
2fdc6e08cd05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  2370
            ]
2309
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2371
        ]
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2372
    ]
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2373
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2374
    "Modified: 12.6.1996 / 11:52:35 / stefan"
9d0fafbb5855 support to recompile global accessors
Claus Gittinger <cg@exept.de>
parents: 2277
diff changeset
  2375
    "Created: 29.1.1997 / 17:57:55 / cg"
2321
2fdc6e08cd05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2312
diff changeset
  2376
    "Modified: 29.1.1997 / 23:51:11 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2377
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2378
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2379
!Class methodsFor:'enumerating'!
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2380
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2381
privateClassesDo:aBlock
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2382
    "evaluate aBlock on all of my private classes (if any)"
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2383
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2384
    |classes|
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2385
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2386
    (classes := self privateClasses) size > 0 ifTrue:[
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2387
        classes do:aBlock
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2388
    ].
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2389
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2390
    "Created: 26.10.1996 / 12:28:57 / cg"
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2391
    "Modified: 22.3.1997 / 16:17:36 / cg"
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2392
! !
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2393
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2394
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2395
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2396
ignoredMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2397
    "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
  2398
     from a source-file by replacing the 'methodsFor:' by 'ignoredMethodsFor:'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2399
     Returns a ClassCategoryReader to read in and skip methods."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2400
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2401
    ^ (self methodsFor:aCategory) ignoredProtocol
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2402
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2403
    "Modified: 10.2.1996 / 12:53:25 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2404
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2405
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2406
methods
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2407
    "this method allows fileIn of ST/V methods -
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2408
     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
  2409
     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
  2410
     categorized as 'ST/V methods'."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2411
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2412
    ^ ClassCategoryReader class:self category:'ST/V methods'
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2413
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2414
    "Modified: 10.2.1996 / 12:44:21 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2415
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2416
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2417
methodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2418
    "return a ClassCategoryReader to read in and compile methods for me."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2419
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2420
    ^ ClassCategoryReader class:self category:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2421
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2422
    "Modified: 10.2.1996 / 12:44:43 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2423
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2424
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2425
methodsForUndefined:categoryString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2426
    "ST-80 compatibility.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2427
     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
  2428
     For now, simply forward it."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2429
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2430
    ^ self methodsFor:categoryString
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2431
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2432
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2433
primitiveDefinitions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2434
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2435
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2436
     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
  2437
     unprocessed contents in the classes primitiveDefinitions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2438
     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
  2439
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2440
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2441
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2442
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2443
    "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
  2444
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2445
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2446
primitiveFunctions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2447
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2448
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2449
     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
  2450
     unprocessed contents in the classes primitiveFunctions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2451
     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
  2452
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2453
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2454
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2455
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2456
    "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
  2457
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2458
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2459
primitiveVariables
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2460
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2461
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2462
     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
  2463
     unprocessed contents in the classes primitiveVariables section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2464
     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
  2465
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2466
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2467
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2468
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2469
    "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
  2470
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2471
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2472
privateMethodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2473
    "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
  2474
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2475
     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
  2476
     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
  2477
     a privatMethodError exception."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2478
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2479
    ^ (self methodsFor:aCategory) privateProtocol
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2480
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2481
    "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
  2482
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2483
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2484
protectedMethodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2485
    "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
  2486
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2487
     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
  2488
     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
  2489
     a privatMethodError exception."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2490
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2491
    ^ (self methodsFor:aCategory) protectedProtocol
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2492
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2493
    "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
  2494
!
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
publicMethodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2497
    "this method allows fileIn of ENVY methods
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2498
     The publicMethods keyword is for documentation only; my default, methods
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2499
     are public anyway (for backward compatibility)."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2500
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2501
    ^ self methodsFor:aCategory
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2502
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2503
    "Modified: 10.2.1996 / 12:50:11 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2504
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2505
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2506
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2507
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2508
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2509
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  2510
2245
d2ae001f71c9 private class of a private class in a nameSpace
ca
parents: 2232
diff changeset
  2511
    |s owner ns nsName fullName superName cls topOwner|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2512
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2513
    owner := self owningClass.
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2514
1932
4d4c4563486b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
  2515
    owner isNil ifTrue:[
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2516
        ns := self nameSpace.
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2517
    ] ifFalse:[
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2518
        ns := self topOwningClass nameSpace
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2519
    ].
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2520
    fullName := FileOutNameSpaceQuerySignal raise == true.
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2521
        
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2522
    ((owner isNil and:[fullName not])
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2523
    or:[owner notNil and:[forceNameSpace and:[fullName not]]]) ifTrue:[
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2524
        (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2525
            nsName := ns name.
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2526
            (nsName includes:$:) ifTrue:[
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2527
                nsName := '''' , nsName , ''''
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2528
            ].
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2529
            aStream nextPutLine:'"{ NameSpace: ' , nsName , ' }"'; cr.
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  2530
        ]
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  2531
    ].
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2532
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
  2533
    "take care of nil-superclass"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2534
    superclass isNil ifTrue:[
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2535
        s := 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2536
    ] ifFalse:[
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2537
        fullName ifTrue:[
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2538
            s := superclass name
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  2539
        ] ifFalse:[
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2540
            (ns == superclass nameSpace 
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2541
            and:[superclass owningClass isNil]) ifTrue:[
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2542
                s := superclass nameWithoutPrefix
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2543
            ] ifFalse:[
2232
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2544
                "/ a very special (rare) situation:
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2545
                "/ my superclass resides in another nameSpace,
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2546
                "/ but there is something else named like this
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2547
                "/ to be found in my nameSpace (or a private class)
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2548
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2549
                superName := superclass nameWithoutNameSpacePrefix asSymbol.
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2550
                cls := self privateClassesAt:superName.
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2551
                cls isNil ifTrue:[
2245
d2ae001f71c9 private class of a private class in a nameSpace
ca
parents: 2232
diff changeset
  2552
                    (topOwner := self topOwningClass) isNil ifTrue:[
2356
7f7118456ed0 checkin from browser
ca
parents: 2335
diff changeset
  2553
                        ns := self nameSpace.
7f7118456ed0 checkin from browser
ca
parents: 2335
diff changeset
  2554
                        ns notNil ifTrue:[
7f7118456ed0 checkin from browser
ca
parents: 2335
diff changeset
  2555
                            cls := ns privateClassesAt:superName
7f7118456ed0 checkin from browser
ca
parents: 2335
diff changeset
  2556
                        ] ifFalse:[
7f7118456ed0 checkin from browser
ca
parents: 2335
diff changeset
  2557
                            "/ self error:'unexpected nil namespace'
7f7118456ed0 checkin from browser
ca
parents: 2335
diff changeset
  2558
                        ]
2245
d2ae001f71c9 private class of a private class in a nameSpace
ca
parents: 2232
diff changeset
  2559
                    ] ifFalse:[
d2ae001f71c9 private class of a private class in a nameSpace
ca
parents: 2232
diff changeset
  2560
                        cls := topOwner nameSpace at:superName.
d2ae001f71c9 private class of a private class in a nameSpace
ca
parents: 2232
diff changeset
  2561
                    ]
2232
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2562
                ].
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2563
                (cls notNil and:[cls ~~ superclass]) ifTrue:[
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2564
                    s := superclass nameSpace name , '::' , superName
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2565
                ] ifFalse:[
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2566
                    s := superName
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2567
                ]
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2568
            ]
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  2569
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2570
    ].
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  2571
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2572
    aStream nextPutAll:s.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2573
    aStream space.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2574
    self basicFileOutInstvarTypeKeywordOn:aStream.
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2575
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  2576
    fullName ifTrue:[
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2577
        owner isNil ifTrue:[
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2578
            aStream nextPutAll:'#'''; nextPutAll:(self name); nextPutAll:''''.
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2579
        ] ifFalse:[
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2580
            aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix).
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2581
        ]
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2582
    ] ifFalse:[
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  2583
        aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix).
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2584
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2585
345
claus
parents: 333
diff changeset
  2586
    aStream crtab. 
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2587
    aStream nextPutAll:'instanceVariableNames:'''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2588
    self printInstVarNamesOn:aStream indent:16.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2589
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2590
345
claus
parents: 333
diff changeset
  2591
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2592
    aStream nextPutAll:'classVariableNames:'''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2593
    self printClassVarNamesOn:aStream indent:16.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2594
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2595
345
claus
parents: 333
diff changeset
  2596
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2597
    aStream nextPutAll:'poolDictionaries:'''''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2598
345
claus
parents: 333
diff changeset
  2599
    aStream crtab.
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2600
    owner isNil ifTrue:[
1735
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2601
        "/ a public class
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2602
        aStream nextPutAll:'category:'.
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2603
        category isNil ifTrue:[
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2604
            s := ''''''
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2605
        ] ifFalse:[
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2606
            s := category asString storeString
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2607
        ].
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2608
        aStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2609
    ] ifFalse:[
1735
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2610
        "/ a private class
202f723a4edf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  2611
        aStream nextPutAll:'privateIn:'.
2049
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  2612
        fullName ifTrue:[
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  2613
            aStream nextPutAll:owner name.
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  2614
        ] ifFalse:[
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  2615
            aStream nextPutAll:owner nameWithoutNameSpacePrefix.
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  2616
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2617
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2618
    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
  2619
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2620
    "Created: 4.1.1997 / 20:38:16 / cg"
2232
1d184023197f care for filing out a namespace-subclass of a global-class,
Claus Gittinger <cg@exept.de>
parents: 2206
diff changeset
  2621
    "Modified: 23.1.1997 / 02:06:18 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2622
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2623
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2624
basicFileOutInstvarTypeKeywordOn:aStream
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2625
    "a helper for fileOutDefinition"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2626
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2627
    |isVar s|
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2628
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2629
    superclass isNil ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2630
        isVar := self isVariable
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2631
    ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2632
        "I cant remember what this is for ?"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2633
        isVar := (self isVariable and:[superclass isVariable not])
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2634
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2635
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2636
    isVar ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2637
        self isBytes ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2638
            s := 'variableByteSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2639
        ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2640
            self isWords ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2641
                s := 'variableWordSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2642
            ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2643
                self isLongs ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2644
                    s := 'variableLongSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2645
                ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2646
                    self isFloats ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2647
                        s := 'variableFloatSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2648
                    ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2649
                        self isDoubles ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2650
                            s := 'variableDoubleSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2651
                        ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2652
                            self isSignedWords ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2653
                                s := 'variableSignedWordSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2654
                            ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2655
                                self isSignedLongs ifTrue:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2656
                                    s := 'variableSignedLongSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2657
                                ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2658
                                    s := 'variableSubclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2659
                                ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2660
                            ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2661
                        ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2662
                    ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2663
                ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2664
            ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2665
        ]
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2666
    ] ifFalse:[
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2667
        s := 'subclass:'
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2668
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2669
    aStream nextPutAll:s.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2670
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2671
    "Created: 11.10.1996 / 18:57:29 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2672
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2673
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2674
binaryFileOut
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2675
    "create a file 'class.cls' (in the current projects fileOut-directory),
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2676
     consisting of all methods in myself in a portable binary format. 
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2677
     The methods source is saved by reference
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2678
     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
  2679
     That sourcefile needs to be present after reload in order to be
895
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
  2680
     browsable."
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2681
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2682
    self binaryFileOutWithSourceMode:#reference
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2683
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2684
    "Modified: 5.1.1997 / 15:40:05 / cg"
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2685
!
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2686
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2687
binaryFileOutOn:aStream
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2688
    "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
  2689
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2690
    self binaryFileOutOn:aStream sourceMode:#reference 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2691
!
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2692
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2693
binaryFileOutOn:aStream sourceMode:sourceMode
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2694
    "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
  2695
     a portable binary format. 
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2696
     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
  2697
	#keep - include the source
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2698
	#reference - include a reference to the sourceFile
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2699
	#discard - dont save sources.
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2700
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2701
     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
  2702
     in order to be browsable."
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2703
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2704
    |bos|
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2705
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2706
    bos := BinaryObjectStorage onNew:aStream.
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2707
    bos sourceMode:sourceMode.
880
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2708
    bos nextPutClasses:(Array with:self).
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2709
    bos close.
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2710
!
e1453c16fe1b more on binary class storage
Claus Gittinger <cg@exept.de>
parents: 877
diff changeset
  2711
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2712
binaryFileOutWithSourceMode:sourceMode
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2713
    "create a file 'class.cls' (in the current projects fileOut-directory),
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2714
     consisting of all methods in myself in a portable binary format. 
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2715
     The argument controls how sources are to be saved:
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2716
        #keep - include the source
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2717
        #reference - include a reference to the sourceFile
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2718
        #discard - dont save sources.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2719
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2720
     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
  2721
     in order to be browsable."
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2722
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2723
    |baseName fileName aStream dirName|
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2724
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2725
    baseName := (Smalltalk fileNameForClass:self name).
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2726
    fileName := baseName , '.cls'.
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2727
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2728
    Project notNil ifTrue:[
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2729
        dirName := Project currentProjectDirectory
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2730
    ] ifFalse:[
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2731
        dirName := ''
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2732
    ].
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2733
    fileName := dirName , fileName.
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2734
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2735
    aStream := FileStream newFileNamed:fileName.
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2736
    aStream isNil ifTrue:[
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2737
        ^ FileOutErrorSignal 
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2738
                raiseRequestWith:fileName
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2739
                errorString:('cannot create file:', fileName)
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2740
    ].
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2741
        
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2742
    aStream binary.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2743
    self binaryFileOutOn:aStream sourceMode:sourceMode.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2744
    aStream close.
2068
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2745
6d5711ab4a44 care for projects fileOut directory in binaryFileOut
Claus Gittinger <cg@exept.de>
parents: 2059
diff changeset
  2746
    "Modified: 5.1.1997 / 15:39:30 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2747
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  2748
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2749
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2750
    "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
  2751
     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
  2752
     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
  2753
     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
  2754
     case of errors (for example: disk full). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2755
     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
  2756
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2757
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2758
    |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
  2759
     mySourceFileName sameFile s mySourceFileID anySourceRef|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2760
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2761
    baseName := (Smalltalk fileNameForClass:self name).
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2762
    fileNameString := baseName , '.st'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2763
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2764
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2765
     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
  2766
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2767
    Project notNil ifTrue:[
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2768
        dirName := Project currentProjectDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2769
    ] ifFalse:[
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2770
        dirName := ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2771
    ].
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2772
    fileNameString := dirName , fileNameString.
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2773
    fileName := fileNameString asFilename.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2774
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2775
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2776
     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
  2777
     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
  2778
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2779
    "
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2780
    (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
  2781
        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
  2782
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2783
        "/ 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
  2784
        "/ 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
  2785
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2786
        anySourceRef := false.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2787
        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
  2788
            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
  2789
                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
  2790
            ]
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2791
        ].
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2792
        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
  2793
            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
  2794
                anySourceRef := true
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2795
            ]
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2796
        ].
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
  2797
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2798
        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
  2799
            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
  2800
            s notNil ifTrue:[
1860
e65f13417bfc changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
  2801
                mySourceFileID := s pathName asFilename info id.
e65f13417bfc changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
  2802
                sameFile := (fileName info 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
  2803
                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
  2804
            ] 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
  2805
                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
  2806
                    "
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2807
                     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
  2808
                     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
  2809
                     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
  2810
                     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
  2811
                     (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
  2812
                    "
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2813
                    mySourceFileName := Smalltalk getSourceFileName:classFilename. 
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2814
                    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
  2815
                    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
  2816
                        mySourceFileName notNil ifTrue:[
1860
e65f13417bfc changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
  2817
                            sameFile := (fileName info id) == (mySourceFileName asFilename info 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
  2818
                        ]
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2819
                    ].
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2820
                ]
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2821
            ].
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2822
        ].
e0411b74b808 allow fileOut over existing file, if all of my methods have local source strings
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  2823
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2824
        sameFile ifTrue:[
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2825
            ^ FileOutErrorSignal 
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2826
                raiseRequestWith:fileNameString
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2827
                errorString:('may not overwrite sourcefile:', fileNameString)
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2828
        ].
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
  2829
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2830
        fileName copyTo:('/tmp/' , baseName , '.sav').
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2831
        newFileName := dirName , baseName , '.new'.
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2832
        needRename := true
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2833
    ] ifFalse:[
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2834
        newFileName := fileNameString.
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2835
        needRename := false
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2836
    ].
557
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
    aStream := FileStream newFileNamed:newFileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2839
    aStream isNil ifTrue:[
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2840
        ^ FileOutErrorSignal 
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2841
                raiseRequestWith:newFileName
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2842
                errorString:('cannot create file:', newFileName)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2843
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2844
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2845
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2846
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2847
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2848
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2849
     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
  2850
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2851
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2852
    needRename ifTrue:[
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2853
        newFileName asFilename copyTo:fileNameString.
967
705626ba3988 better check for overwriting sources
ca
parents: 958
diff changeset
  2854
        newFileName asFilename delete
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2855
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2856
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2857
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2858
     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
  2859
     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
  2860
     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
  2861
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2862
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2863
    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
  2864
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2865
    "Modified: 7.6.1996 / 09:14:43 / stefan"
1860
e65f13417bfc changes for new return from OS>>infoOf:
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
  2866
    "Modified: 1.11.1996 / 20:23:57 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2867
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2868
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2869
fileOutAllDefinitionsOn:aStream
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2870
    "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
  2871
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2872
    self fileOutDefinitionOn:aStream.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2873
    aStream nextPutChunkSeparator. 
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2874
    aStream cr; cr.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2875
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2876
    "/
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2877
    "/ optional classInstanceVariables
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2878
    "/
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2879
    self class instanceVariableString isBlank ifFalse:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2880
        self fileOutClassInstVarDefinitionOn:aStream.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2881
        aStream nextPutChunkSeparator. 
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2882
        aStream cr; cr
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2883
    ].
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2884
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2885
    self privateClassesSorted do:[:aClass |
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2886
        aClass fileOutAllDefinitionsOn:aStream
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2887
    ]
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2888
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2889
    "Created: 15.10.1996 / 11:15:19 / cg"
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2890
    "Modified: 22.3.1997 / 16:11:56 / cg"
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2891
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2892
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2893
fileOutAllMethodsOn:aStream
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2894
    |collectionOfCategories|
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2895
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2896
    collectionOfCategories := self class categories asSortedCollection.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2897
    collectionOfCategories notNil ifTrue:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2898
        collectionOfCategories do:[:aCategory |
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2899
            self class fileOutCategory:aCategory on:aStream.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2900
            aStream cr
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2901
        ]
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2902
    ].
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2903
    collectionOfCategories := self categories asSortedCollection.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2904
    collectionOfCategories notNil ifTrue:[
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2905
        collectionOfCategories do:[:aCategory |
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2906
            self fileOutCategory:aCategory on:aStream.
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2907
            aStream cr
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2908
        ]
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2909
    ].
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2910
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2911
    self privateClassesSorted do:[:aClass |
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2912
        aClass fileOutAllMethodsOn:aStream
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2913
    ].
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2914
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2915
    "Created: 15.10.1996 / 11:13:00 / cg"
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2916
    "Modified: 22.3.1997 / 16:12:17 / cg"
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2917
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2918
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2919
fileOutCategory:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2920
    "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
  2921
     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
  2922
     directory."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2923
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2924
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2925
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2926
    fileName := name , '-' , aCategory , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2927
    fileName replaceAll:(Character space) by:$_.
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
     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
  2931
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2932
    Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2933
	fileName := Project currentProjectDirectory , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2934
    ].
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2935
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2936
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2937
     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
  2938
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2939
    fileName asFilename exists ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2940
	fileName asFilename copyTo:(fileName , '.sav')
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
    aStream := FileStream newFileNamed:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2943
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2944
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2945
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2946
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2947
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2948
    self fileOutCategory:aCategory on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2949
    aStream close
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2950
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2951
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2952
fileOutCategory:aCategory except:skippedMethods only:savedMethods on:aStream
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2953
    "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
  2954
     If skippedMethods is nonNil, those are not saved.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2955
     If savedMethods is nonNil, only those are saved.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2956
     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
  2957
     fileOut for what this is needed."
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2958
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  2959
    |dict source sortedSelectors first privacy interestingMethods cat|
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2960
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2961
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2962
    dict notNil ifTrue:[
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2963
        interestingMethods := OrderedCollection new.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  2964
        dict do:[:aMethod |
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2965
            |wanted|
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2966
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2967
            (aCategory = aMethod category) ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2968
                skippedMethods notNil ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2969
                    wanted := (skippedMethods includesIdentical:aMethod) not
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2970
                ] ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2971
                    savedMethods notNil ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2972
                        wanted := (savedMethods includesIdentical:aMethod).
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2973
                    ] ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2974
                        wanted := true
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2975
                    ]
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2976
                ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2977
                wanted ifTrue:[interestingMethods add:aMethod].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2978
            ]
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2979
        ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2980
        interestingMethods notEmpty ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2981
            first := true.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2982
            privacy := nil.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2983
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2984
            "/
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2985
            "/ sort by selector
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2986
            "/
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2987
            sortedSelectors := interestingMethods collect:[:m | self selectorAtMethod:m].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2988
            sortedSelectors sortWith:interestingMethods.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2989
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2990
            interestingMethods do:[:aMethod |
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2991
                first ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2992
                    privacy ~~ aMethod privacy ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2993
                        first := true.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2994
                        aStream space.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2995
                        aStream nextPutChunkSeparator.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2996
                    ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2997
                    aStream cr; cr
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2998
                ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  2999
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3000
                privacy := aMethod privacy.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3001
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3002
                first ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3003
                    aStream nextPutChunkSeparator.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3004
                    self printClassNameOn:aStream.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3005
                    privacy ~~ #public ifTrue:[
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3006
                        aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'.
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3007
                    ] ifFalse:[
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3008
                        aStream nextPutAll:' methodsFor:'.
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3009
                    ].
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3010
                    cat := aCategory.
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3011
                    cat isNil ifTrue:[ cat := '' ].
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3012
                    aStream nextPutAll:aCategory asString storeString.
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3013
                    aStream nextPutChunkSeparator; cr; cr.
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3014
                    first := false.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3015
                ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3016
                source := aMethod source.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3017
                source isNil ifTrue:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3018
                    FileOutErrorSignal 
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3019
                        raiseRequestWith:self
1546
0e91715409d0 pass name of method to exception, if fileOut fails due to
Claus Gittinger <cg@exept.de>
parents: 1514
diff changeset
  3020
                        errorString:'no source for method: ', (aMethod displayString)
956
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3021
                ] ifFalse:[
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3022
                    aStream nextChunkPut:source.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3023
                ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3024
            ].
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3025
            aStream space.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3026
            aStream nextPutChunkSeparator.
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3027
            aStream cr
ee9763891b90 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
  3028
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3029
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3030
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3031
    "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
  3032
    "Modified: 12.6.1996 / 11:37:33 / stefan"
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3033
    "Modified: 15.11.1996 / 11:32:21 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3034
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3035
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3036
fileOutCategory:aCategory on:aStream
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3037
    "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
  3038
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3039
    self fileOutCategory:aCategory except:nil only:nil on:aStream
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3040
!
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3041
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3042
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3043
    "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
  3044
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3045
    aStream nextPutAll:(name , ' class instanceVariableNames:''').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3046
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3047
    aStream nextPutAll:''''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3048
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3049
    "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
  3050
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3051
    aStream cr; cr; nextPut:(Character doubleQuote); cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3052
    aStream space; 
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3053
            nextPutLine:'The following class instance variables are inherited by this class:';
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3054
            cr.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3055
    self allSuperclassesDo:[:aSuperClass |
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3056
        aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3057
        aStream nextPutLine:(aSuperClass class instanceVariableString).
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3058
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3059
    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
  3060
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3061
    "Created: 10.12.1995 / 16:31:25 / cg"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3062
    "Modified: 9.11.1996 / 00:11:07 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3063
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3064
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3065
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3066
    "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
  3067
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3068
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3069
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  3070
    self printClassNameOn:aStream.
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  3071
    aStream nextPutAll:' comment:'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3072
    (comment := self comment) isNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3073
        s := ''''''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3074
    ] ifFalse:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3075
        s := comment storeString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3076
    ].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3077
    aStream nextPutAllAsChunk:s.
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  3078
    aStream nextPutChunkSeparator.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3079
    aStream cr
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3080
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  3081
    "Modified: 21.12.1996 / 13:36:01 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3082
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3083
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3084
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3085
    "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
  3086
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  3087
    ^ self basicFileOutDefinitionOn:aStream withNameSpace:false
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  3088
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  3089
    "Modified: 4.1.1997 / 20:55:18 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3090
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3091
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3092
fileOutIn:aFileDirectory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3093
    "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
  3094
     directory aFileDirectory (ignoring any directory setting in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3095
     the current porject). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3096
     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
  3097
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3098
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3099
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3100
    fileName := (Smalltalk fileNameForClass:self name) , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3101
    aStream := FileStream newFileNamed:fileName in:aFileDirectory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3102
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3103
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3104
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3105
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3106
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3107
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3108
    aStream close
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3109
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3110
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3111
fileOutMethod:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3112
    "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
  3113
     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
  3114
     directory."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3115
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3116
    |aStream fileName selector|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3117
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3118
    selector := self selectorAtMethod:aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3119
    selector notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3120
	fileName := name , '-' , selector, '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3121
	fileName replaceAll:$: by:$_.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3122
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3123
	 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
  3124
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3125
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3126
	    fileName := Project currentProjectDirectory , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3127
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3128
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3129
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3130
	 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
  3131
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3132
	fileName asFilename exists ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3133
	    fileName asFilename copyTo:(fileName , '.sav')
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3134
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3135
	aStream := FileStream newFileNamed:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3136
	aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3137
	    ^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3138
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3139
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3140
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3141
	self fileOutMethod:aMethod on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3142
	aStream close
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3143
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3144
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3145
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3146
fileOutMethod:aMethod on:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3147
    "file out the method, aMethod onto aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3148
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3149
    |dict cat source privacy|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3150
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3151
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3152
    dict notNil ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3153
        aStream nextPutChunkSeparator.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3154
        self printClassNameOn:aStream.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3155
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3156
        (privacy := aMethod privacy) ~~ #public ifTrue:[
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3157
            aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3158
        ] ifFalse:[
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3159
            aStream nextPutAll:' methodsFor:'.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3160
        ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3161
        cat := aMethod category.
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3162
        cat isNil ifTrue:[
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3163
            cat := ''
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3164
        ].
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3165
        aStream nextPutAll:cat asString storeString.
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3166
        aStream nextPutChunkSeparator; cr; cr.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3167
        source := aMethod source.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3168
        source isNil ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3169
            FileOutErrorSignal 
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3170
                raiseRequestWith:self
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3171
                errorString:('no source for method: ' ,
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3172
                             self name , '>>' ,
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3173
                             (self selectorAtMethod:aMethod))
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3174
        ] ifFalse:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3175
            aStream nextChunkPut:source.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3176
        ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3177
        aStream space.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3178
        aStream nextPutChunkSeparator.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3179
        aStream cr
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3180
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3181
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3182
    "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
  3183
    "Modified: 12.6.1996 / 11:44:41 / stefan"
1977
6d288d63c918 oops - handle single quotes in method-category
Claus Gittinger <cg@exept.de>
parents: 1951
diff changeset
  3184
    "Modified: 15.11.1996 / 11:32:43 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3185
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3186
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3187
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3188
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3189
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3190
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3191
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3192
    "Created: 15.11.1995 / 12:53:32 / cg"
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3193
    "Modified: 3.1.1997 / 17:50:28 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3194
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3195
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3196
fileOutOn:aStream withTimeStamp:stampIt
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3197
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3198
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3199
    |collectionOfCategories copyrightMethod copyrightText comment versionMethod skippedMethods
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  3200
     meta|
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3201
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3202
    self isLoaded ifFalse:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3203
        ^ FileOutErrorSignal 
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3204
            raiseRequestWith:self
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3205
                 errorString:'will not fileOut unloaded classes'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3206
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3207
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3208
    meta := self class.
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3209
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3210
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3211
     if there is a copyright method, add a copyright comment
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3212
     at the beginning, taking the string from the copyright method.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3213
     We cannot do this unconditionally - that would lead to my copyrights
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3214
     being put on your code ;-).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3215
     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
  3216
     copyright string at the beginning be preserved .... even if the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3217
     code was edited in the browser and filedOut.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3218
    "
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3219
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3220
        "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3221
         get the copyright methods source,
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3222
         and insert at beginning.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3223
        "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3224
        copyrightText := copyrightMethod source.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3225
        copyrightText isNil ifTrue:[
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3226
            "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3227
             no source available - trigger an error
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3228
            "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3229
            FileOutErrorSignal
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3230
                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
  3231
            ^ self
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3232
        ].
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3233
        "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3234
         strip off the selector-line
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3235
        "
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3236
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3237
        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
  3238
"/        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
  3239
        copyrightText := copyrightText asString.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3240
        aStream nextPutAllAsChunk:copyrightText.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3241
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3242
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3243
    stampIt ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3244
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3245
        "/ first, a timestamp
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3246
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3247
        aStream nextPutAll:(Smalltalk timeStamp).
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3248
        aStream nextPutChunkSeparator. 
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3249
        aStream cr; cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3250
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3251
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3252
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3253
    "/ then the definition
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3254
    "/
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  3255
    self fileOutAllDefinitionsOn:aStream.
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  3256
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  3257
    "/
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3258
    "/ a comment - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3259
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3260
    (comment := self comment) notNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3261
        self fileOutCommentOn:aStream.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3262
        aStream cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3263
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3264
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3265
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3266
    "/ primitive definitions - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3267
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3268
    self fileOutPrimitiveSpecsOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3269
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3270
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3271
    "/ 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
  3272
    "/ 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
  3273
    "/         avoid sourcePosition-shifts when checked out later.
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  3274
    "/         (RCS expands this string, so its size is not constant)
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3275
    "/
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3276
    collectionOfCategories := meta categories asSortedCollection.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3277
    collectionOfCategories notNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3278
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3279
        "/ 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
  3280
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3281
        (collectionOfCategories includes:'documentation') ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3282
            versionMethod := meta compiledMethodAt:#version.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3283
            versionMethod notNil ifTrue:[
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3284
                skippedMethods := Array with:versionMethod
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3285
            ].
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3286
            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
  3287
            aStream cr.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3288
        ].
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3289
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3290
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3291
        "/ initialization next (if any)
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3292
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3293
        (collectionOfCategories includes:'initialization') ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3294
            meta fileOutCategory:'initialization' on:aStream.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3295
            aStream cr.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3296
        ].
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3297
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3298
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3299
        "/ instance creation next (if any)
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3300
        "/
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3301
        (collectionOfCategories includes:'instance creation') ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3302
            meta fileOutCategory:'instance creation' on:aStream.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3303
            aStream cr.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3304
        ].
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3305
        collectionOfCategories do:[:aCategory |
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3306
            ((aCategory ~= 'documentation')
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3307
            and:[(aCategory ~= 'initialization')
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3308
            and:[aCategory ~= 'instance creation']]) ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3309
                meta fileOutCategory:aCategory on:aStream.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3310
                aStream cr
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3311
            ]
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3312
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3313
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3314
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3315
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3316
    "/ methods from all categories in myself
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3317
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3318
    collectionOfCategories := self categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3319
    collectionOfCategories notNil ifTrue:[
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3320
        collectionOfCategories do:[:aCategory |
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3321
            self fileOutCategory:aCategory on:aStream.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3322
            aStream cr
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3323
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3324
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3325
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3326
    "/
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  3327
    "/ any private classes' methods
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  3328
    "/
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  3329
    self privateClassesSorted do:[:aClass |
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  3330
        aClass fileOutAllMethodsOn:aStream
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  3331
    ].
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  3332
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  3333
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  3334
    "/
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3335
    "/ finally, the previously skipped version method
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3336
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3337
    versionMethod notNil ifTrue:[
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3338
        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
  3339
    ].
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3340
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3341
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3342
    "/ optionally an initialize message
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  3343
    "/
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  3344
    (meta implements:#initialize) ifTrue:[
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  3345
        self printClassNameOn:aStream. aStream nextPutAll:' initialize'.
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3346
        aStream nextPutChunkSeparator.
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  3347
        aStream cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3348
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3349
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3350
    "Created: 15.11.1995 / 12:53:06 / cg"
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  3351
    "Modified: 22.3.1997 / 16:12:47 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3352
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3353
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3354
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3355
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3356
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3357
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3358
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3359
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3360
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3361
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3362
    (s := self primitiveDefinitionsString) notNil ifTrue:[
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3363
        aStream nextPutChunkSeparator.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3364
        self printClassNameOn:aStream.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3365
        aStream nextPutAll:' primitiveDefinitions';
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3366
                nextPutChunkSeparator;
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3367
                cr.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3368
        aStream nextPutAll:s.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3369
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3370
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3371
    (s := self primitiveVariablesString) notNil ifTrue:[
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3372
        aStream nextPutChunkSeparator.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3373
        self printClassNameOn:aStream.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3374
        aStream nextPutAll:' primitiveVariables';
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3375
                nextPutChunkSeparator;
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3376
                cr.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3377
        aStream nextPutAll:s.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3378
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3379
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3380
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3381
    "Modified: 8.1.1997 / 17:45:40 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3382
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3383
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3384
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3385
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3386
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3387
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3388
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3389
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3390
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3391
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3392
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3393
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3394
     primitive functions - if any
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
    (s := self primitiveFunctionsString) notNil ifTrue:[
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3397
        aStream nextPutChunkSeparator.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3398
        self printClassNameOn:aStream.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3399
        aStream nextPutAll:' primitiveFunctions';
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3400
                nextPutChunkSeparator;
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3401
                cr.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3402
        aStream nextPutAll:s.
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3403
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3404
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3405
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  3406
    "Modified: 8.1.1997 / 17:45:51 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3407
! !
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
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3410
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3411
htmlDocumentation
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3412
    ^ HTMLDocGenerator htmlDocOf:self
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3413
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3414
    "Created: 22.3.1997 / 14:18:23 / cg"
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3415
!
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3416
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3417
nameWithoutNameSpacePrefix
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3418
    "helper for fileOut and others - return my names printString, 
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3419
     without any nameSpace prefix (but with owningClasses prefix)"
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3420
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3421
    |nm idx owner|
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3422
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3423
    nm := self nameWithoutPrefix.
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3424
    (owner := self owningClass) isNil ifTrue:[
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3425
        ^ nm
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3426
    ].
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3427
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3428
    ^ (owner nameWithoutNameSpacePrefix , '::' , nm)
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3429
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3430
    "a public class:
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3431
     Array name                 
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3432
     Array nameWithoutPrefix    
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3433
     Array nameWithoutNameSpacePrefix 
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3434
    "
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3435
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3436
    "a private class:
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3437
     Method::MethodWhoInfo name                         
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3438
     Method::MethodWhoInfo nameWithoutPrefix            
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3439
     Method::MethodWhoInfo nameWithoutNameSpacePrefix   
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3440
    "
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3441
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3442
    "a namespace class:
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3443
     CodingExamples::TopClass name                      
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3444
     CodingExamples::TopClass nameWithoutPrefix         
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3445
     CodingExamples::TopClass nameWithoutNameSpacePrefix
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3446
    "
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3447
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3448
    "a private class in a namespace class:
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3449
     CodingExamples::TopClass::SubClass name   
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3450
     CodingExamples::TopClass::SubClass nameWithoutPrefix 
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3451
     CodingExamples::TopClass::SubClass nameWithoutNameSpacePrefix
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3452
    "
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3453
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3454
    "Modified: 5.1.1997 / 18:22:57 / cg"
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3455
!
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3456
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  3457
nameWithoutPrefix
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  3458
    "helper for fileOut and others - return my names printString, 
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  3459
     without any owningClass or nameSpace prefix"
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  3460
1746
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  3461
    |nm idx|
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  3462
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  3463
    nm := self name.
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  3464
    idx := nm lastIndexOf:$:.
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3465
    idx == 0 ifTrue:[
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3466
        ^ nm
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3467
    ].
1746
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  3468
    ^ nm copyFrom:idx+1.
b3d129085905 print private metaclasses nicer
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  3469
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3470
    "a public class:
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3471
     Array name                 
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3472
     Array nameWithoutPrefix    
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3473
     Array nameWithoutNameSpacePrefix 
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  3474
    "
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3475
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3476
    "a private class:
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3477
     Method::MethodWhoInfo name                         
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3478
     Method::MethodWhoInfo nameWithoutPrefix            
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3479
     Method::MethodWhoInfo nameWithoutNameSpacePrefix   
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  3480
    "
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  3481
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3482
    "a namespace class:
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3483
     CodingExamples::TopClass name                      
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3484
     CodingExamples::TopClass nameWithoutPrefix         
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3485
     CodingExamples::TopClass nameWithoutNameSpacePrefix
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3486
    "
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3487
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3488
    "a private class in a namespace class:
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3489
     CodingExamples::TopClass::SubClass name   
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3490
     CodingExamples::TopClass::SubClass nameWithoutPrefix 
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3491
     CodingExamples::TopClass::SubClass nameWithoutNameSpacePrefix
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3492
    "
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3493
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  3494
    "Modified: 5.1.1997 / 18:23:14 / cg"
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  3495
!
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  3496
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3497
printClassNameOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3498
    "helper for fileOut - print my name if I am not a Metaclass;
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3499
     otherwise my name without -class followed by space-class.
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3500
     Private classes always print their owning-class as nameSpace
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3501
     prefix; non-private ones print without, except if the
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3502
     FileOutNameSpaceQuery returns true. The last feature is used
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3503
     with changefile updates - here, the full name is wanted."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3504
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3505
    |nm|
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3506
2049
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3507
    FileOutNameSpaceQuerySignal raise == false ifTrue:[
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3508
        nm := self nameWithoutNameSpacePrefix
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3509
    ] ifFalse:[
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3510
        nm := self name.
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  3511
    ].
2049
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3512
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3513
    self isMeta ifTrue:[
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3514
        (nm endsWith:' class') ifTrue:[
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  3515
            nm := nm copyWithoutLast:6.
2049
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3516
            aStream nextPutAll:nm; nextPutAll:' class'.
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3517
            ^ self
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3518
        ]
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3519
    ].
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3520
    aStream nextPutAll:nm.
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3521
308ce0c3828a dont prefix the nameSpace when filing out privateClasses.
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  3522
    "Modified: 3.1.1997 / 20:41:26 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3523
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3524
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3525
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3526
    "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
  3527
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3528
    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
  3529
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3530
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3531
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3532
    "print myself and all subclasses on aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3533
     recursively calls itself to print subclasses. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3534
     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
  3535
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3536
    |nm|
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3537
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3538
    nm := self name.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3539
    aStream spaces:indent; bold; nextPutAll:nm; normal; nextPutAll:' ('.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3540
    self printInstVarNamesOn:aStream indent:(indent + nm size + 2).
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3541
    aStream nextPutLine:')'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3542
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3543
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3544
        aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3545
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3546
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3547
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3548
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3549
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3550
     printStream close"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3551
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3552
    "Modified: 13.12.1996 / 14:13:06 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3553
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3554
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3555
printOutCategory:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3556
    "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
  3557
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3558
    |dict any|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3559
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3560
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3561
    dict notNil ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3562
        any := false.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3563
        dict do:[:aMethod |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3564
            (aCategory = aMethod category) ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3565
                any := true
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3566
            ]
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3567
        ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3568
        any ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3569
             aPrintStream italic.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3570
             aPrintStream nextPutAll:aCategory.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3571
             aPrintStream normal.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3572
             aPrintStream cr; cr.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3573
             dict do:[:aMethod |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3574
                 (aCategory = aMethod category) ifTrue:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3575
                     self printOutSource:(aMethod source) on:aPrintStream.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3576
                     aPrintStream cr; cr
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3577
                 ]
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3578
             ].
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3579
             aPrintStream cr
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3580
         ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3581
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3582
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3583
    "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
  3584
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3585
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3586
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3587
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3588
333
claus
parents: 328
diff changeset
  3589
    |comment s|
claus
parents: 328
diff changeset
  3590
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3591
    aPrintStream nextPutAll:'class                '; bold; nextPutLine:name; normal. 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3592
    aPrintStream nextPutAll:'superclass           '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3593
    superclass isNil ifTrue:[
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3594
        s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3595
    ] ifFalse:[
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3596
        s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3597
    ].
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3598
    aPrintStream nextPutLine:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3599
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3600
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3601
    self printInstVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3602
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3603
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3604
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3605
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3606
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3607
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3608
    category notNil ifTrue:[
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3609
        aPrintStream nextPutAll:'category             '; 
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3610
                     nextPutLine:(category printString).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3611
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3612
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  3613
    (comment := self comment) notNil ifTrue:[
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3614
        aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3615
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3616
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3617
    "Created: 10.12.1995 / 16:30:47 / cg"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3618
    "Modified: 9.11.1996 / 00:13:37 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3619
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3620
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3621
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3622
    "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
  3623
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3624
    |collectionOfCategories|
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
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3627
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3628
    collectionOfCategories := self class categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3629
    collectionOfCategories notNil ifTrue:[
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3630
        aPrintStream nextPutLine:'class protocol'.
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3631
        aPrintStream cr.
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3632
        collectionOfCategories do:[:aCategory |
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3633
            self class printOutCategory:aCategory on:aPrintStream
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3634
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3635
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3636
    collectionOfCategories := self categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3637
    collectionOfCategories notNil ifTrue:[
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3638
        aPrintStream nextPutLine:'instance protocol'.
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3639
        aPrintStream cr.
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3640
        collectionOfCategories do:[:aCategory |
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3641
            self printOutCategory:aCategory on:aPrintStream
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3642
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3643
    ]
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3644
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3645
    "Modified: 9.11.1996 / 00:14:11 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3646
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3647
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3648
printOutSource:aString on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3649
    "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
  3650
     comments are printed italic"
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
    |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
  3653
    text := aString asStringCollection.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3654
    aPrintStream bold.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3655
    aPrintStream nextPutAll:(text at:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3656
    aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3657
    aPrintStream cr.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3658
    inComment := false.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3659
    textSize := text size.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3660
    textIndex := 2.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3661
    [textIndex <= textSize] whileTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3662
	line := text at:textIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3663
	((line occurrencesOf:Character doubleQuote) == 0) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3664
	    aPrintStream nextPutAll:line
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3665
	] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3666
	    lineSize := line size.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3667
	    lineIndex := 1.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3668
	    [lineIndex <= lineSize] whileTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3669
		aCharacter := line at:lineIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3670
		(aCharacter == Character doubleQuote) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3671
		    inComment ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3672
			aPrintStream normal.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3673
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3674
			inComment := false
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3675
		    ] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3676
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3677
			aPrintStream italic.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3678
			inComment := true
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3679
		    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3680
		] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3681
		    aPrintStream nextPut:aCharacter
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3682
		].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3683
		lineIndex := lineIndex + 1
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3684
	    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3685
	].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3686
	aPrintStream cr.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  3687
	textIndex := textIndex + 1
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3688
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3689
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3690
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3691
!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
  3692
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3693
addChangeRecordForChangeCategory:category to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3694
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3695
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3696
    "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
  3697
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3698
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3699
    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
  3700
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3701
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3702
    "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
  3703
    Project notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3704
	Project addClassDefinitionChangeFor:self
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3705
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3706
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3707
    "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
  3708
    "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
  3709
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3710
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3711
addChangeRecordForClass:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3712
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3713
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3714
    "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
  3715
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3716
    aClass isLoaded ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3717
	aClass fileOutDefinitionOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3718
	aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3719
	Project notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3720
	    Project addClassDefinitionChangeFor:aClass 
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3721
	]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3722
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3723
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3724
    "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
  3725
    "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
  3726
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3727
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3728
addChangeRecordForClassComment:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3729
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3730
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3731
    "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
  3732
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3733
    aClass fileOutCommentOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3734
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3735
    "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
  3736
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3737
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3738
addChangeRecordForClassInstvars:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3739
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3740
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3741
    "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
  3742
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3743
    aClass fileOutClassInstVarDefinitionOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3744
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3745
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3746
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3747
addChangeRecordForClassRemove:oldName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3748
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3749
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3750
    "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
  3751
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3752
    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
  3753
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3754
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3755
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3756
addChangeRecordForClassRename:oldName to:newName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3757
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3758
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3759
    "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
  3760
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3761
    aStream nextPutAll:('Smalltalk renameClass:' , oldName, ' to:''' , newName , '''').
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3762
    aStream nextPutChunkSeparator.
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3763
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3764
    "Modified: 30.10.1996 / 20:27:02 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3765
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3766
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3767
addChangeRecordForMethod:aMethod to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3768
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3769
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3770
    "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
  3771
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3772
    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
  3773
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3774
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3775
addChangeRecordForMethodCategory:aMethod category:newCategory to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3776
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3777
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3778
    "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
  3779
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3780
    |selector|
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3781
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3782
    selector := aMethod selector.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3783
    selector notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3784
	aStream nextPutAll:'('.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3785
	self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3786
	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
  3787
	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
  3788
	aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3789
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3790
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3791
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3792
addChangeRecordForMethodPrivacy:aMethod to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3793
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3794
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3795
    "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
  3796
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3797
    |selector|
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3798
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3799
    selector := aMethod selector.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3800
    selector notNil ifTrue:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3801
	aStream nextPutAll:'('.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3802
	self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3803
	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
  3804
	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
  3805
	aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3806
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3807
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3808
    "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
  3809
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3810
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3811
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3812
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3813
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3814
    "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
  3815
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3816
    aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; 
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3817
            nextPutAll:(aClass primitiveDefinitionsString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3818
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3819
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3820
    "Modified: 9.11.1996 / 00:09:54 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3821
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3822
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3823
addChangeRecordForPrimitiveFunctions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3824
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3825
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3826
    "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
  3827
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3828
    aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; 
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3829
            nextPutAll:(aClass primitiveFunctionsString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3830
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3831
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3832
    "Modified: 9.11.1996 / 00:10:02 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3833
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3834
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3835
addChangeRecordForPrimitiveVariables:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3836
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3837
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3838
    "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
  3839
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3840
    aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; 
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3841
            nextPutAll:(aClass primitiveVariablesString storeString copyFrom:2).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3842
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3843
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3844
    "Modified: 9.11.1996 / 00:10:10 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3845
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3846
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3847
addChangeRecordForRemoveSelector:aSelector to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3848
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3849
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3850
    "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
  3851
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3852
    self printClassNameOn:aStream.
1509
fc4b99648f9f change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3853
    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
  3854
    aStream nextPutChunkSeparator.
1509
fc4b99648f9f change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3855
fc4b99648f9f change record for removeSelector must save storeString of selector;
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3856
    "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
  3857
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3858
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3859
addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3860
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3861
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3862
    "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
  3863
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3864
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3865
    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
  3866
    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
  3867
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3868
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3869
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3870
addInfoRecord:aMessage to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3871
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3872
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3873
    "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
  3874
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3875
    aStream nextPutAll:('''---- ' , aMessage , ' ',
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3876
			Date today printString , ' ' ,
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3877
			Time now printString ,
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3878
			' ----''').
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3879
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3880
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3881
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3882
writingChangeDo:aBlock
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3883
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3884
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3885
    "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
  3886
     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
  3887
     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
  3888
     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
  3889
     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
  3890
     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
  3891
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3892
    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
  3893
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3894
    "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
  3895
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3896
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3897
writingChangePerform:aSelector with:anArgument
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3898
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3899
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3900
    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
  3901
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3902
    "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
  3903
    "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
  3904
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3905
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3906
writingChangeWithTimeStamp:doStampIt do:aBlock
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3907
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3908
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3909
    "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
  3910
     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
  3911
     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
  3912
     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
  3913
     as soon as possible - thus, in case of a crash, no changes should
2195
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  3914
     be lost due to buffering.
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  3915
     Access to the change file is serialized via the accessLock;
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  3916
     this prevents the changefile to be corrupted when multiple users
d9762148ae8e commentary
Claus Gittinger <cg@exept.de>
parents: 2172
diff changeset
  3917
     accept in the browser in a multi-display (or timesliced) configuration"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3918
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3919
    ChangeFileAccessLock critical:[
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3920
        |aStream|
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3921
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3922
        FileOutNameSpaceQuerySignal answer:true
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3923
        do:[
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3924
            aStream := self changesStream.
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3925
            aStream notNil ifTrue:[
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3926
                [
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3927
                    FileStream writeErrorSignal handle:[:ex |
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3928
                        self warn:('could not update the changes-file\\' , ex errorString) withCRs.
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3929
                        ex return
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3930
                    ] do:[
2486
311a7ffb2793 no need to check for updatingChanges in #addChangeTimeStamp.
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  3931
                        doStampIt ifTrue:[
311a7ffb2793 no need to check for updatingChanges in #addChangeTimeStamp.
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  3932
                            self addChangeTimeStampTo:aStream
311a7ffb2793 no need to check for updatingChanges in #addChangeTimeStamp.
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  3933
                        ].
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3934
                        aBlock value:aStream.
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3935
                        aStream cr.
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3936
                    ].
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3937
                ] valueNowOrOnUnwindDo:[
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3938
                    aStream close
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3939
                ]
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  3940
            ]
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3941
        ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3942
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3943
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3944
    "Created: 18.11.1995 / 15:36:02 / cg"
2486
311a7ffb2793 no need to check for updatingChanges in #addChangeTimeStamp.
Claus Gittinger <cg@exept.de>
parents: 2484
diff changeset
  3945
    "Modified: 22.3.1997 / 17:12:40 / cg"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3946
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3947
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3948
writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3949
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3950
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3951
    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
  3952
	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
  3953
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3954
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3955
    "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
  3956
! !
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3957
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3958
!Class methodsFor:'private helpers'!
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3959
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3960
addAllCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3961
    "helper - add categories and all superclasses categories
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3962
     to the argument, aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3963
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3964
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3965
	superclass addAllCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3966
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3967
    self addCategoriesTo:aCollection
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3968
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3969
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3970
addCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3971
    "helper - add categories to the argument, aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3972
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3973
    self methodDictionary do:[:aMethod |
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3974
        |cat|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3975
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3976
        cat := aMethod category.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3977
        (aCollection includes:cat) ifFalse:[
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3978
            aCollection add:cat
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3979
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3980
    ]
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3981
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  3982
    "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
  3983
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3984
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3985
getPrimitiveSpecsAt:index
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3986
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3987
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3988
    "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
  3989
2172
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  3990
    |owner pos stream string|
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  3991
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  3992
    (owner := self owningClass) notNil ifTrue:[^ owner getPrimitiveSpecsAt:index].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3993
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3994
    primitiveSpec isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3995
    pos := primitiveSpec at:index.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3996
    pos isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3997
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3998
    "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
  3999
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4000
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4001
    pos isNumber ifTrue:[
2172
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4002
        classFilename notNil ifTrue:[
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4003
            stream := self sourceStream. 
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4004
            stream notNil ifTrue:[
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4005
                stream position:pos+1.
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4006
                string := stream nextChunk.
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4007
                stream close.
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4008
                ^ string
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4009
            ]
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4010
        ].
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4011
        ^ nil
544
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  4012
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4013
    ^ pos
2172
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4014
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  4015
    "Modified: 15.1.1997 / 15:29:30 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4016
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4017
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4018
setPrimitiveSpecsAt:index to:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4019
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4020
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4021
    "set a primitiveSpecification component to aString"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4022
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4023
    primitiveSpec isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4024
	primitiveSpec := Array new:3
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4025
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4026
    primitiveSpec at:index put:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4027
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4028
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4029
!Class methodsFor:'protocol printOut'!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4030
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4031
printOutCategoryProtocol:aCategory on:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4032
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4033
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4034
    |dict any|
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4035
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4036
    dict := self methodDictionary.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4037
    dict notNil ifTrue:[
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4038
        any := false.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4039
        dict do:[:aMethod |
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4040
            (aCategory = aMethod category) ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4041
                any := true
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4042
            ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4043
        ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4044
        any ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4045
            aPrintStream italic.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4046
            aPrintStream nextPutAll:aCategory.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4047
            aPrintStream normal.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4048
            aPrintStream cr; cr.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4049
            dict do:[:aMethod |
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4050
                (aCategory = aMethod category) ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4051
                    self printOutMethodProtocol:aMethod on:aPrintStream.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4052
                    aPrintStream cr; cr
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4053
                ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4054
            ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4055
            aPrintStream cr
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4056
        ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4057
    ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4058
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4059
    "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
  4060
    "Modified: 12.6.1996 / 11:48:46 / stefan"
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4061
!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4062
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4063
printOutMethodProtocol:aMethod on:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4064
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4065
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4066
    "given the source in aString, print the methods message specification
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4067
     and any method comments - without source; used to generate documentation
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4068
     pages"
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4069
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4070
    |text comment|
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4071
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4072
    text := aMethod source asStringCollection.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4073
    (text size < 1) ifTrue:[^self].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4074
    aPrintStream bold.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4075
    aPrintStream nextPutLine:(text at:1).
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4076
    (text size >= 2) ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4077
        (comment := aMethod comment) notNil ifTrue:[
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4078
            aPrintStream italic.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4079
            aPrintStream spaces:((text at:2) indexOfNonSeparatorStartingAt:1).
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4080
            aPrintStream nextPutLine:aMethod comment.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4081
        ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4082
    ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4083
    aPrintStream normal
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4084
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4085
    "
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4086
      Float printOutProtocolOn:Stdout 
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4087
    "
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4088
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4089
    "Created: 20.4.1996 / 18:20:31 / cg"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4090
    "Modified: 9.11.1996 / 00:13:54 / cg"
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4091
!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4092
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4093
printOutProtocolOn:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4094
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4095
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4096
    |collectionOfCategories|
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4097
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4098
    self printOutDefinitionOn:aPrintStream.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4099
    aPrintStream cr.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4100
    collectionOfCategories := self class categories.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4101
    collectionOfCategories notNil ifTrue:[
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4102
        aPrintStream nextPutLine:'class protocol'.
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4103
        aPrintStream cr.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4104
        collectionOfCategories do:[:aCategory |
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4105
            self class printOutCategoryProtocol:aCategory on:aPrintStream
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4106
        ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4107
    ].
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4108
    collectionOfCategories := self categories.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4109
    collectionOfCategories notNil ifTrue:[
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4110
        aPrintStream nextPutLine:'instance protocol'.
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4111
        aPrintStream cr.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4112
        collectionOfCategories do:[:aCategory |
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4113
            self printOutCategoryProtocol:aCategory on:aPrintStream
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4114
        ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4115
    ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4116
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  4117
    "Modified: 9.11.1996 / 00:14:26 / cg"
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4118
! !
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  4119
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4120
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4121
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4122
allCategories
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4123
    "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
  4124
     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
  4125
     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
  4126
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4127
    |coll|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4128
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4129
    coll := OrderedCollection new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4130
    self addAllCategoriesTo:coll.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4131
    ^ coll
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4132
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4133
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4134
     Point categories  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4135
     Point allCategories 
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4136
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4137
     Point class categories   
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4138
     Point class allCategories  
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4139
    "
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4140
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4141
    "Modified: 21.3.1996 / 16:28:57 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4142
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4143
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4144
categories
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4145
    "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
  4146
     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
  4147
     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
  4148
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  4149
    |newList cat|
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  4150
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  4151
    newList := OrderedCollection new.
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4152
    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
  4153
        cat := aMethod category.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4154
        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
  4155
    ].
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  4156
    ^ newList
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4157
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4158
    "
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4159
     Point categories    
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4160
     Point class categories  
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  4161
    "
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4162
1193
5784d6b2b918 moved some protocol from Class to upper levels
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
  4163
    "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
  4164
    "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
  4165
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4166
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4167
isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4168
    "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
  4169
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4170
     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
  4171
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4172
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4173
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4174
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4175
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4176
     Point isClass  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4177
     1 isClass      
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4178
     Behavior new isBehavior  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4179
     Behavior new isClass       
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4180
     Class new isBehavior    
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4181
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4182
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4183
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4184
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4185
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4186
    "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
  4187
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4188
     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
  4189
     Autoload. The interface here is for your convenience."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4190
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4191
    ^ 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
  4192
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  4193
    "Modified: 21.3.1996 / 16:27:09 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4194
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  4195
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4196
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4197
    "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
  4198
     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
  4199
     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
  4200
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4201
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4202
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4203
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4204
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4205
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4206
	(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4207
	cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  4208
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4209
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4210
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4211
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4212
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4213
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4214
    "
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  4215
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  4216
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4217
whichClassDefinesInstVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4218
    "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
  4219
     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
  4220
     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
  4221
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4222
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4223
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4224
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4225
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4226
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4227
	(cls instVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4228
	cls := cls superclass
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4229
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4230
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4231
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4232
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4233
     StandardSystemView whichClassDefinesInstVar:'label'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4234
     StandardSystemView whichClassDefinesInstVar:'paint'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4235
     StandardSystemView whichClassDefinesInstVar:'foo'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4236
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4237
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4238
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
  4239
!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
  4240
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4241
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
  4242
    "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
  4243
     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
  4244
     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
  4245
     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
  4246
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4247
    |owner info c|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4248
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4249
    (owner := self owningClass) notNil ifTrue:[^ owner binaryRevision].
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4250
    self isMeta ifTrue:[
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4251
        ^ self soleInstance binaryRevision
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4252
    ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4253
    revision notNil ifTrue:[
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4254
        c := revision first.
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4255
        c == $$ ifTrue:[
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4256
            info := Class revisionInfoFromString:revision.
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4257
            ^ info at:#revision ifAbsent:0.
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4258
        ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4259
        c isDigit ifFalse:[
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4260
            ^ 0
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4261
        ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4262
    ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4263
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
  4264
    ^ 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
  4265
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4266
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4267
     Object binaryRevision
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4268
     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
  4269
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4270
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4271
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4272
     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
  4273
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4274
     |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
  4275
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4276
     classes := Smalltalk allClasses 
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4277
                    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
  4278
     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
  4279
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4280
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4281
    "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
  4282
    "Modified: 15.10.1996 / 18:55:28 / cg"
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4283
    "Modified: 26.3.1997 / 00:24:51 / stefan"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4284
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4285
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4286
packageSourceCodeInfo
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4287
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4288
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
  4289
    "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
  4290
     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
  4291
     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
  4292
     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
  4293
     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
  4294
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4295
     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
  4296
     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
  4297
     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
  4298
     (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
  4299
     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
  4300
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4301
     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
  4302
     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
  4303
     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
  4304
     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
  4305
     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
  4306
     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
  4307
     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
  4308
     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
  4309
     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
  4310
     (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
  4311
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4312
     For example: 
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4313
        '....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4314
        '....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4315
        '....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4316
        '....(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
  4317
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4318
     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
  4319
     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
  4320
     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
  4321
     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
  4322
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4323
     Caveat:
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4324
        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
  4325
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4326
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4327
    |owner sourceInfo packageString idx1 idx2 
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4328
     moduleString directoryString libraryString components dirComponents mgr|
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4329
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4330
    (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4331
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
  4332
    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
  4333
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4334
    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
  4335
    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
  4336
    idx1 ~~ 0 ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4337
        idx2 := packageString indexOf:$) startingAt:idx1+1.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4338
        idx2 ~~ 0 ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4339
            sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4340
        ]
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4341
    ] ifFalse:[
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4342
        sourceInfo := packageString
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4343
    ].
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4344
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
  4345
    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
  4346
    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
  4347
    components size == 0 ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4348
        moduleString := 'stx'.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4349
        directoryString := libraryString := ''.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4350
        ^ nil
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4351
    ].
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4352
    components size == 1 ifTrue:[
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4353
        "/ a single name given - the module becomes 'stx' or
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4354
        "/ the very first directory component (if such a module exists).
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4355
        "/ If the component includes slashes, its the directory
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4356
        "/ otherwise the library
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4357
        "/ 
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4358
        dirComponents := Filename components:(components at:1).     
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4359
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4360
        (dirComponents size > 1
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4361
        and:[(mgr := self sourceCodeManager) notNil
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4362
        and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4363
            moduleString := dirComponents first.
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4364
            directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4365
        ] ifFalse:[
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4366
            moduleString := 'stx'.
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4367
            directoryString := libraryString := components at:1.
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4368
        ].
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4369
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4370
        (libraryString includes:$/) ifTrue:[
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4371
            libraryString := libraryString asFilename baseName
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4372
        ]
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
  4373
    ] ifFalse:[
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4374
        components size == 2 ifTrue:[
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4375
            "/ two components - assume its the module and the directory; 
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4376
            "/ the library is assumed to be named after the directory
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4377
            "/ except, if slashes are in the name; then the libraryname
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4378
            "/ is the last component.
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4379
            "/
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4380
            moduleString := components at:1.
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4381
            directoryString := libraryString := components at:2.
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4382
            (libraryString includes:$/) ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4383
                libraryString := libraryString asFilename baseName
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4384
            ]
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4385
        ] ifFalse:[
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4386
            "/ all components given
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4387
            moduleString := components at:1.
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4388
            directoryString := components at:2.
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4389
            libraryString := components at:3.
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4390
        ]
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
  4391
    ].
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4392
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
  4393
    libraryString isEmpty ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4394
        directoryString notEmpty ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4395
            libraryString := directoryString asFilename baseName
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4396
        ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4397
        libraryString isEmpty ifTrue:[
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4398
            "/ lets extract the library from the liblist file ...
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4399
            libraryString := Smalltalk libraryFileNameOfClass:self.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4400
            libraryString isNil ifTrue:[^ nil].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4401
        ]
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
  4402
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4403
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4404
    moduleString isEmpty ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4405
        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
  4406
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4407
    directoryString isEmpty ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4408
        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
  4409
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4410
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4411
    ^ IdentityDictionary
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4412
        with:(#module->moduleString)
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4413
        with:(#directory->directoryString)
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4414
        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
  4415
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4416
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4417
     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
  4418
     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
  4419
     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
  4420
     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
  4421
     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
  4422
     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
  4423
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4424
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4425
    "Created: 4.11.1995 / 20:36:53 / cg"
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4426
    "Modified: 17.3.1997 / 18:13: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
  4427
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4428
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4429
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
  4430
    "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
  4431
     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
  4432
     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
  4433
     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
  4434
     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
  4435
     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
  4436
     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
  4437
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4438
    |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
  4439
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4440
    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
  4441
    info notNil ifTrue:[
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4442
        ^ info at:#revision ifAbsent:nil
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4443
    ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4444
    ^ self binaryRevision
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4445
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4446
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4447
     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
  4448
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4449
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4450
    "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
  4451
    "Modified: 12.12.1995 / 20:30:20 / cg"
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4452
    "Modified: 26.3.1997 / 00:14:00 / stefan"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4453
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4454
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4455
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
  4456
    "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
  4457
     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
  4458
     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
  4459
        #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
  4460
        #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
  4461
                          (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
  4462
        #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
  4463
        #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
  4464
        #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
  4465
        #fileName       - the classes source file name
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4466
        #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
  4467
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4468
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4469
    |vsnString info mgr|
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4470
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4471
    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
  4472
    vsnString notNil ifTrue:[
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4473
        mgr := self sourceCodeManager.
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4474
        mgr notNil ifTrue:[
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4475
            info := mgr revisionInfoFromString:vsnString
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4476
        ] ifFalse:[
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4477
            info := Class revisionInfoFromString:vsnString.
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4478
        ].
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4479
        info notNil ifTrue:[
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4480
            info at:#binaryRevision put:self binaryRevision.
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4481
        ]
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
  4482
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4483
    ^ 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
  4484
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4485
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4486
     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
  4487
     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
  4488
     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
  4489
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4490
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4491
    "Created: 11.11.1995 / 14:27:20 / cg"
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4492
    "Modified: 29.1.1997 / 18:59:12 / cg"
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4493
    "Modified: 26.3.1997 / 00:13:17 / stefan"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4494
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4495
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4496
revisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4497
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4498
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
  4499
    "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
  4500
     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
  4501
     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
  4502
     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
  4503
     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
  4504
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4505
    |owner cls meta m src val|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4506
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4507
    (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
  4508
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4509
    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
  4510
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4511
    self isMeta ifTrue:[
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4512
        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
  4513
    ] ifFalse:[
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4514
        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
  4515
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4516
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4517
    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
  4518
    m isNil ifTrue:[
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4519
        m := cls compiledMethodAt:#version.
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4520
        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
  4521
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4522
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4523
    m isExecutable ifTrue:[
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4524
        "/
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4525
        "/ 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
  4526
        "/ thats the returned value
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4527
        "/
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4528
        val := cls version.
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4529
        val isString ifTrue:[^ val].
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4530
    ].
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
  4531
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4532
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4533
    "/ 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
  4534
    "/ 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
  4535
    "/ 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
  4536
    "/ 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
  4537
    "/ 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
  4538
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4539
    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
  4540
    src isNil ifTrue:[^ nil].
1811
8afb43250471 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
  4541
    ^ 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
  4542
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4543
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4544
     Smalltalk allClassesDo:[:cls |
1422
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
  4545
        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
  4546
     ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4547
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4548
     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
  4549
     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
  4550
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4551
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4552
    "Created: 29.10.1995 / 19:28:03 / cg"
1811
8afb43250471 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
  4553
    "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
  4554
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4555
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4556
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
  4557
    "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
  4558
     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
  4559
     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
  4560
     (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
  4561
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4562
    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
  4563
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4564
    "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
  4565
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4566
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4567
setPackageFromRevision
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4568
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4569
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4570
    "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
  4571
     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
  4572
     (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
  4573
      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
  4574
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4575
    |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
  4576
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4577
    self owningClass notNil ifTrue:[^ self].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4578
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4579
    mgr := self sourceCodeManager.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4580
    mgr notNil ifTrue:[
1430
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4581
        info := mgr sourceInfoOfClass:self
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4582
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4583
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4584
    info notNil ifTrue:[
1430
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4585
        mod := info at:#module ifAbsent:nil.    "/ stx, aeg, <your-organization>
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4586
        dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ...
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4587
        lib := info at:#library ifAbsent:dir.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4588
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4589
        p := ''.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4590
        mod notNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4591
            mod ~= 'stx' ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4592
                p := p , mod
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4593
            ]
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4594
        ].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4595
        dir notNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4596
            p notEmpty ifTrue:[p := p , ':'].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4597
            p := p , dir.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4598
        ].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4599
        lib notNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4600
            lib ~= dir ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4601
                p notEmpty ifTrue:[p := p , ':'].
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4602
                p := p , lib.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4603
            ]
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4604
        ].
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4605
        (p notEmpty and:[p ~= package]) ifTrue:[
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4606
"/            package notNil ifTrue:[
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4607
"/                (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR.
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4608
"/            ].
1430
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4609
            package := p.
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4610
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4611
            self methodDictionary do:[:aMethod |
1430
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4612
                aMethod package isNil ifTrue:[
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4613
                    aMethod package:p
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4614
                ]
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4615
            ]
40cb88cad467 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  4616
        ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4617
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4618
    ^ self
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4619
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4620
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4621
     MemoryMonitor autoload.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4622
     MemoryMonitor setPackageFromRevision
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4623
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4624
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4625
    "Modified: 12.6.1996 / 11:49:31 / stefan"
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4626
    "Modified: 7.1.1997 / 12:01:08 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4627
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4628
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
  4629
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
  4630
    "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
  4631
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4632
    |owner source cls|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4633
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4634
    (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
  4635
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4636
    self isMeta ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4637
        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
  4638
    ] ifFalse:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4639
        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
  4640
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4641
    classFilename notNil ifTrue:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4642
        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
  4643
    ] ifFalse:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4644
        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
  4645
    ].
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4646
    ^ cls sourceStreamFor:source
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4647
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4648
    "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
  4649
!
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4650
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4651
sourceStreamFor:source
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4652
    "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
  4653
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4654
    |owner fileName aStream mgr validated|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4655
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4656
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4657
    validated := false.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4658
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4659
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4660
    "/ if there is no SourceCodeManager, 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4661
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4662
    "/ 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
  4663
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4664
    ((mgr := self sourceCodeManager) isNil 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4665
    or:[TryLocalSourceFirst == true]) ifTrue:[
1712
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4666
        fileName := Smalltalk getSourceFileName:source.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4667
        fileName notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4668
            aStream := fileName asFilename readStream.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4669
        ]
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
  4670
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4671
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4672
    aStream isNil ifTrue:[
1712
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4673
        "/      
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4674
        "/ 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
  4675
        "/ (in the source-dir-path).
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4676
        "/      
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4677
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4678
        "/      
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4679
        "/ 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
  4680
        "/ 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
  4681
        "/ source file.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4682
        "/      
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4683
        ObjectFileLoader notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4684
            ObjectFileLoader loadedObjectHandlesDo:[:h |
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4685
                |f classes|
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4686
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4687
                aStream isNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4688
                    (classes := h classes) notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4689
                        (classes includes:self) ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4690
                            f := h pathName.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4691
                            f := f asFilename directory.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4692
                            f := f construct:source.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4693
                            f exists ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4694
                                aStream := f readStream.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4695
                            ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4696
                        ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4697
                    ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4698
                ]
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4699
            ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4700
        ].
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
  4701
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4702
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4703
    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
  4704
1712
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4705
        "/ mhmh - still no source file.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4706
        "/ 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
  4707
        "/ 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
  4708
        "/ 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
  4709
        "/ standard places
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4710
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4711
        mgr notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4712
            aStream := mgr getSourceStreamFor:self.
1935
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4713
            aStream notNil ifTrue:[
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4714
                (self validateSourceStream:aStream) ifFalse:[
2124
6238280f6120 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
  4715
                    ('Class [info]: repositories source for `' 
1935
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4716
                     , (self isMeta ifTrue:[self soleInstance name]
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4717
                                    ifFalse:[name])
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4718
                     , ''' is invalid.') infoPrintCR.
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4719
                    aStream close.
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4720
                    aStream := nil
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4721
                ] ifTrue:[
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4722
                    validated := true.
f08ee7907b40 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
  4723
                ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4724
            ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4725
1712
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4726
            aStream isNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4727
                fileName := Smalltalk getSourceFileName:source.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4728
                fileName notNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4729
                    aStream := fileName asFilename readStream.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4730
                ]
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4731
            ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4732
        ].
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4733
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4734
        "/
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4735
        "/ final chance: try current directory
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4736
        "/
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4737
        aStream isNil ifTrue:[
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4738
            aStream := source asFilename readStream.
c01007eb733e had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 1711
diff changeset
  4739
        ].
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
  4740
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4741
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4742
    (aStream notNil and:[validated not]) ifTrue:[
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4743
        (self validateSourceStream:aStream) ifFalse:[
2124
6238280f6120 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
  4744
            ('Class [warning]: source for ''' , self name , ''' is invalid. Take care.') errorPrintCR
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4745
        ].
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4746
    ].
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
  4747
    ^ 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
  4748
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4749
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4750
     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
  4751
     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
  4752
     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
  4753
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4754
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4755
    "Created: 10.11.1995 / 21:05:13 / cg"
2124
6238280f6120 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
  4756
    "Modified: 10.1.1997 / 15:36:26 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4757
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4758
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4759
updateVersionMethodFor:newRevisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4760
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4761
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
  4762
    "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
  4763
     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
  4764
986
c3a9f590146d removed unused locals
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
  4765
    |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
  4766
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4767
    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
  4768
    self isMeta ifFalse:[
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4769
        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
  4770
    ].
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4771
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
  4772
"/    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
  4773
"/    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
  4774
"/    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
  4775
"/    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
  4776
"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4777
"/    (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
  4778
"/    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
  4779
"/    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
  4780
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4781
    MethodRedefinitionSignal handle:[:ex |
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4782
        ex proceedWith:#keep 
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4783
    ] do:[
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4784
        Class withoutUpdatingChangesDo:[
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4785
            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
  4786
    ^ ''' , 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
  4787
'
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4788
                     forClass:cls 
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4789
                     inCategory:#documentation 
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4790
                     notifying:nil 
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4791
                     install:true 
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4792
                     skipIfSame:false 
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4793
                     silent:true. 
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4794
        ]
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
  4795
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4796
"/ ('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
  4797
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4798
    ^ 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
  4799
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4800
    "Created: 7.12.1995 / 20:42:22 / cg"
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4801
    "Modified: 7.11.1996 / 21:02:09 / cg"
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4802
!
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4803
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4804
validateSourceStream:aStream
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4805
    "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
  4806
     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
  4807
     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
  4808
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4809
    |cls meta cannotCheckReason versionMethod info
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4810
     versionFromCode versionFromSource oldPos pos src rev|
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4811
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4812
    self isMeta ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4813
        meta := self. cls := self soleInstance
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4814
    ] ifFalse:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4815
        cls := self. meta := self class
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4816
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4817
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4818
    cannotCheckReason := nil.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4819
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4820
    versionMethod := meta compiledMethodAt:#version.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4821
    (versionMethod isNil 
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4822
    or:[versionMethod isExecutable not]) ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4823
        versionMethod := cls compiledMethodAt:#version.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4824
        (versionMethod isNil
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4825
        or:[versionMethod isExecutable not]) ifTrue:[
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4826
            cannotCheckReason := 'no version method'.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4827
        ]
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4828
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4829
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4830
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4831
    "/ 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
  4832
    "/ thats the returned value
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4833
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4834
    versionFromCode := cls version.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4835
    versionFromCode isString ifFalse:[
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4836
        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
  4837
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4838
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4839
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4840
    "/ 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
  4841
    "/ 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
  4842
    "/ 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
  4843
    "/ 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
  4844
    "/ for the source ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4845
    "/
1942
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4846
    versionMethod notNil ifTrue:[
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4847
        pos := versionMethod sourcePosition.
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4848
        pos isInteger ifFalse:[
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4849
            "/ mhmh - either no version method,
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4850
            "/ or updated due to a checkin.
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4851
            "/ in any case, this should be a good source.
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4852
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4853
            ^ true.
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4854
            "/ cannotCheckReason := 'no source position for version-method'
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4855
        ]
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4856
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4857
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4858
    cannotCheckReason notNil ifTrue:[
2124
6238280f6120 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
  4859
        ('Class [warning]: ' , cannotCheckReason) errorPrintCR.
6238280f6120 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
  4860
        'Class [info]: cannot validate source; trusting source' infoPrintCR.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4861
        ^ true
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4862
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4863
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4864
    oldPos := aStream position.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4865
    aStream position:pos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4866
    src := aStream nextChunk.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4867
    aStream position:oldPos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4868
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4869
    (src isNil or:[src isEmpty]) ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4870
"/ 'empty source for version-method' printCR.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4871
        ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4872
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4873
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4874
    versionFromSource := Class revisionStringFromSource:src.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4875
    versionFromSource = versionFromCode ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4876
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  4877
    versionFromSource isNil ifTrue:[^ false].
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  4878
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4879
    "/ mhmh - check my binary version ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4880
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4881
    info := Class revisionInfoFromString:versionFromSource.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4882
    info notNil ifTrue:[
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4883
        rev := info at:#revision.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4884
        rev = self binaryRevision ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4885
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4886
    ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4887
2124
6238280f6120 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 2105
diff changeset
  4888
    "Modified: 10.1.1997 / 15:36:51 / 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
  4889
! !
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4890
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4891
!Class class methodsFor:'documentation'!
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4892
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4893
version
2516
b99fff48c6c6 flush cached environment, when name changes
ca
parents: 2500
diff changeset
  4894
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.272 1997-04-01 16:05:27 ca Exp $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  4895
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  4896
Class initialize!