Class.st
author Claus Gittinger <cg@exept.de>
Wed, 22 Oct 2008 00:20:59 +0200
changeset 11261 e8dcdce0b2ae
parent 11162 ec3593f9c86a
child 11277 8a3339bf1d7f
permissions -rw-r--r--
changed #classMenuCompareTwoRepositoryVersions
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
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
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
"
5340
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
    12
"{ Package: 'stx:libbasic' }"
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
    13
719
c557a530f971 dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
    14
ClassDescription subclass:#Class
8756
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    15
	instanceVariableNames:'name category classvars comment subclasses classFilename package
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    16
		revision environment signature attributes'
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    17
	classVariableNames:'DefaultCategoryForSTV DefaultCategoryForVAGE
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    18
		DefaultCategoryForDolphin'
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    19
	poolDictionaries:''
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    20
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    21
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    23
Object subclass:#ClassAttributes
8756
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    24
	instanceVariableNames:'primitiveDefinitions primitiveVariables primitiveFunctions
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    25
		sharedPools'
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    26
	classVariableNames:''
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    27
	poolDictionaries:''
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    28
	privateIn:Class
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    29
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    30
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    31
Object subclass:#SimulatedClassPool
8756
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    32
	instanceVariableNames:'class'
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    33
	classVariableNames:''
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    34
	poolDictionaries:''
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    35
	privateIn:Class
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    36
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    37
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    38
Association subclass:#SimulatedVariableBinding
8756
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    39
	instanceVariableNames:''
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    40
	classVariableNames:''
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    41
	poolDictionaries:''
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
    42
	privateIn:Class::SimulatedClassPool
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    43
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    44
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    45
!Class class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    46
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    47
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    48
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    49
 COPYRIGHT (c) 1989 by Claus Gittinger
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    50
               All Rights Reserved
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    51
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    52
 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
    53
 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
    54
 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
    55
 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
    56
 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
    57
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    58
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    59
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    60
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    61
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    62
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    63
    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
    64
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    65
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    66
    [Instance variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    67
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    68
        name            <Symbol>        the classes name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    69
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    70
        category        <Symbol>        the classes category
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    71
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    72
        classvars       <String>        the names of the class variables
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    73
                        | <Collection of words>
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    74
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    75
        comment         <String>        the classes comment; either a string,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    76
                                        a number specifying the offset in classFilename, or nil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    77
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    78
        subclasses      <Collection>    cached collection of subclasses
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    79
                                        (currently unused - but will be soon)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    80
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    81
        classFilename   <String>        the file (or nil) where the classes
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    82
                                        sources are found
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    83
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    84
        package         <Symbol>        the package, in which the class was defined
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    85
                                        (inserted by compilers)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    86
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    87
        revision        <String>        revision string - inserted by stc
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    88
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    89
        environment     <Symbol | nil>  cached environment (i.e. Smalltalk or a namespace)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    90
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    91
        signature       <SmallInteger>  the classes signature (used to detect obsolete
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    92
                                        or changed classes with binaryStorage)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    93
                                        This is filled in lazy - i.e. upon the first signature query.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    94
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    95
        attributes   <Array | nil>      describes primitiveIncludes, primitiveFunctions etc.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    96
                                        also a place to add additional attributes,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    97
                                        without a need to recompile all classes.
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    98
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    99
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   100
    WARNING: layout known by compiler and runtime system
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   101
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
   102
    [author:]
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   103
        Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   104
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   105
    [see also:]
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   106
        Behavior ClassDescription Metaclass
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   107
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   108
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   109
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
   110
!Class class methodsFor:'accessing-flags'!
362
claus
parents: 360
diff changeset
   111
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   112
tryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   113
    ^ TryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   114
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   115
    "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
   116
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   117
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   118
tryLocalSourceFirst:aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   119
    TryLocalSourceFirst := aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   120
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   121
    "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
   122
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   123
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   124
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   125
    "turn on/off changes management. Return the prior value of the flag.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   126
     This value is used as a default fallback - a querySignal handler may still
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   127
     decide to return something else."
362
claus
parents: 360
diff changeset
   128
claus
parents: 360
diff changeset
   129
    |prev|
claus
parents: 360
diff changeset
   130
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   131
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   132
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   133
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   134
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   135
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   136
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   137
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   138
     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
   139
     decide to return something else."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   140
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   141
    ^ UpdatingChanges
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   142
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   143
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   144
!Class class methodsFor:'creating new classes'!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   145
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   146
name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   147
         subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   148
         instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   149
         category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   150
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   151
    "this new instance creation protocol will replace the traditional inst-creation messages"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   152
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   153
    ^ self
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   154
        name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   155
        subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   156
        instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   157
        classVariableNames:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   158
        poolDictionaries:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   159
        category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   160
!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   161
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   162
name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   163
         subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   164
         instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   165
         classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   166
         category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   167
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   168
    "this new instance creation protocol will replace the traditional inst-creation messages"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   169
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   170
    ^ self
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   171
        name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   172
        subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   173
        instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   174
        classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   175
        poolDictionaries:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   176
        category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   177
!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   178
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   179
name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   180
         subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   181
         instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   182
         classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   183
         classInstanceVariableNames:stringOfClassInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   184
         poolDictionaries:stringOfPoolNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   185
         category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   186
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   187
    "this new instance creation protocol will replace the traditional inst-creation messages"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   188
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   189
    ^ self class
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   190
        name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   191
        inEnvironment:Smalltalk
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   192
        subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   193
        instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   194
        variable:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   195
        words:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   196
        pointers:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   197
        classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   198
        poolDictionaries:stringOfPoolNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   199
        category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   200
        comment:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   201
        changed:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   202
        classInstanceVariableNames:stringOfClassInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   203
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   204
    "Modified: 16.6.1997 / 11:53:58 / cg"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   205
!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   206
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   207
name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   208
         subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   209
         instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   210
         classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   211
         poolDictionaries:stringOfPoolNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   212
         category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   213
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   214
    "this new instance creation protocol will replace the traditional inst-creation messages"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   215
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   216
    ^ self class
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   217
        name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   218
        inEnvironment:Smalltalk
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   219
        subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   220
        instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   221
        variable:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   222
        words:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   223
        pointers:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   224
        classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   225
        poolDictionaries:stringOfPoolNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   226
        category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   227
        comment:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   228
        changed:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   229
        classInstanceVariableNames:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   230
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   231
    "Modified: 16.6.1997 / 11:53:58 / cg"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   232
! !
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   233
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   234
!Class class methodsFor:'helpers'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   235
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   236
revisionInfoFromString:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   237
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   238
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   239
    "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
   240
     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
   241
     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
   242
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   243
    |mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   244
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   245
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   246
    "/ 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
   247
    "/
7755
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   248
    (mgr := SourceCodeManager) isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   249
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   250
        "/ fallBack - assume CVS header
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   251
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   252
        mgr := CVSSourceCodeManager
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   253
    ].
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   254
    "/
7755
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   255
    "/ care for standAlone apps which have no CVS (libbasic3) included
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   256
    "/
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   257
    mgr isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   258
        AbstractSourceCodeManager notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   259
            ^ AbstractSourceCodeManager revisionInfoFromRCSString:aString
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   260
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   261
        ^ nil
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   262
    ].
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   263
    ^ mgr revisionInfoFromString:aString.
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   264
!
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   265
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   266
revisionStringFromSource:aMethodSourceString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   267
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   268
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   269
    "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
   270
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   271
    |lines line|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   272
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   273
    lines := aMethodSourceString asCollectionOfLines.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   274
    lines do:[:l |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   275
        |i|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   276
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   277
        i := l indexOfSubCollection:'$Header: '.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   278
        i ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   279
            line := l copyFrom:i.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   280
            i := line lastIndexOf:$$.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   281
            i > 1 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   282
                line := line copyTo:i.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   283
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   284
            ^ line
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   285
        ]
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   286
    ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   287
    ^ nil
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   288
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   289
    "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
   290
    "Modified: 16.10.1996 / 16:54:40 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   291
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   292
3618
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   293
!Class class methodsFor:'misc'!
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   294
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   295
template:aCategoryString
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   296
    "return a class-definition template"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   297
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   298
    ^ 'NameOfSuperclass subclass:#NameOfClass
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   299
    instanceVariableNames:''instVarName1 instVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   300
    classVariableNames:''classVarName1 classVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   301
    poolDictionaries:''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   302
    category:''' , aCategoryString , ''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   303
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   304
    "Created: / 19.6.1998 / 02:09:06 / cg"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   305
! !
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   306
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   307
!Class class methodsFor:'private'!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   308
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   309
flushSubclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   310
    "throw away (forget) the cached subclass information, as created
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   311
     by #subclassInfo.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   312
     This is private protocol"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   313
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   314
    SubclassInfo := nil.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   315
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   316
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   317
     Class flushSubclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   318
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   319
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   320
    "Modified: 22.1.1997 / 18:39:36 / cg"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   321
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   322
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   323
subclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   324
    "build & return a dictionary, containing the set of subclass
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   325
     for each class. This information is kept until explicitely flushed
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   326
     by #flushSubclassInfo.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   327
     This cache is used internally, for enumerators like #allSubclasses
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   328
     or #allSubclassesDo:, to avoid repeated recursive walks over the class
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   329
     hierarchy.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   330
     This is private protocol."
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   331
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   332
    |d|
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   333
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   334
    SubclassInfo notNil ifTrue:[^ SubclassInfo].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   335
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   336
    d := IdentityDictionary new.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   337
    Smalltalk allClassesDo:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   338
        |superCls setToAddSubclass|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   339
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   340
        superCls := aClass superclass.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   341
        superCls notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   342
            setToAddSubclass := d at:superCls ifAbsent:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   343
            setToAddSubclass isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   344
                d at:superCls put:(Set with:aClass).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   345
            ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   346
                setToAddSubclass add:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   347
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   348
        ]
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   349
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   350
    SubclassInfo := d.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   351
    ^ d
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   352
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   353
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   354
     Class subclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   355
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   356
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   357
    "Modified: 22.1.1997 / 18:44:59 / cg"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   358
! !
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   359
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   360
!Class class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   361
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   362
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   363
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   364
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   365
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   366
    ^ self == Class class or:[self == Class]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   367
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   368
    "Created: 15.4.1996 / 17:17:13 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   369
    "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
   370
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   371
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   372
!Class methodsFor:'Compatibility-Dolphin'!
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   373
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   374
defaultCategoryForDolphinClasses
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   375
    ^ DefaultCategoryForDolphin ? 'Dolphin classes'.
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   376
!
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   377
11162
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   378
stb_version
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   379
    ^ 0
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   380
!
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   381
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   382
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   383
    "{ Pragma: +optSpace }"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   384
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   385
    "this method allows fileIn of Dolphin classes "
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   386
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   387
    ^ self subclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   388
           instanceVariableNames:f
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   389
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   390
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   391
           category:(self defaultCategoryForDolphinClasses)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   392
           classInstanceVariableNames:classInstanceVariableNames
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   393
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   394
    "Modified: / 15.6.1998 / 21:31:34 / cg"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   395
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   396
!
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   397
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   398
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   399
    "{ Pragma: +optSpace }"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   400
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   401
    "this method allows fileIn of Dolphin classes "
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   402
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   403
    ^ self variableSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   404
           instanceVariableNames:f
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   405
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   406
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   407
           category:(self defaultCategoryForDolphinClasses)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   408
           classInstanceVariableNames:classInstanceVariableNames
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   409
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   410
    "Modified: / 15.6.1998 / 21:31:34 / cg"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   411
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   412
! !
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   413
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   414
!Class methodsFor:'Compatibility-ST/V and V''Age'!
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   415
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   416
defaultCategoryForSTVorVAGEClasses
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   417
    |cat app|
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   418
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   419
    DefaultApplicationQuerySignal isHandled ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   420
        app := DefaultApplicationQuerySignal query.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   421
        app notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   422
            cat := 'Applications-' , app name.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   423
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   424
            cat := DefaultCategoryForVAGE ? 'V''Age classes'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   425
        ].
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   426
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   427
        cat := DefaultCategoryForSTV ? 'ST/V classes'.
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   428
    ].
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   429
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   430
    ^ cat
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   431
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   432
9178
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   433
subclass:nm classInstanceVariableNames:cIV instanceVariableNames:iV classVariableNames:cV poolDictionaries:p
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   434
    "{ Pragma: +optSpace }"
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   435
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   436
    "this method allows fileIn of V'Age classes"
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   437
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   438
    ^ self 
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   439
           subclass:nm
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   440
           instanceVariableNames:iV
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   441
           classVariableNames:cV
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   442
           poolDictionaries:p
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   443
           category:(self defaultCategoryForSTVorVAGEClasses)
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   444
           classInstanceVariableNames:cIV
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   445
!
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   446
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   447
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   448
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   449
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   450
    "this method allows fileIn of ST/V and V'Age classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   451
     (which seem to have no category)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   452
9178
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   453
    ^ self 
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   454
           subclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   455
           instanceVariableNames:f
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   456
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   457
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   458
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   459
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   460
    "Modified: / 15.6.1998 / 21:31:34 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   461
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   462
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   463
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   464
variableByteSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   465
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   466
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   467
    "this method allows fileIn of ST/V and V'Age variable byte classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   468
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   469
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   470
    ^ self variableByteSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   471
           instanceVariableNames:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   472
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   473
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   474
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   475
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   476
    "Modified: / 15.6.1998 / 21:31:38 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   477
    "Modified: / 18.3.1999 / 18:16:21 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   478
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   479
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   480
variableLongSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   481
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   482
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   483
    "this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   484
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   485
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   486
    ^ self variableLongSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   487
           instanceVariableNames:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   488
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   489
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   490
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   491
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   492
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   493
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   494
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   495
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   496
    "this method allows fileIn of ST/V and V'Age variable pointer classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   497
     (which seem to have no category)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   498
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   499
    ^ self variableSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   500
           instanceVariableNames:f
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   501
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   502
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   503
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   504
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   505
    "Modified: / 15.6.1998 / 21:31:41 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   506
    "Modified: / 18.3.1999 / 18:16:33 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   507
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   508
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   509
variableWordSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   510
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   511
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   512
    "this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   513
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   514
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   515
    ^ self variableWordSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   516
           instanceVariableNames:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   517
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   518
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   519
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   520
! !
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   521
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   522
!Class methodsFor:'Compatibility-ST80'!
5190
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   523
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   524
fileOutSourceOn:aStream
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   525
    self fileOutOn:aStream withTimeStamp:false
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   526
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   527
    "Created: 20.6.1997 / 17:18:14 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   528
    "Modified: 20.6.1997 / 17:18:26 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   529
!
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   530
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   531
rename:newName
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   532
    "same as renameTo: - for ST80 compatibility"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   533
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   534
    ^ Smalltalk renameClass:self to:newName.
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   535
"/    ^ self renameTo:newName
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   536
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   537
    "Created: / 18.6.1998 / 22:08:45 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   538
! !
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   539
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   540
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   541
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   542
addChangeRecordForClass:aClass andNotifyChangeOf:aspect
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   543
    "writes a change record and notifies dependents."
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   544
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   545
    |namespace|
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   546
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   547
    self addChangeRecordForClass:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   548
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   549
    aClass changed:#definition.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   550
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   551
    namespace := aClass nameSpace.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   552
    namespace changed:#classDefinition with:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   553
    namespace ~~ Smalltalk ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   554
        Smalltalk changed:#classDefinition with:aClass.
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   555
    ].
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   556
    namespace changed:aspect with:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   557
    namespace ~~ Smalltalk ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   558
        Smalltalk changed:aspect with:aClass.
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   559
    ].
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   560
!
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   561
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   562
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   563
    "add a class variable if not already there and initialize it with nil.
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
   564
     Also writes a change record and notifies dependents."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   565
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   566
    (self classVarNames includes:aString) ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   567
        self classVariableString:(self classVariableString , ' ' , aString).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   568
        Class withoutUpdatingChangesDo:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   569
            self withAllSubclasses do:[:cls|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   570
                cls recompileMethodsAccessingAnyClassvarOrGlobal:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   571
                                        (Array with:aString asSymbol)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   572
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   573
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   574
        self addChangeRecordForClass:self andNotifyChangeOf:#classVariables.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   575
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   576
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
   577
    "Created: / 29.10.1995 / 19:40:51 / cg"
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
   578
    "Modified: / 23.1.1998 / 15:46:23 / stefan"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   579
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   580
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   581
allPrivateClasses
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   582
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   583
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   584
    "return a collection of all private classes and private-private classes.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   585
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   586
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   587
    ^ self privateClassesOrAll:true
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   588
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   589
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   590
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   591
category
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   592
    "return the category of the class.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   593
     The returned value may be a string or symbol."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   594
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   595
    |owner|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   596
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   597
    (owner := self owningClass) notNil ifTrue:[^ owner category].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   598
    ^ category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   599
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   600
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   601
     Point category
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   602
     Dictionary category
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   603
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   604
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   605
    "Modified: 15.10.1996 / 21:20:01 / cg"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   606
    "Created: 1.4.1997 / 15:23:47 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   607
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   608
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   609
category:aStringOrSymbol
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   610
    "set the category of the class to be the argument, aStringOrSymbol"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   611
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   612
    |ns|
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   613
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
   614
    self setCategory:aStringOrSymbol.
10195
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   615
    self addChangeRecordForClass:self.
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   616
    ns := self nameSpace.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   617
    ns changed:#organization.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   618
    ns ~~ Smalltalk ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   619
        Smalltalk changed:#organization.
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   620
    ]
10195
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   621
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   622
    "Modified: / 23-11-2006 / 16:54:20 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   623
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   624
10078
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   625
classBaseFilename
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   626
    "return the baseName of the file from which the class was compiled.
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   627
     In contrast to classFilename, this will always be a plain basename."
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   628
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   629
    ^ self classFilename asFilename baseName
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   630
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   631
    "
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   632
     Math::ClosedInterval classFilename
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   633
    "
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   634
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   635
    "Created: / 12-10-2006 / 15:49:32 / cg"
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   636
!
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   637
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   638
classFilename
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   639
    "return the name of the file from which the class was compiled.
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   640
     If the class was loaded via an explicit load (i.e. from the fileBrowser),
10078
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   641
     this will be an absolute path. Oherwise, it will be a basename only.
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   642
     See classBaseFilename for a method which always returns the basename."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   643
10033
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   644
    |owner info|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   645
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   646
    (owner := self owningClass) notNil ifTrue:[^ owner classFilename].
10033
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   647
    classFilename notNil ifTrue:[ ^ classFilename ].
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   648
10033
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   649
    (info := self revisionInfo) notNil ifTrue:[
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   650
        (info includesKey:#fileName) ifTrue:[
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   651
            ^ info at:#fileName
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   652
        ].
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   653
    ].
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
   654
    ^ (Smalltalk fileNameForClass:self), '.st'
10033
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   655
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   656
    "
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   657
     Math::ClosedInterval classFilename
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   658
    "
220aa1d843b5 classFilename fixed.
Claus Gittinger <cg@exept.de>
parents: 10009
diff changeset
   659
10078
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   660
    "Modified: / 12-10-2006 / 15:49:53 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   661
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   662
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   663
classPool
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   664
    "return something which allows access to my classVariables via
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   665
     #at: and #at:put: messages."
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   666
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   667
    ^ SimulatedClassPool new setClass:self
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   668
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   669
    "
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   670
     Button classPool
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   671
    "
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   672
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   673
    "Modified: 17.10.1997 / 12:12:14 / cg"
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   674
!
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   675
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   676
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   677
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   678
     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
   679
     this may change."
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
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   682
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   683
     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
   684
     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
   685
     no classPools yet.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   686
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   687
    ^ Smalltalk at:(self globalKeyForClassVar:aSymbol)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   688
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   689
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   690
classVarAt:aSymbol ifAbsent:exceptionBlock
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   691
    "return the value of a class variable.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   692
     Currently, this returns nil if there is no such classvar -
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   693
     this may change."
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   694
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   695
    "
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   696
     this hides the (current) implementation of classVariables
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   697
     from the outside world. Currently, classvars are stored in
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   698
     the Smalltalk dictionary with a funny name, since there are
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   699
     no classPools yet.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   700
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   701
    ^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   702
!
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   703
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   704
classVarAt:aSymbol put:something
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   705
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   706
     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
   707
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   708
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   709
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   710
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   711
     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
   712
     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
   713
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   714
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   715
    Smalltalk at:(self globalKeyForClassVar:aSymbol) put:something.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   716
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   717
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   718
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   719
    "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
   720
     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
   721
     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
   722
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   723
    classvars isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   724
        ^ #()
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   725
    ].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   726
    classvars isString ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   727
        classvars := classvars asCollectionOfWords asArray collect:[:varName| varName asSymbol].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   728
        ^ classvars
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   729
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   730
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   731
    ^ classvars
557
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
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   734
     Object classVarNames
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   735
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   736
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   737
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   738
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   739
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   740
    "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
   741
     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
   742
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   743
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   744
    classvars isNil ifTrue:[^ ''].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   745
    classvars isString ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   746
        ^ classvars
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   747
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   748
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   749
    ^ classvars asStringWith:(Character space)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   750
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   751
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   752
     Object classVariableString
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   753
     Float classVariableString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   754
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   755
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   756
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   757
classVariableString:aString
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   758
    "set the classes classvarnames string;
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   759
     Initialize new class variables with nil, clear and remove old ones.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   760
     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
   761
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   762
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   763
7517
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   764
    (aString ~= self classVariableString) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   765
        prevVarNames := self classVarNames asOrderedCollection.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   766
        classvars := aString.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   767
        varNames := self classVarNames.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   768
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   769
        "new ones get initialized to nil;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   770
         - old ones are nilled and removed from Smalltalk"
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   771
        any := false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   772
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   773
        varNames do:[:aName |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   774
            (prevVarNames includes:aName) ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   775
                "a new one"
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   776
                self classVarAt:aName put:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   777
                any := true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   778
            ] ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   779
                prevVarNames remove:aName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   780
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   781
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   782
        "left overs are gone"
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   783
        prevVarNames do:[:aName |
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   784
            any := true.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   785
            self classVarAt:aName put:nil.
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   786
            Smalltalk removeKey:(self globalKeyForClassVar:aName).
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   787
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   788
        any ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   789
            Smalltalk changed:#classVariables with:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   790
        ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   791
    ]
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   792
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   793
    "Modified: / 02-04-1997 / 00:16:05 / stefan"
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   794
    "Modified: / 18-11-2006 / 17:13:14 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   795
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   796
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   797
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   798
    "return the comment (aString) of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   799
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   800
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   801
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   802
    "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
   803
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   804
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   805
    comment isNumber ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   806
        classFilename notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   807
            stream := self sourceStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   808
            stream notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   809
                stream position1Based:comment.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   810
                string := String readFrom:stream onError:''.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   811
                stream close.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   812
                ^ string
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   813
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   814
            ^ nil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   815
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   816
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   817
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   818
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   819
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   820
     Object comment
7054
685d359f9847 code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   821
     RunArray comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   822
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   823
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   824
7128
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   825
comment:aStringOrNil
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   826
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   827
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   828
    "set the 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
   829
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   830
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   831
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   832
7128
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   833
    newComment := aStringOrNil.
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   834
    (aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   835
        newComment := nil
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   836
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   837
    comment ~= newComment ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   838
        oldComment := self comment.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   839
        comment := newComment.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   840
        self addChangeRecordForClassComment:self.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   841
        self changed:#comment with:oldComment.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   842
        Smalltalk changed:#classComment with:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   843
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   844
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   845
2444
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   846
environment
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   847
    "return the namespace I am contained in; ST-80 compatible name"
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   848
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   849
    ^ self nameSpace
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   850
!
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   851
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   852
getClassFilename
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   853
    "return the name of the file from which the class was compiled.
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   854
     If the class was loaded via an explicit load (i.e. from the fileBrowser),
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   855
     this will be an absolute path. Oherwise, it will be a basename only."
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   856
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   857
    |owner|
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   858
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   859
    (owner := self owningClass) notNil ifTrue:[^ owner getClassFilename].
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   860
    ^ classFilename
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   861
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
   862
    "Modified: / 06-10-2006 / 13:32:01 / cg"
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   863
!
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   864
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   865
getPackage
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   866
    "get the package or nil."
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   867
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   868
    ^ package
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   869
!
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   870
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   871
globalKeyForClassVar:aStringOrSymbol
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   872
    "this helps to encapsulate the (current) implementation of classVariables
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   873
     from the outside world. Currently, classvars are stored in
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   874
     the Smalltalk dictionary with a funny name, since there are
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   875
     no classPools yet.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   876
    "
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   877
    ^ (self theNonMetaclass name , ':' , aStringOrSymbol) asSymbol
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   878
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   879
    "Modified: / 18-11-2006 / 17:13:39 / cg"
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   880
!
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   881
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   882
name
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   883
    "return the name of the class.
6657
a0fa5a821176 comment
Claus Gittinger <cg@exept.de>
parents: 6520
diff changeset
   884
     This returns a symbol (but notice, that other smalltalks might return a string)."
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   885
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   886
    ^ name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   887
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   888
    "Created: 1.4.1997 / 15:24:32 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   889
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   890
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   891
nameSpace
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   892
    "return the namespace I am contained in;
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   893
     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
   894
     for public classes, Smalltalk is returned."
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   895
7321
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
   896
    |idx nsName e|
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
   897
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
   898
    "/ cached in environment
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
   899
    environment isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   900
        e := Smalltalk. "/ default
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   901
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   902
        name notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   903
            "/ due to the implementation, extract this from my name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   904
            "/ (physically, all classes are found in Smalltalk)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   905
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   906
            idx := name lastIndexOf:$:.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   907
            idx ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   908
                (name at:idx-1) == $: ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   909
                    nsName := name copyTo:(idx - 2).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   910
                    e := Smalltalk at:nsName asSymbol.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   911
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   912
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   913
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   914
        environment := e.
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   915
    ].
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   916
    ^ environment
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   917
3661
161322291871 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
   918
    "Modified: / 20.7.1998 / 14:21:36 / cg"
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   919
!
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   920
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   921
package
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   922
    "return the package-ID of the class"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   923
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   924
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   925
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   926
    (owner := self owningClass) notNil ifTrue:[^ owner package].
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   927
    package isNil ifTrue:[^ Project noProjectID].
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   928
    ^ package
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   929
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   930
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   931
     Object package
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   932
    "
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   933
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
   934
    "Modified: / 29.12.1998 / 01:15:50 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   935
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   936
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
   937
package:aSymbol
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   938
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   939
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   940
    |newPackage oldPackage|
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   941
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   942
    aSymbol == Project noProjectID ifTrue:[
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   943
        newPackage := nil
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
   944
    ] ifFalse:[
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   945
        newPackage := aSymbol
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   946
    ].
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   947
    package ~= newPackage ifTrue:[
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   948
        oldPackage := package.
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   949
        package := newPackage.
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   950
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   951
        self changed:#package.
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   952
        Smalltalk changed:#projectOrganization with:(Array with:self with:oldPackage).
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
   953
    ].
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
   954
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
   955
    "Modified: / 09-08-2006 / 17:58:53 / fm"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   956
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   957
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   958
packageInfo
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   959
    "return the package-info of the class - or nil.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   960
     The packageManager contains information relevant to the package,
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   961
     to which this class belongs - especially, things like pathes to
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   962
     resources, additional files etc. can be optioned this way.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   963
     A packageInfo loosely relates to ehat a classLoader is in Java.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   964
     Experimental."
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   965
4742
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   966
    |packageId prj handle t|
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   967
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   968
    packageId := self package.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   969
    packageId notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   970
        prj := Project projectWithId:packageId.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   971
        prj notNil ifTrue:[^ prj].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   972
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   973
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   974
        "/ intermediate kludge (will be removed)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   975
        "/ search for a loaded class library and extract
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   976
        "/ information from it ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   977
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   978
        handle := ObjectFileLoader loadedObjectHandles
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   979
                    detect:[:h | |cls|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   980
                        cls := h classes firstIfEmpty:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   981
                        cls notNil and:[cls package = packageId]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   982
                    ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   983
                    ifNone:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   984
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   985
        handle notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   986
            prj := Project new.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   987
            prj name:packageId.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   988
            prj directory:(handle pathName asFilename directory pathName).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   989
            prj package:packageId.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   990
            t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   991
            prj repositoryModule:(t first).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   992
            prj repositoryDirectory:(packageId copyFrom:t first size + 2).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   993
            prj isLoaded:true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   994
            ^ prj
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   995
        ]
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   996
    ].
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   997
    ^ nil
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   998
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   999
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1000
     Object packageInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1001
     OSI::FTAMOperation packageInfo
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
  1002
    "
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
  1003
!
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
  1004
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1005
primitiveDefinitions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1006
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1007
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1008
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1009
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1010
    (self isPrivate) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1011
        self error:'private classes cannot have their own primitiveDefinitions'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1012
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1013
    self setPrimitiveDefinitions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1014
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1015
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1016
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1017
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1018
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1019
primitiveDefinitionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1020
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1021
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1022
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1023
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1024
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1025
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1026
    (owner := self owningClass) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1027
        ^ owner primitiveDefinitionsString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1028
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1029
    ^ self getSourceChunkAttribute:#primitiveDefinitions
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1030
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1031
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1032
     Object primitiveDefinitionsString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1033
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1034
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1035
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1036
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1037
primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1038
    "return the primitiveDefinition string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1039
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1040
    ^ self primitiveDefinitionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1041
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1042
/*
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1043
 * includes, defines, structure definitions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1044
 * and typedefs come here.
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1045
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1046
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1047
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1048
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1049
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1050
     Object primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1051
     String primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1052
     ExternalStream primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1053
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1054
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1055
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1056
primitiveFunctions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1057
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1058
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1059
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1060
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1061
    (self isPrivate) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1062
        self error:'private classes cannot have their own primitiveFunctions'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1063
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1064
    self setPrimitiveFunctions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1065
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1066
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1067
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1068
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1069
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1070
primitiveFunctionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1071
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1072
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1073
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1074
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1075
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1076
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1077
    (owner := self owningClass) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1078
        ^ owner primitiveFunctionsString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1079
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1080
    ^ self getSourceChunkAttribute:#primitiveFunctions
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1081
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1082
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1083
primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1084
    "return the primitiveFunction string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1085
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1086
    ^ self primitiveFunctionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1087
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1088
/*
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1089
 * any local C (helper) functions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1090
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1091
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1092
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1093
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1094
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1095
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1096
     Object primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1097
     String primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1098
     ExternalStream primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1099
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1100
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1101
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1102
primitiveVariables:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1103
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1104
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1105
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1106
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1107
    (self isPrivate) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1108
        self error:'private classes cannot have their own primitiveVariables'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1109
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1110
    self setPrimitiveVariables:aString.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1111
    self addChangeRecordForPrimitiveVariables:self.
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
    "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
  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
primitiveVariablesString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1117
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1118
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1119
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1120
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1121
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1122
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1123
    (owner := self owningClass) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1124
        ^ owner primitiveVariablesString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1125
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1126
    ^ self getSourceChunkAttribute:#primitiveVariables
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1127
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1128
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1129
primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1130
    "return the primitiveVariable string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1131
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1132
    ^ self primitiveVariablesString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1133
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1134
/*
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1135
 * any local C variables
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1136
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1137
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1138
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1139
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1140
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1141
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1142
     Object primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1143
     String primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1144
     ExternalStream primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1145
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1146
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1147
11137
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1148
privateClassNamed:aClassNameStringOrSymbol
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1149
    ^ self privateClassesAt:aClassNameStringOrSymbol
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1150
!
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1151
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1152
privateClasses
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1153
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1154
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1155
    "return a collection of my private classes (if any).
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1156
     The classes are in any order."
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1157
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1158
    ^ self privateClassesOrAll:false
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1159
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1160
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1161
     Object privateClasses
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1162
     ObjectMemory privateClasses
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1163
     UILayoutTool privateClasses
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1164
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1165
3495
31ae10035c74 skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents: 3494
diff changeset
  1166
    "Modified: / 29.5.1998 / 23:23:18 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1167
!
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1168
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1169
privateClassesAt:aClassNameStringOrSymbol
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1170
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1171
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1172
    "return a private class if present; nil otherwise"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1173
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1174
    |myName nmSym|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1175
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1176
    myName := self name.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1177
    myName isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1178
        "/ no name - there cannot be a corresponding private class
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1179
        ^ nil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1180
    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1181
    nmSym := (myName , '::' , aClassNameStringOrSymbol) asSymbolIfInterned.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1182
    nmSym isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1183
        "/ no such symbol - there cannot be a corresponding private class
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1184
        ^ nil
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1185
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1186
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1187
    ^ Smalltalk at:nmSym.
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1188
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1189
    "Modified: 26.6.1997 / 11:44:04 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1190
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1191
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1192
privateClassesAt:aClassNameStringOrSymbol put:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1193
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1194
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1195
    "add a private class"
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1196
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1197
    self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1198
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1199
    "Modified: 26.6.1997 / 11:44:12 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1200
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1201
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1202
privateClassesOrAll:allOfThem
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1203
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1204
4495
4804e3e33d76 tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents: 4400
diff changeset
  1205
    "return a collection of my direct private classes (if any)
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1206
     or direct plus indirect private classes (if allOfThem).
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1207
     An empty collection if there are none.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1208
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1209
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1210
    |classes myName myNamePrefix myNamePrefixLen|
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1211
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1212
    myName := self name.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1213
    myNamePrefix := myName , '::'.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1214
    myNamePrefixLen := myNamePrefix size.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1215
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
  1216
    Smalltalk keysDo:[:nm |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1217
        |cls|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1218
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1219
        (nm startsWith:myNamePrefix) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1220
            (allOfThem
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1221
            or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1222
                cls := Smalltalk at:nm.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1223
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1224
                (cls isBehavior and:[cls isMeta not]) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1225
                    classes isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1226
                        classes := Set new:10.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1227
                    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1228
                    classes add:cls.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1229
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1230
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1231
        ]
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1232
    ].
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
  1233
4578
705211312d94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  1234
    ^ classes ? #()
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1235
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1236
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1237
     UILayoutTool privateClassesOrAll:true
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1238
     UILayoutTool privateClassesOrAll:false
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1239
    "
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1240
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1241
    "Modified: / 29.5.1998 / 23:23:18 / cg"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1242
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1243
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1244
privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1245
    "{ Pragma: +optSpace }"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1246
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1247
    "return a collection of my private classes (if any).
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1248
     The classes are sorted by inheritance."
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1249
7894
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1250
    |classes pivateClassesOf|
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1251
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1252
    classes := self privateClasses.
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1253
    (classes size > 0) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1254
        classes := classes asOrderedCollection.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1255
        classes sort:[:a :b | a name < b name].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1256
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1257
        pivateClassesOf := IdentityDictionary new.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1258
        classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1259
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1260
        classes topologicalSort:[:a :b |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1261
            "/ a must come before b iff:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1262
            "/    b is a subclass of a
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1263
            "/    b has a private class which is a subclass of a
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1264
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1265
            |mustComeBefore pivateClassesOfB|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1266
            mustComeBefore := b isSubclassOf:a.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1267
            pivateClassesOfB := pivateClassesOf at:b.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1268
            pivateClassesOfB do:[:eachClassInB |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1269
                mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1270
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1271
            mustComeBefore
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1272
        ].
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1273
    ].
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1274
    ^ classes.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1275
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1276
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1277
     Object privateClassesSorted
5731
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1278
     NewSystemBrowser privateClassesSorted
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1279
     NewSystemBrowser privateClasses
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1280
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1281
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1282
    "Created: 22.3.1997 / 16:10:42 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1283
    "Modified: 22.3.1997 / 16:11:20 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1284
!
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1285
9959
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1286
projectDefinition
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1287
    "return the project definition of the classes package"
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1288
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1289
    ^ ProjectDefinition definitionClassForPackage: self package
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1290
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1291
    "
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1292
     Object projectDefinition productVersion     
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1293
     DAPASX::DapasUI projectDefinition productVersion 
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1294
    "
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1295
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1296
    "Created: / 19-09-2006 / 22:02:06 / cg"
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1297
!
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1298
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1299
realSharedPools
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1300
    "this returns the namespace aware pool names"
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1301
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1302
    |poolNames ns|
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1303
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1304
    poolNames := self sharedPools.
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1305
    (ns := self topNameSpace) notNil ifTrue:[
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1306
        ^ poolNames 
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1307
                collect:[:nm | 
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1308
                    |p|
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1309
                    (p := ns at:nm) notNil ifTrue:[
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1310
                        p name
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1311
                    ] ifFalse:[
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1312
                        nm
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1313
                    ]].
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1314
    ].
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1315
    ^ poolNames 
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1316
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1317
    "
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1318
     Croquet::OpenGL sharedPools
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1319
     Croquet::OpenGL realSharedPools
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1320
    "
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1321
!
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1322
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1323
removeClassVarName:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1324
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1325
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1326
    "remove a class variable if not already there.
5635
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1327
     Also writes a change record and notifies dependents."
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1328
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1329
    |names newNames|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1330
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1331
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1332
    (names includes:aString) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1333
        newNames := ''.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1334
        names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1335
        self classVariableString:newNames withoutSpaces.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1336
        Class withoutUpdatingChangesDo:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1337
            self withAllSubclasses do:[:cls|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1338
                cls recompileMethodsAccessingAnyClassvarOrGlobal:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1339
                                        (Array with:aString asSymbol)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1340
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1341
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1342
        self addChangeRecordForClass:self andNotifyChangeOf:#classVariables.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1343
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1344
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1345
    "Created: / 29.10.1995 / 19:42:08 / cg"
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1346
    "Modified: / 23.1.1998 / 15:46:33 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1347
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1348
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1349
setCategory:aStringOrSymbol
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1350
    "set the category of the class to be the argument, aStringOrSymbol"
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1351
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1352
    aStringOrSymbol isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1353
        category := aStringOrSymbol
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1354
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1355
        category := aStringOrSymbol asSymbol
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1356
    ]
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1357
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1358
    "Created: 1.4.1997 / 15:24:04 / stefan"
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1359
!
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1360
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1361
setClassFilename:aFilename
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1362
    "set the classes filename.
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1363
     This is a dangerous (low level) operation, 
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1364
     since the comment and primitiveSpecs may no longer be accessable, 
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1365
     if a wrong filename is set here."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1366
10141
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1367
"/ cg: somewhere, the filename is set from a temporary (checkout) files name.
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1368
"/ we MUST catch and FIX this.
10142
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1369
aFilename notNil ifTrue:[
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1370
    (aFilename asFilename baseName startsWith:'st') ifTrue:[
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1371
        (aFilename asFilename baseName at:3) isDigit ifTrue:[
11261
e8dcdce0b2ae changed #classMenuCompareTwoRepositoryVersions
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  1372
            self halt:'this should not be reached'
10142
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1373
        ].
10141
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1374
    ].
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1375
].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1376
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1377
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1378
    "Modified: / 08-09-1995 / 14:16:48 / claus"
10142
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1379
    "Modified: / 25-10-2006 / 13:50:42 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1380
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1381
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1382
setClassVariableString:aString
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1383
    "set the classes classvarnames string.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1384
     This is a dangerous (low level) operation, since the
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1385
     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
  1386
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1387
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1388
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1389
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1390
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1391
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1392
    "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
  1393
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1394
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1395
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1396
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1397
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1398
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1399
    "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
  1400
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1401
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1402
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1403
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1404
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1405
    categoryStringOrSymbol isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1406
        cat := ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1407
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1408
        cat := categoryStringOrSymbol
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1409
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1410
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1411
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1412
5248
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1413
setEnvironment:aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1414
    "set the namespace I am contained in; ST-80 compatible name"
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1415
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1416
    environment := aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1417
!
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1418
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1419
setPackage:aSymbol
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1420
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1421
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1422
    package := aSymbol
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1423
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1424
    "Modified: / 09-08-2006 / 17:59:13 / fm"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1425
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1426
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1427
sharedPools
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1428
    "this returns the plain (non-namespace aware) pool names"
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1429
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1430
    |pools|
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1431
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1432
    pools := self getAttribute:#sharedPools.
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1433
    pools isNil ifTrue:[
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1434
        ^ #().
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1435
    ].
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1436
    pools isString ifTrue:[
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1437
        pools := pools asCollectionOfWords asArray collect:[:varName| varName asSymbol].
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1438
        self setAttribute:#sharedPools to:pools.
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1439
    ].
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1440
    ^ pools
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1441
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1442
    "
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1443
     Croquet::OpenGL sharedPools
10876
0c9be1a039aa comment
Claus Gittinger <cg@exept.de>
parents: 10843
diff changeset
  1444
     OpenGLRenderingContext sharedPools  
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1445
    "
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1446
!
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1447
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1448
sharedPools:aStringOrCollection
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1449
    "{ Pragma: +optSpace }"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1450
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1451
    "set the sharedPools string (no change notifications)"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1452
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1453
    self setSharedPools:aStringOrCollection.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1454
    self addChangeRecordForClass:self.
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1455
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1456
    "Modified: / 06-10-2006 / 13:35:14 / cg"
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1457
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1458
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1459
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1460
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1461
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1462
    |code aStream tmpFilename|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1463
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1464
" this is too slow for big classes (due to the emphasis stored)...
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1465
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1466
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1467
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1468
"
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1469
    tmpFilename := Filename newTemporary.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1470
    [
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1471
        aStream := tmpFilename newReadWriteStream.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1472
        aStream removeOnClose:true.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1473
    ] on:OpenError do:[:ex|
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1474
        self warn:'Class>>#source: cannot create temporary file: ', ex description.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1475
        ^ nil
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1476
    ].
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1477
    [
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1478
        FileOutErrorSignal handle:[:ex |
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1479
            aStream nextPut:$" ; nextPutAll:ex description; nextPut:$".
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1480
            FileOutErrorSignal isHandled ifTrue:[
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1481
                ex reject.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1482
            ].
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1483
        ] do:[
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1484
            self fileOutOn:aStream.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1485
        ].
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1486
        aStream reset.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1487
        code := aStream contents.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1488
    ] ensure:[
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1489
        aStream close.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1490
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1491
    ^ code
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1492
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1493
    "Modified: / 06-10-2006 / 13:34:18 / cg"
385
claus
parents: 384
diff changeset
  1494
!
claus
parents: 384
diff changeset
  1495
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1496
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1497
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1498
     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
  1499
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1500
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1501
    |owner module|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1502
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1503
    (owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager].
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1504
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1505
    "/ see if there is a package-specific manager
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1506
    package notNil ifTrue:[
10220
7332b36bc81e avoid need for libbasic3 (due to packageID reference)
Claus Gittinger <cg@exept.de>
parents: 10195
diff changeset
  1507
        module := package upTo:$:.
10376
fb8144dd40e2 *** empty log message ***
ca
parents: 10220
diff changeset
  1508
        AbstractSourceCodeManager notNil ifTrue:[
fb8144dd40e2 *** empty log message ***
ca
parents: 10220
diff changeset
  1509
            AbstractSourceCodeManager availableManagers do:[:mgr |
fb8144dd40e2 *** empty log message ***
ca
parents: 10220
diff changeset
  1510
                (mgr isResponsibleForModule:module) ifTrue:[^ mgr ].
fb8144dd40e2 *** empty log message ***
ca
parents: 10220
diff changeset
  1511
            ]
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1512
        ].
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1513
    ].
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1514
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1515
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1516
    "
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1517
     Array sourceCodeManager
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1518
     foo_p1 sourceCodeManager
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1519
    "
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1520
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1521
    "Created: / 07-12-1995 / 13:16:46 / cg"
10220
7332b36bc81e avoid need for libbasic3 (due to packageID reference)
Claus Gittinger <cg@exept.de>
parents: 10195
diff changeset
  1522
    "Modified: / 05-12-2006 / 22:04:26 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1523
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1524
5257
a90fd9cb3c18 category rename
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
  1525
!Class methodsFor:'adding & removing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1526
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1527
unload
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1528
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1529
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1530
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1531
     autoloaded. Can be used to get rid of no longer needed autoloaded
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1532
     classes.
328
claus
parents: 326
diff changeset
  1533
     (maybe, autoloaded classes should unload themselfes when no
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1534
      longer needed - for example, after some delay when the last instance
328
claus
parents: 326
diff changeset
  1535
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1536
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1537
    |nm newClass privateClasses|
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1538
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1539
    self wasAutoloaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1540
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1541
         can it be done ?
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1542
         (all of my methods must have a source)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1543
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1544
        self instAndClassSelectorsAndMethodsDo:[:sel :aMethod |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1545
            aMethod source isNil ifTrue:[^false].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1546
            aMethod hasPrimitiveCode ifTrue:[^ false].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1547
        ].
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1548
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1549
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1550
    "/ cannot unload, if non-autoloaded subclasses exist ...
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1551
    self allSubclassesDo:[:eachSubclass |
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1552
        eachSubclass wasAutoloaded ifFalse:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1553
            eachSubclass isPrivate ifFalse:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1554
                self warn:('cannot unload ' , self name , ' (' , eachSubclass name , ' requires it)').
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1555
                ^ false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1556
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1557
        ]
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1558
    ].
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1559
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1560
    self allSubclassesDo:[:eachSubclass |
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1561
        eachSubclass wasAutoloaded ifTrue:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1562
            eachSubclass unload
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1563
        ] ifFalse:[
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1564
            eachSubclass removeFromSystem.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1565
        ]
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1566
    ].
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1567
    privateClasses := self privateClasses.
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1568
    privateClasses notEmpty ifTrue:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1569
        self withoutUpdatingChangesDo:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1570
            privateClasses do:[:eachPrivateClass |
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1571
                eachPrivateClass removeFromSystem.
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1572
            ].
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1573
        ].
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1574
    ].
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1575
    Transcript showCR:'unloading ' , name , ' ...'.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1576
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1577
    "/ reinstall as autoloaded
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1578
    Autoload removeClass:self.
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1579
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1580
    Smalltalk at:nm put:nil.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1581
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1582
    ObjectMemory flushMethodCache.
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1583
    newClass := Autoload addClass:nm inCategory:category.
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1584
    newClass notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1585
        newClass package:package
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1586
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1587
    Smalltalk flushCachedClasses.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1588
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1589
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1590
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1591
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1592
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1593
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1594
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1595
    "
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1596
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1597
    "Modified: 7.6.1996 / 09:15:05 / stefan"
2675
bb724aff9c75 stefan (sigh) .... must care for metaClasses changeRecords
Claus Gittinger <cg@exept.de>
parents: 2671
diff changeset
  1598
    "Modified: 4.6.1997 / 14:48:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1599
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1600
9821
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1601
!Class methodsFor:'adding/removing'!
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1602
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1603
removeFromSystem
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1604
    "ST-80 compatibility
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1605
     remove myself from the system"
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1606
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1607
    Smalltalk removeClass:self.
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1608
    Smalltalk removeKey:name.
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1609
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1610
    "Created: 6.2.1996 / 11:32:58 / stefan"
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1611
! !
081272348537 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9815
diff changeset
  1612
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1613
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1614
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1615
addChangeRecordForChangeCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1616
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1617
6097
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1618
    "add a category change"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1619
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1620
    Class updateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1621
        self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
6097
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1622
    ].
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1623
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1624
    "this test allows a smalltalk without Projects/ChangeSets"
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1625
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1626
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1627
            Project addClassDefinitionChangeFor:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1628
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1629
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1630
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1631
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1632
addChangeRecordForClass:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1633
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1634
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1635
    "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
  1636
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1637
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1638
        self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1639
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1640
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1641
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1642
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1643
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1644
            Project addClassDefinitionChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1645
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1646
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1647
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1648
    "Modified: / 24.1.1997 / 19:09:41 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1649
    "Modified: / 18.3.1999 / 18:14:04 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1650
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1651
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1652
addChangeRecordForClassCheckIn:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1653
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1654
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1655
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1656
1938
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1657
    |rv|
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1658
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1659
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1660
        rv := aClass revision.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1661
        rv isNil ifTrue:[rv := '???'].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1662
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1663
        self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1664
            writingChangeWithTimeStamp:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1665
            perform:#addInfoRecord:to:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1666
            with:('checkin ' , aClass name , ' (' , rv , ')').
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1667
    ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1668
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1669
    "Created: / 18.11.1995 / 17:04:58 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1670
    "Modified: / 24.1.1997 / 19:11:55 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1671
    "Modified: / 18.3.1999 / 18:14:14 / stefan"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1672
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1673
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1674
addChangeRecordForClassComment:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1675
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1676
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1677
    "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
  1678
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1679
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1680
        self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1681
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1682
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1683
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1684
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1685
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1686
            Project addClassCommentChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1687
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1688
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1689
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1690
    "Modified: / 24.1.1997 / 19:09:59 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1691
    "Modified: / 18.3.1999 / 18:14:23 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1692
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1693
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1694
addChangeRecordForClassContainerRemove:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1695
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1696
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1697
    "append a container-was-removed-record to the changes file"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1698
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1699
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1700
        self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1701
            writingChangeWithTimeStamp:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1702
            perform:#addInfoRecord:to:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1703
            with:('removed source container of ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1704
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1705
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1706
    "Created: / 11.9.1996 / 15:37:19 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1707
    "Modified: / 24.1.1997 / 19:12:05 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1708
    "Modified: / 18.3.1999 / 18:14:31 / stefan"
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1709
!
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1710
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1711
addChangeRecordForClassFileOut:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1712
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1713
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1714
    "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
  1715
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1716
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1717
        self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1718
            writingChangeWithTimeStamp:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1719
            perform:#addInfoRecord:to:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1720
            with:('fileOut ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1721
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1722
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1723
    "Modified: / 24.1.1997 / 19:12:14 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1724
    "Modified: / 18.3.1999 / 18:14:36 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1725
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1726
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1727
addChangeRecordForClassInstvars:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1728
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1729
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1730
    "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
  1731
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1732
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1733
        self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1734
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1735
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1736
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1737
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1738
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1739
            Project addInstVarDefinitionChangeFor:aClass class
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1740
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1741
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1742
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1743
    "Modified: / 24.1.1997 / 19:10:18 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1744
    "Modified: / 18.3.1999 / 18:14:43 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1745
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1746
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1747
addChangeRecordForClassRemove
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1748
    "{ Pragma: +optSpace }"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1749
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1750
    "add a class-remove-record to the changes file"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1751
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1752
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1753
        self writingChangePerform:#addChangeRecordForClassRemove:to: with:self.
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1754
    ].
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1755
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1756
    "this test allows a smalltalk without Projects/ChangeSets"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1757
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1758
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1759
            Project addClassRemoveChange:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1760
        ]
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1761
    ]
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1762
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1763
    "Modified: / 24.1.1997 / 19:10:25 / cg"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1764
    "Modified: / 18.3.1999 / 18:14:53 / stefan"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1765
!
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1766
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1767
addChangeRecordForClassRemove:oldClassName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1768
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1769
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1770
    "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
  1771
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1772
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1773
        self writingChangePerform:#addChangeRecordForClassRemove:to: with:self.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1774
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1775
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1776
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1777
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1778
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1779
            Project addClassRemoveChange:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1780
        ]
2256
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
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1783
    "Modified: / 24.1.1997 / 19:10:25 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1784
    "Modified: / 18.3.1999 / 18:14:53 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1785
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1786
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1787
addChangeRecordForClassRename:oldName to:newName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1788
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1789
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1790
    "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
  1791
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1792
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1793
        self writingChangeDo:[:aStream |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1794
            self addChangeRecordForClassRename:oldName to:newName to:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1795
        ]
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1796
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1797
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1798
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1799
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1800
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1801
            Project addClassRenameChangeFrom:oldName to:newName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1802
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1803
    ]
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1804
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1805
    "Modified: / 24.1.1997 / 19:10:35 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1806
    "Modified: / 18.3.1999 / 18:14:59 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1807
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1808
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1809
addChangeRecordForPrimitiveDefinitions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1810
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1811
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1812
    "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
  1813
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1814
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1815
        self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1816
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1817
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1818
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1819
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1820
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1821
            Project addPrimitiveDefinitionsChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1822
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1823
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1824
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1825
    "Modified: / 20.1.1997 / 12:36:10 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1826
    "Modified: / 18.3.1999 / 18:15:04 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1827
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1828
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1829
addChangeRecordForPrimitiveFunctions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1830
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1831
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1832
    "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
  1833
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1834
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1835
        self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1836
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1837
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1838
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1839
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1840
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1841
            Project addPrimitiveFunctionsChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1842
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1843
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1844
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1845
    "Modified: / 20.1.1997 / 12:36:13 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1846
    "Modified: / 18.3.1999 / 18:15:09 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1847
!
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
addChangeRecordForPrimitiveVariables:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1850
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1851
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1852
    "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
  1853
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1854
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1855
        self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1856
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1857
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1858
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1859
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1860
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1861
            Project addPrimitiveVariablesChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1862
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1863
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1864
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1865
    "Modified: / 20.1.1997 / 12:36:16 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1866
    "Modified: / 18.3.1999 / 18:15:14 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1867
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1868
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1869
addChangeRecordForSnapshot:aFileName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1870
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1871
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1872
    "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
  1873
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1874
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1875
        self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1876
            writingChangeWithTimeStamp:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1877
            perform:#addChangeRecordForSnapshot:to:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1878
            with:aFileName.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1879
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1880
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1881
    "Modified: / 24.1.1997 / 19:12:25 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1882
    "Modified: / 18.3.1999 / 18:15:20 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1883
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1884
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1885
addChangeRecordForSnapshot:aFileName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1886
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1887
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1888
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1889
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1890
    self addInfoRecord:('snapshot ' , aFileName) to:aStream
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1891
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1892
    "Modified: / 24.1.1997 / 19:11:08 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1893
    "Modified: / 18.3.1999 / 18:15:30 / stefan"
2917
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  1894
! !
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  1895
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1896
!Class methodsFor:'enumerating'!
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1897
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1898
allPrivateClassesDo:aBlock
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1899
    "evaluate aBlock on all of my private classes (if any).
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1900
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1901
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1902
    self allPrivateClasses do:aBlock
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1903
!
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1904
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1905
privateClassesDo:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1906
    "evaluate aBlock on all of my (immediate) private classes (if any).
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1907
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1908
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1909
    self privateClasses do:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1910
!
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1911
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1912
subclassesDo:aBlock
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1913
    "evaluate the argument, aBlock for all immediate subclasses.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1914
     This will only enumerate globally known classes - for anonymous
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1915
     behaviors, you have to walk over all instances of Behavior."
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1916
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1917
    |coll|
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1918
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1919
    "/ use cached information (avoid class hierarchy search)
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1920
    "/ if possible
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1921
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1922
    SubclassInfo isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1923
        Class subclassInfo
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1924
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1925
    SubclassInfo notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1926
        coll := SubclassInfo at:self ifAbsent:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1927
        coll notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1928
            coll do:aBlock.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1929
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1930
        ^ self
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1931
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1932
8285
53824703669c *** empty log message ***
werner
parents: 8281
diff changeset
  1933
    coll := OrderedCollection new.
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1934
    Smalltalk allClassesDo:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1935
        (aClass superclass == self) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1936
            coll add:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1937
        ]
8285
53824703669c *** empty log message ***
werner
parents: 8281
diff changeset
  1938
    ].
53824703669c *** empty log message ***
werner
parents: 8281
diff changeset
  1939
53824703669c *** empty log message ***
werner
parents: 8281
diff changeset
  1940
    SubclassInfo notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1941
        SubclassInfo at:self put:coll.
8285
53824703669c *** empty log message ***
werner
parents: 8281
diff changeset
  1942
    ].
53824703669c *** empty log message ***
werner
parents: 8281
diff changeset
  1943
53824703669c *** empty log message ***
werner
parents: 8281
diff changeset
  1944
    coll do:aBlock.
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1945
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1946
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1947
     Collection subclassesDo:[:c | Transcript showCR:(c name)]
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1948
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1949
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1950
    "Modified: 22.1.1997 / 18:44:01 / cg"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1951
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1952
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1953
withAllPrivateClassesDo:aBlock
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1954
    "evaluate aBlock on myself and all of my private classes (if any).
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1955
     This recurses into private classes of private classes.
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1956
     Evaluation is in no particular order."
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1957
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1958
    aBlock value:self.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1959
    self allPrivateClasses do:aBlock
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1960
! !
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1961
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1962
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1963
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1964
primitiveDefinitions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1965
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1966
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1967
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1968
     unprocessed contents in the classes primitiveDefinitions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1969
     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
  1970
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1971
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1972
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1973
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1974
    "Modified: 10.2.1996 / 12:47:12 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1975
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1976
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1977
primitiveFunctions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1978
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1979
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1980
     It returns a CCReader which reads the next chunks and installs the
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1981
     unprocessed contents in the classes primitiveFunctions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1982
     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
  1983
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1984
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1985
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1986
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1987
    "Modified: 10.2.1996 / 12:47:07 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1988
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1989
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1990
primitiveVariables
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1991
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1992
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1993
     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
  1994
     unprocessed contents in the classes primitiveVariables section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1995
     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
  1996
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1997
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1998
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1999
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2000
    "Modified: 10.2.1996 / 12:47:28 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2001
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2002
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2003
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2004
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2005
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2006
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  2007
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2008
    self
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2009
        basicFileOutDefinitionOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2010
        withNameSpace:forceNameSpace
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2011
        withPackage:true
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2012
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2013
!
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2014
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2015
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2016
    "append an expression on aStream, which defines myself."
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2017
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2018
    self class
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2019
        basicFileOutDefinitionOf:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2020
        on:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2021
        withNameSpace:forceNameSpace withPackage:showPackage
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2022
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2023
8716
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2024
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2025
    "append an expression on aStream, which defines myself."
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2026
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2027
    self class
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2028
        basicFileOutDefinitionOf:self
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2029
        on:aStream
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2030
        withNameSpace:forceNameSpace 
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2031
        withPackage:showPackage
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2032
        syntaxHilighting:syntaxHilighting
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2033
!
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2034
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2035
basicFileOutInstvarTypeKeywordOn:aStream
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2036
    "a helper for fileOutDefinition"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2037
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2038
    |isVar superclass|
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2039
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2040
    superclass := self superclass.
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2041
    superclass isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2042
        isVar := self isVariable
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2043
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2044
        "I cant remember what this is for ?"
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2045
        isVar := (self isVariable and:[superclass isVariable not])
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2046
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2047
3920
0c1b9b2fa23b added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents: 3788
diff changeset
  2048
    aStream nextPutAll:(self firstDefinitionSelectorPart).
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2049
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2050
    "Created: 11.10.1996 / 18:57:29 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2051
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2052
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2053
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2054
    "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
  2055
     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
  2056
     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
  2057
     directory. Care is taken, to not clobber any existing file in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2058
     case of errors (for example: disk full).
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2059
     Also, since the classes methods need a valid sourcefile, the current
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2060
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2061
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2062
    |dirName nm fileName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2063
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2064
    nm := (Smalltalk fileNameForClass:self name),'.st'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2065
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2066
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2067
     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
  2068
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2069
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2070
        dirName := Project currentProjectDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2071
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2072
        dirName := Filename currentDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2073
    ].
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2074
    fileName := (dirName asFilename construct:nm).
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2075
    fileName makeLegalFilename.
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2076
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2077
    self fileOutAs:fileName name.
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2078
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2079
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2080
"/     add a change record; that way, administration is much easier,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2081
"/     since we can see in that changeBrowser, which changes have
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2082
"/     already found their way into a sourceFile and which must be
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2083
"/     applied again
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2084
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2085
"/    self addChangeRecordForClassFileOut:self
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2086
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2087
    "Modified: / 07-06-1996 / 09:14:43 / stefan"
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2088
    "Modified: / 06-10-2006 / 16:16:19 / cg"
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2089
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2090
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2091
fileOutAllMethodsOn:aStream
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2092
    self fileOutAllMethodsOn:aStream methodFilter:nil
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2093
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2094
    "Created: 15.10.1996 / 11:13:00 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2095
    "Modified: 22.3.1997 / 16:12:17 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2096
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2097
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2098
fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2099
    |collectionOfCategories|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2100
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2101
    collectionOfCategories := self class categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2102
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2103
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2104
            self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2105
            aStream cr
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2106
        ]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2107
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2108
    collectionOfCategories := self categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2109
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2110
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2111
            self fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2112
            aStream cr
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2113
        ]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2114
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2115
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2116
    self privateClassesSorted do:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2117
        aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2118
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2119
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2120
    "Created: 15.10.1996 / 11:13:00 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2121
    "Modified: 22.3.1997 / 16:12:17 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2122
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2123
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2124
fileOutAs:fileNameString
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2125
    "create a file consisting of all methods in myself in
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2126
     sourceForm, from which the class can be reconstructed (by filing in).
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2127
     The given fileName should be a full path, including suffix.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2128
     Care is taken, to not clobber any existing file in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2129
     case of errors (for example: disk full).
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2130
     Also, since the classes methods need a valid sourcefile, the current
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2131
     sourceFile may not be rewritten."
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2132
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2133
    |aStream fileName newFileName savFilename needRename
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2134
     mySourceFileName sameFile s mySourceFileID anySourceRef|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2135
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2136
    self isLoaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2137
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2138
            raiseRequestWith:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2139
                 errorString:' - will not fileOut unloaded class: ', self name
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2140
    ].
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2141
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2142
    fileName := fileNameString asFilename.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2143
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2144
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2145
     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
  2146
     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
  2147
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2148
    "
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2149
    (fileName exists) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2150
        sameFile := false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2151
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2152
        "/ check carefully - maybe, my source does not really come from that
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2153
        "/ file (i.e. all of my methods have their source as string)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2154
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2155
        anySourceRef := false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2156
        self instAndClassMethodsDo:[:m |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2157
            m sourcePosition notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2158
                anySourceRef := true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2159
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2160
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2161
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2162
        anySourceRef ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2163
            s := self sourceStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2164
            s notNil ifTrue:[
10035
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2165
                OperatingSystem isUNIXlike ifTrue:[
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2166
                    mySourceFileID := s pathName asFilename info id.
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2167
                    sameFile := (fileName info id) == mySourceFileID.
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2168
                ] ifFalse:[
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2169
                    mySourceFileID := s pathName asFilename asAbsoluteFilename.
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2170
                    sameFile := (fileName asFilename asAbsoluteFilename) = mySourceFileID.
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2171
                ].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2172
                s close.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2173
            ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2174
                classFilename notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2175
                    "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2176
                     check for overwriting my current source file
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2177
                     this is not allowed, since it would clobber my methods source
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2178
                     file ... you have to save it to some other place.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2179
                     This happens if you ask for a fileOut into the source-directory
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2180
                     (from which my methods get their source)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2181
                    "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2182
                    mySourceFileName := Smalltalk getSourceFileName:classFilename.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2183
                    sameFile := (fileNameString = mySourceFileName).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2184
                    sameFile ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2185
                        mySourceFileName notNil ifTrue:[
10035
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2186
                            OperatingSystem isUNIXlike ifTrue:[
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2187
                                sameFile := (fileName info id) == (mySourceFileName asFilename info id)
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2188
                            ]
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2189
                        ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2190
                    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2191
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2192
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2193
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2194
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2195
        sameFile ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2196
            ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2197
                raiseRequestWith:fileNameString
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2198
                errorString:(' - may not overwrite sourcefile:', fileNameString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2199
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2200
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2201
        savFilename := Filename newTemporary.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2202
        fileName copyTo:savFilename.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2203
        newFileName := fileName withSuffix:'new'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2204
        needRename := true
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2205
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2206
        "/ another possible trap: if my sourceFileName is
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2207
        "/ the same as the written one AND the new files directory
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2208
        "/ is along the sourcePath, we also need a temporary file
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2209
        "/ first, to avoid accessing the newly written file.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2210
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2211
        anySourceRef := false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2212
        self instAndClassMethodsDo:[:m |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2213
            |mSrc|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2214
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2215
            (mSrc := m sourceFilename) notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2216
                mSrc asFilename baseName = fileName baseName ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2217
                    anySourceRef := true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2218
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2219
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2220
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2221
        anySourceRef ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2222
            newFileName := fileName withSuffix:'new'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2223
            needRename := true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2224
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2225
            newFileName := fileName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2226
            needRename := false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2227
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2228
    ].
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2229
    [
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2230
        aStream := newFileName writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2231
    ] on:FileStream openErrorSignal do:[:ex|
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2232
        savFilename notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2233
            savFilename delete
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2234
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2235
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2236
                raiseRequestWith:newFileName name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2237
                errorString:(' - cannot create file:', newFileName name)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2238
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2239
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2240
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2241
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2242
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2243
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2244
     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
  2245
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2246
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2247
    needRename ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2248
        newFileName copyTo:fileName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2249
        newFileName delete
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2250
    ].
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2251
    savFilename notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2252
        savFilename delete
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2253
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2254
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2255
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2256
     add a change record; that way, administration is much easier,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2257
     since we can see in that changeBrowser, which changes have
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2258
     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
  2259
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2260
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2261
    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
  2262
10035
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2263
    "Modified: / 07-06-1996 / 09:14:43 / stefan"
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2264
    "Created: / 16-04-1997 / 20:44:05 / cg"
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2265
    "Modified: / 04-10-2006 / 17:26:23 / cg"
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2266
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2267
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2268
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2269
    "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
  2270
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2271
    self class
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2272
        fileOutClassInstVarDefinitionOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2273
        withNameSpace:false
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2274
!
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2275
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2276
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2277
    "append an expression to define my classInstanceVariables on aStream"
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2278
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2279
    |anySuperClassInstVar|
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2280
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2281
    self isLoaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2282
        ^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2283
    ].
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2284
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2285
    withNameSpace ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2286
        self name printOn:aStream.
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2287
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2288
        self printClassNameOn:aStream.
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2289
    ].
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2290
    aStream nextPutAll:' class instanceVariableNames:'''.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2291
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2292
    aStream nextPutAll:''''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2293
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2294
    "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
  2295
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2296
    anySuperClassInstVar := false.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2297
    self allSuperclassesDo:[:aSuperClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2298
        aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true].
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2299
    ].
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2300
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2301
    aStream cr; cr; nextPut:(Character doubleQuote); cr; space.
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2302
    anySuperClassInstVar ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2303
        aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2304
            nextPutLine:'No other class instance variables are inherited by this class.'.
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2305
    ] ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2306
        aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2307
            nextPutLine:'The following class instance variables are inherited by this class:'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2308
        aStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2309
        self allSuperclassesDo:[:aSuperClass |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2310
            aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2311
            aStream nextPutLine:(aSuperClass class instanceVariableString).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2312
        ].
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2313
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2314
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2315
    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
  2316
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2317
    "Created: / 10.12.1995 / 16:31:25 / cg"
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2318
    "Modified: / 1.4.1997 / 16:00:33 / stefan"
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2319
    "Modified: / 3.2.2000 / 23:05:28 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2320
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2321
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2322
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2323
    "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
  2324
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2325
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2326
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2327
    self printClassNameOn:aStream.
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2328
    aStream nextPutAll:' comment:'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2329
    (comment := self comment) isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2330
        s := ''''''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2331
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2332
        s := comment storeString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2333
    ].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2334
    aStream nextPutAllAsChunk:s.
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  2335
    aStream nextPutChunkSeparator.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2336
    aStream cr
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2337
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2338
    "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
  2339
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2340
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2341
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2342
    "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
  2343
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2344
    ^ 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
  2345
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2346
    "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
  2347
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2348
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2349
fileOutIn:aDirectoryName
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2350
    "create a file 'class.st' consisting of all methods in self in
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2351
     directory aDirectoryName (ignoring any directory setting in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2352
     the current project).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2353
     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
  2354
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2355
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2356
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2357
    fileName := (Smalltalk fileNameForClass:self name),'.st'.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2358
    [
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2359
        aStream := (aDirectoryName asFilename construct:fileName) writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2360
    ] on:FileStream openErrorSignal do:[:ex|
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2361
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2362
                raiseRequestWith:fileName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2363
                errorString:(' - cannot create file:', fileName)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2364
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2365
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2366
    aStream close
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2367
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2368
    "
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2369
        self fileOutIn:'/tmp'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2370
        self fileOutIn:'/tmp/doesNotExistBla'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2371
        self fileOutIn:'/tmp' asFilename
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2372
    "
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2373
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2374
    "Modified: / 19-09-1997 / 00:03:53 / stefan"
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2375
    "Modified: / 06-10-2006 / 16:16:13 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2376
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2377
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2378
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2379
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2380
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2381
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2382
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2383
    "Created: 15.11.1995 / 12:53:32 / cg"
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2384
    "Modified: 3.1.1997 / 17:50:28 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2385
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2386
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2387
fileOutOn:aStream withTimeStamp:stampIt
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2388
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2389
     If stampIt is true, a timeStamp comment is prepended."
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2390
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2391
    self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2392
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2393
    "Modified: / 13.3.1998 / 12:23:02 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2394
!
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2395
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2396
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2397
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2398
     If stampIt is true, a timeStamp comment is prepended.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2399
     If initIt is true, and the class implements a class-initialize method,
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2400
     append a corresponding doIt expression for initialization."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2401
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2402
    self
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2403
        fileOutOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2404
        withTimeStamp:stampIt
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2405
        withInitialize:initIt
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2406
        withDefinition:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2407
        methodFilter:nil
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2408
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2409
    "Created: / 15.11.1995 / 12:53:06 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2410
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2411
    "Modified: / 13.3.1998 / 12:23:59 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2412
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2413
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2414
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2415
    "file out my definition and all methods onto aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2416
     If stampIt is true, a timeStamp comment is prepended.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2417
     If initIt is true, and the class implements a class-initialize method,
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2418
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2419
     The order by which the fileOut is done is used to put the version string at the end.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2420
     Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move"
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2421
8212
791fe3ab2089 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8208
diff changeset
  2422
    |encoder any16Bit|
8164
db7a658c7bfc fileout in utf8-format
ca
parents: 8149
diff changeset
  2423
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2424
    any16Bit :=
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2425
        self methodDictionary
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2426
            contains:[:m |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2427
                |src|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2428
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2429
                src := m source ? ''.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2430
                (src contains:[:ch | ch asciiValue > 16rFF])
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2431
            ].
8164
db7a658c7bfc fileout in utf8-format
ca
parents: 8149
diff changeset
  2432
    any16Bit ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2433
        any16Bit :=
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2434
            self class methodDictionary
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2435
                contains:[:m |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2436
                    |src|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2437
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2438
                    src := m source ? ''.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2439
                    (src contains:[:ch | ch asciiValue > 16rFF])
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2440
                ].
8164
db7a658c7bfc fileout in utf8-format
ca
parents: 8149
diff changeset
  2441
    ].
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2442
    any16Bit ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2443
        encoder := CharacterEncoder encoderForUTF8.
8075
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2444
    ].
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2445
    ^ self
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2446
        fileOutOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2447
        withTimeStamp:stampIt
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2448
        withInitialize:initIt
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2449
        withDefinition:withDefinition
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2450
        methodFilter:methodFilter
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2451
        encoder:encoder
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2452
!
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2453
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2454
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2455
    "file out my definition and all methods onto aStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2456
     If stampIt is true, a timeStamp comment is prepended.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2457
     If initIt is true, and the class implements a class-initialize method,
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2458
     append a corresponding doIt expression for initialization.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2459
     The order by which the fileOut is done is used to put the version string at the end.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2460
     Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move"
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2461
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  2462
    self class
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2463
        fileOutOn:outStreamArg
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2464
        withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2465
        methodFilter:methodFilter encoder:encoderOrNil
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  2466
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2467
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2468
    "Created: / 15.11.1995 / 12:53:06 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2469
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2470
    "Modified: / 13.3.1998 / 12:23:59 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2471
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2472
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2473
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2474
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2475
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2476
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2477
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2478
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2479
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2480
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2481
    (s := self primitiveDefinitionsString) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2482
        aStream nextPutChunkSeparator.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2483
        self printClassNameOn:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2484
        aStream nextPutAll:' primitiveDefinitions';
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2485
                nextPutChunkSeparator;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2486
                cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2487
        aStream nextPutAll:s.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2488
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2489
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2490
    (s := self primitiveVariablesString) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2491
        aStream nextPutChunkSeparator.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2492
        self printClassNameOn:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2493
        aStream nextPutAll:' primitiveVariables';
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2494
                nextPutChunkSeparator;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2495
                cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2496
        aStream nextPutAll:s.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2497
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2498
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2499
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2500
    "Modified: 8.1.1997 / 17:45:40 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2501
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2502
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2503
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2504
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2505
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2506
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2507
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2508
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2509
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2510
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2511
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2512
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2513
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2514
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2515
    (s := self primitiveFunctionsString) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2516
        aStream nextPutChunkSeparator.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2517
        self printClassNameOn:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2518
        aStream nextPutAll:' primitiveFunctions';
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2519
                nextPutChunkSeparator;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2520
                cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2521
        aStream nextPutAll:s.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2522
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2523
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2524
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2525
    "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
  2526
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2527
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2528
!Class methodsFor:'fileOut-binary'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2529
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2530
binaryFileOut
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2531
    "create a file 'class.cls' (in the current projects fileOut-directory),
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2532
     consisting of all methods in myself in a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2533
     The methods source is saved by reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2534
     to the classes sourceFile if there is any.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2535
     That sourcefile needs to be present after reload in order to be
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2536
     browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2537
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2538
    self binaryFileOutWithSourceMode:#reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2539
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2540
    "Modified: 5.1.1997 / 15:40:05 / cg"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2541
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2542
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2543
binaryFileOutOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2544
    "append a binary representation of myself to aStream"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2545
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2546
    self binaryFileOutOn:aStream sourceMode:#reference
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2547
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2548
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2549
binaryFileOutOn:aStream sourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2550
    "append a binary representation of myself to aStream in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2551
     a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2552
     The argument controls how sources are to be saved:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2553
        #keep - include the source
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2554
        #reference - include a reference to the sourceFile
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2555
        #discard - dont save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2556
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2557
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2558
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2559
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2560
    |bos|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2561
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2562
    bos := BinaryObjectStorage onNew:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2563
    bos sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2564
    bos nextPutClasses:(Array with:self).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2565
    bos close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2566
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2567
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2568
binaryFileOutWithSourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2569
    "create a file 'class.cls' (in the current projects fileOut-directory),
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2570
     consisting of all methods in myself in a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2571
     The argument controls how sources are to be saved:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2572
        #keep - include the source
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2573
        #reference - include a reference to the sourceFile
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2574
        #discard - dont save sources.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2575
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2576
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2577
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2578
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2579
    |fileName dirName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2580
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2581
    fileName := (Smalltalk fileNameForClass:self name), '.cls'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2582
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2583
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2584
        dirName := Project currentProjectDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2585
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2586
        dirName := '.'
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2587
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2588
    fileName := dirName asFilename construct:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2589
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2590
    fileName := fileName name.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2591
    self binaryFileOutWithSourceMode:sourceMode as:fileName.
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2592
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2593
    "Modified: / 06-10-2006 / 16:16:29 / cg"
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2594
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2595
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2596
binaryFileOutWithSourceMode:sourceMode as:fileNameString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2597
    "create a file fileNameString,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2598
     consisting of all methods in myself in a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2599
     The argument controls how sources are to be saved:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2600
        #keep - include the source
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2601
        #reference - include a reference to the sourceFile
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2602
        #discard - dont save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2603
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2604
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2605
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2606
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2607
    |fileName aStream|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2608
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2609
    fileName := fileNameString asFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2610
    fileName makeLegalFilename.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2611
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2612
    [
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2613
        aStream := fileName newReadWriteStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2614
    ] on:FileStream openErrorSignal do:[:ex|
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2615
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2616
                raiseRequestWith:fileName name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2617
                errorString:(' - cannot create file:', fileName name)
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2618
    ].
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2619
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2620
    aStream binary.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2621
    self binaryFileOutOn:aStream sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2622
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2623
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2624
    "Created: / 29.12.1998 / 21:38:38 / cg"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2625
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2626
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2627
!Class methodsFor:'fileOut-xml'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2628
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2629
fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2630
    "create a file 'class.xml' consisting of all methods in myself in
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2631
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2632
     If the current project is not nil, create the file in the projects
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2633
     directory. Care is taken, to not clobber any existing file in
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2634
     case of errors (for example: disk full)"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2635
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2636
    |dirName nm fileName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2637
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2638
    nm := (Smalltalk fileNameForClass:self name) , '.xml'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2639
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2640
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2641
     this test allows a smalltalk to be built without Projects/ChangeSets
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2642
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2643
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2644
        dirName := Project currentProjectDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2645
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2646
        dirName := Filename currentDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2647
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2648
    fileName := (dirName asFilename construct:nm).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2649
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2650
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2651
    self fileOutXMLAs:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2652
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2653
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2654
     Class fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2655
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2656
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2657
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2658
fileOutXMLAllDefinitionsOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2659
    "append xml expressions on aStream, which defines myself and all of my private classes."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2660
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2661
    self fileOutXMLDefinitionOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2662
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2663
    "/ here, the full nameSpace prefixes are output,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2664
    "/ to avoid confusing stc
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2665
    "/ (which otherwise could not find the correct superclass)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2666
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2667
    FileOutNameSpaceQuerySignal answer:true do:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2668
        self privateClassesSorted do:[:aClass |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2669
            aClass fileOutXMLAllDefinitionsOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2670
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2671
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2672
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2673
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2674
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2675
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2676
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2677
    |collectionOfCategories|
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2678
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2679
    collectionOfCategories := self class categories asSortedCollection.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2680
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2681
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2682
            self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2683
            aStream cr
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2684
        ]
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2685
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2686
    collectionOfCategories := self categories asSortedCollection.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2687
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2688
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2689
            self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2690
            aStream cr
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2691
        ]
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2692
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2693
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2694
    self privateClassesSorted do:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2695
        aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2696
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2697
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2698
!
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2699
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2700
fileOutXMLAs:fileNameOrString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2701
    "create a file consisting of all methods in myself in
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2702
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2703
     The given fileName should be a full path, including suffix."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2704
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2705
    |aStream fileName|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2706
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2707
    self isLoaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2708
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2709
            raiseRequestWith:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2710
                 errorString:' - will not fileOut unloaded class: ', self name
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2711
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2712
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2713
    fileName := fileNameOrString asFilename.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2714
    [
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2715
        aStream := fileName writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2716
    ] on:FileStream openErrorSignal do:[:ex|
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2717
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2718
                raiseRequestWith:fileName name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2719
                errorString:(' - cannot create file: ', fileName name)
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2720
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2721
    self fileOutXMLOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2722
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2723
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2724
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2725
     Class fileOutXMLAs:'test.xml'
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2726
     Class fileOutXMLAs:'/blaDoesNotExist/test.xml'
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2727
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2728
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2729
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2730
fileOutXMLDefinitionOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2731
    "append an xml expression on aStream, which defines myself."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2732
6703
ffea6ebb676d Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 6701
diff changeset
  2733
    |varNames|
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2734
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2735
    aStream nextPutLine:'<class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2736
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2737
    aStream nextPutAll:'  <name>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2738
    aStream nextPutAll:(self nameWithoutPrefix).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2739
    aStream nextPutLine:'</name>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2740
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2741
    aStream nextPutAll:'  <environment>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2742
    aStream nextPutAll:(self nameSpace name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2743
    aStream nextPutLine:'</environment>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2744
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2745
    aStream nextPutAll:'  <super>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2746
    aStream nextPutAll:(self theNonMetaclass superclass name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2747
    aStream nextPutLine:'</super>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2748
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2749
    aStream nextPutAll:'  <private>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2750
    aStream nextPutAll:(self isPrivate printString).
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2751
    aStream nextPutLine:'</private>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2752
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2753
    aStream nextPutAll:'  <indexed-type>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2754
    aStream nextPutAll:'none'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2755
    aStream nextPutLine:'</indexed-type>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2756
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2757
    aStream nextPutAll:'  <inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2758
    varNames := self instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2759
    varNames size > 0 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2760
        aStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2761
        varNames do:[:nm |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2762
            aStream nextPutAll:'    <name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2763
            aStream nextPutAll:nm.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2764
            aStream nextPutLine:'</name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2765
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2766
        aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2767
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2768
    aStream nextPutLine:'</inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2769
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2770
    aStream nextPutAll:'  <class-inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2771
    varNames := self class instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2772
    varNames size > 0 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2773
        aStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2774
        varNames do:[:nm |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2775
            aStream nextPutAll:'    <name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2776
            aStream nextPutAll:nm.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2777
            aStream nextPutLine:'</name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2778
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2779
        aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2780
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2781
    aStream nextPutLine:'</class-inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2782
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2783
    aStream nextPutAll:'  <imports>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2784
    aStream nextPutAll:''.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2785
    aStream nextPutLine:'</imports>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2786
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2787
    aStream nextPutAll:'  <category>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2788
    aStream nextPutAll:self category.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2789
    aStream nextPutLine:'</category>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2790
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2791
    aStream nextPutLine:'</class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2792
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2793
    varNames := self classVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2794
    varNames size > 0 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2795
        varNames do:[:nm |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2796
            aStream nextPutLine:'<static>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2797
            aStream nextPutAll:' <name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2798
            aStream nextPutAll:nm.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2799
            aStream nextPutLine:'</name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2800
            aStream nextPutAll:' <environment>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2801
            aStream nextPutAll:self name.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2802
            aStream nextPutLine:'</environment>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2803
            aStream nextPutLine:'</static>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2804
        ].
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2805
    ].
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2806
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2807
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2808
fileOutXMLOn:aStream
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2809
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2810
     file out my definition and all methods onto aStream in XML format."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2811
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2812
    self
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2813
        fileOutXMLOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2814
        withTimeStamp:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2815
        withInitialize:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2816
        withDefinition:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2817
        methodFilter:nil
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2818
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2819
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2820
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2821
fileOutXMLOn:aStream withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2822
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2823
     file out my definition and all methods onto aStream in XML format.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2824
     If stampIt is true, a timeStamp comment is prepended.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2825
     If initIt is true, and the class implements a class-initialize method,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2826
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2827
     The order by which the fileOut is done is used to put the version string at the end.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2828
     Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2829
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2830
    |collectionOfCategories copyrightMethod copyrightText comment meta|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2831
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2832
    self isLoaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2833
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2834
            raiseRequestWith:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2835
                 errorString:' - will not fileOut unloaded class: ', self name
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2836
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2837
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2838
    meta := self class.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2839
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2840
    aStream nextPutLine:'<?xml version="1.0"?>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2841
    aStream nextPutLine:'<st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2842
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2843
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2844
     if there is a copyright method, add a copyright element at the beginning,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2845
     taking the string from the copyright method.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2846
     We cannot do this unconditionally - that would lead to my copyrights
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2847
     being put on your code ;-).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2848
     On the other hand: I want every file created by myself to have the
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2849
     copyright string at the beginning be preserved .... even if the
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2850
     code was edited in the browser and filedOut.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2851
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2852
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2853
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2854
         get the copyright methods source,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2855
         and insert at beginning.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2856
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2857
        copyrightText := copyrightMethod source.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2858
        copyrightText isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2859
            "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2860
             no source available - trigger an error
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2861
            "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2862
            FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2863
                raiseRequestWith:' - no source for class: '.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2864
            ^ self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2865
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2866
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2867
         strip off the selector-line
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2868
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2869
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2870
        copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2871
        [copyrightText last isEmpty] whileTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2872
            copyrightText := copyrightText copyWithoutLast:1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2873
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2874
        (copyrightText first = '"') ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2875
            (copyrightText last = '"') ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2876
                copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2877
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2878
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2879
        copyrightText := copyrightText asString.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2880
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2881
        aStream nextPutAll:'<copyright>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2882
        self fileOutXMLString:copyrightText on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2883
        aStream nextPutLine:'</copyright>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2884
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2885
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2886
    stampIt ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2887
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2888
        "/ first, a timestamp
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2889
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2890
        aStream nextPutAll:'<time-stamp>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2891
        self fileOutXMLString:(Smalltalk timeStampString) on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2892
        aStream nextPutLine:'</time-stamp>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2893
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2894
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2895
    withDefinition ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2896
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2897
        "/ then the definition
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2898
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2899
        self fileOutXMLAllDefinitionsOn:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2900
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2901
        "/ a comment - if any
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2902
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2903
        (comment := self comment) notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2904
            aStream nextPutLine:'<comment>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2905
            aStream nextPutAll:'<class-id>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2906
            aStream nextPutAll:(self name).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2907
            aStream nextPutLine:'</class-id>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2908
            aStream nextPutLine:'</comment>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2909
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2910
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2911
        "/ primitive definitions - if any
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2912
        "/
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2913
"/        self fileOutPrimitiveSpecsOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2914
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2915
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2916
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2917
    "/ methods from all categories in metaclass (i.e. class methods)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2918
    "/ EXCEPT: the version method is placed at the very end, to
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2919
    "/         avoid sourcePosition-shifts when checked out later.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2920
    "/         (RCS expands this string, so its size is not constant)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2921
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2922
    collectionOfCategories := meta categories asSortedCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2923
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2924
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2925
            meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2926
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2927
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2928
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2929
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2930
    "/ methods from all categories in myself
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2931
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2932
    collectionOfCategories := self categories asSortedCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2933
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2934
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2935
            self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2936
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2937
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2938
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2939
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2940
    "/ any private classes' methods
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2941
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2942
    self privateClassesSorted do:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2943
        aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2944
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2945
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2946
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2947
    initIt ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2948
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2949
        "/ optionally an initialize message
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2950
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2951
        (meta includesSelector:#initialize) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2952
            aStream nextPutLine:'<initialize>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2953
            aStream nextPutAll:'<class-id>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2954
            aStream nextPutAll:(self name).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2955
            aStream nextPutLine:'</class-id>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2956
            aStream nextPutLine:'</initialize>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2957
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2958
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2959
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2960
    aStream nextPutLine:'</st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2961
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2962
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2963
     Class
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2964
        fileOutXMLOn:'test.xml' asFilename writeStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2965
        withTimeStamp:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2966
        withInitialize:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2967
        withDefinition:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2968
        methodFilter:nil
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2969
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2970
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2971
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2972
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2973
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2974
htmlDocumentation
8356
96c5195d52c7 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 8285
diff changeset
  2975
    <resource: #obsolete>
7227
5df22f2ffebc htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents: 7222
diff changeset
  2976
    self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'.
5df22f2ffebc htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents: 7222
diff changeset
  2977
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2978
    ^ HTMLDocGenerator htmlDocOf:self
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2979
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2980
    "Created: 22.3.1997 / 14:18:23 / cg"
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2981
!
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  2982
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2983
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2984
    "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
  2985
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2986
    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
  2987
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2988
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2989
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2990
    "print myself and all subclasses on aStream.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2991
     recursively calls itself to print subclasses.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2992
     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
  2993
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2994
    |nm|
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2995
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2996
    nm := self name.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  2997
    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
  2998
    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
  2999
    aStream nextPutLine:')'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3000
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3001
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3002
        aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3003
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3004
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3005
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3006
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3007
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3008
     printStream close"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3009
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3010
    "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
  3011
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3012
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3013
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3014
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3015
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  3016
    |comment s superclass|
333
claus
parents: 328
diff changeset
  3017
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3018
    aPrintStream nextPutAll:'class                '; bold; nextPutLine:self name; normal.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3019
    aPrintStream nextPutAll:'superclass           '.
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  3020
    superclass := self superclass.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3021
    superclass isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3022
        s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3023
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3024
        s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3025
    ].
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3026
    aPrintStream nextPutLine:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3027
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3028
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3029
    self printInstVarNamesOn:aPrintStream indent:21.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3030
    aPrintStream cr.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3031
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3032
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3033
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3034
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3035
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3036
    category notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3037
        aPrintStream nextPutAll:'category             ';
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3038
                     nextPutLine:(category printString).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3039
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3040
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  3041
    (comment := self comment) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3042
        aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3043
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3044
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3045
    "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
  3046
    "Modified: 9.11.1996 / 00:13:37 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3047
    "Modified: 1.4.1997 / 16:01:26 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3048
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3049
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3050
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3051
    "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
  3052
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3053
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3054
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3055
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3056
    aPrintStream cr.
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3057
    collectionOfCategories := self class categories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3058
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3059
        aPrintStream nextPutLine:'class protocol'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3060
        aPrintStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3061
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3062
            self class printOutCategory:aCategory on:aPrintStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3063
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3064
    ].
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3065
    collectionOfCategories := self categories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3066
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3067
        aPrintStream nextPutLine:'instance protocol'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3068
        aPrintStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3069
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3070
            self printOutCategory:aCategory on:aPrintStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3071
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3072
    ]
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3073
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3074
    "Modified: / 25.11.1998 / 12:40:31 / cg"
5938
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3075
!
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3076
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3077
printSharedPoolNamesOn:aStream indent:indent
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3078
    "print the pool names indented and breaking at line end"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3079
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3080
    self printNameArray:(self sharedPools) on:aStream indent:indent
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3081
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3082
5938
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3083
storeOn:aStream
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3084
    "append my name only - expects class to be there, when restoring"
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3085
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3086
    aStream nextPutAll:self name
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3087
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3088
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3089
!Class methodsFor:'private-accessing'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3090
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3091
attributes
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3092
    "return the extra class attributes or nil"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3093
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3094
    ^ self classAttributes
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3095
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3096
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3097
attributes:aClassAttributesObject
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3098
    "set the extra class attributes"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3099
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3100
    self classAttributes:aClassAttributesObject
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3101
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3102
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3103
classAttributes
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3104
    "return the extra class attributes or nil"
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3105
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3106
    attributes isArray ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3107
        attributes := ClassAttributes new fromSTCPrimitiveArray:attributes.
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3108
    ].
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3109
    ^  attributes
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3110
!
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3111
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3112
classAttributes:aClassAttributesObject
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3113
    "set the extra class attributes"
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3114
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3115
    attributes := aClassAttributesObject
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3116
!
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3117
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3118
getAttribute:aKey
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3119
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3120
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3121
    "get an attribute (by symbolic key)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3122
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3123
    attributes isNil ifTrue:[ ^ nil].
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3124
    ^ self classAttributes perform:aKey asSymbol
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3125
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3126
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3127
getSourceChunkAttribute:aKey
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3128
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3129
7472
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3130
    |pos stream string|
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3131
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3132
    pos := self getAttribute:aKey.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3133
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3134
    "the attribute is either a string, or an integer specifying the
7472
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3135
     position within the classes sourcefile ..."
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3136
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3137
    pos isNumber ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3138
"/        classFilename notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3139
            stream := self sourceStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3140
            stream notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3141
                stream position0Based:pos.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3142
                string := stream nextChunk.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3143
                stream close.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3144
                ^ string
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3145
            ].
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3146
"/        ].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3147
        ^ nil
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3148
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3149
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3150
    ^ pos
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3151
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3152
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3153
setAttribute:key to:aValue
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3154
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3155
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3156
    attributes isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3157
        attributes := ClassAttributes new.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3158
    ].
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3159
    self classAttributes perform:(key , ':') asSymbol with:aValue
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3160
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3161
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3162
setPrimitiveDefinitions:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3163
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3164
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3165
    "set the primitiveDefinition string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3166
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3167
    ^ self setAttribute:#primitiveDefinitions to:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3168
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3169
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3170
setPrimitiveFunctions:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3171
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3172
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3173
    "set the primitiveFunction string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3174
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3175
    ^ self setAttribute:#primitiveFunctions to:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3176
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3177
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3178
setPrimitiveVariables:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3179
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3180
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3181
    "set the primitiveVariable string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3182
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3183
    ^ self setAttribute:#primitiveVariables to:aString
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3184
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3185
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3186
setSharedPools:aStringOrCollection
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3187
    "{ Pragma: +optSpace }"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3188
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3189
    "set the sharedPools string (no change notifications)"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3190
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3191
    ^ self setAttribute:#sharedPools to:aStringOrCollection
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3192
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3193
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3194
setSuperclass:aClass
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3195
    "set the superclass of the receiver.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3196
     this method is for special uses only - there will be no recompilation
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3197
     and no change record written here. Also, if the receiver class has
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3198
     already been in use, future operation of the system is not guaranteed to
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3199
     be correct, since no caches are flushed.
8072
e7542f2dbb9c flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents: 8051
diff changeset
  3200
     Therefore: do NOT use it; use #superclass: (or flush the caches, at least)."
e7542f2dbb9c flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents: 8051
diff changeset
  3201
e7542f2dbb9c flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents: 8051
diff changeset
  3202
    SubclassInfo := nil.  "/ flush it
e7542f2dbb9c flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents: 8051
diff changeset
  3203
    superclass := aClass
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3204
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3205
7258
9ccdbee7d1ad method category rename
Claus Gittinger <cg@exept.de>
parents: 7227
diff changeset
  3206
!Class methodsFor:'private-changes management'!
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3207
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3208
addChangeRecordForChangeCategory:category to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3209
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3210
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3211
    "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
  3212
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3213
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3214
    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
  3215
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3216
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3217
    "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
  3218
    "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
  3219
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3220
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3221
addChangeRecordForClass:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3222
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3223
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3224
    "append a 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
  3225
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3226
    aClass isLoaded ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3227
        aClass basicFileOutDefinitionOn:aStream withNameSpace:true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3228
        aStream nextPutChunkSeparator.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3229
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3230
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3231
    "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
  3232
    "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
  3233
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3234
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3235
addChangeRecordForClassComment:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3236
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3237
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3238
    "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
  3239
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3240
    aClass fileOutCommentOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3241
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3242
    "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
  3243
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3244
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3245
addChangeRecordForClassInstvars:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3246
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3247
5225
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3248
    "append an instvars-record to aStream"
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3249
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  3250
    aClass class fileOutClassInstVarDefinitionOn:aStream withNameSpace:true.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3251
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3252
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3253
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  3254
addChangeRecordForClassRemove:oldClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3255
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3256
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3257
    "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
  3258
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  3259
    aStream nextPutAll:('Smalltalk removeClass:' , oldClass name).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3260
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3261
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3262
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3263
addChangeRecordForClassRename:oldName to:newName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3264
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3265
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3266
    "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
  3267
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3268
    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
  3269
    aStream nextPutChunkSeparator.
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3270
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3271
    "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
  3272
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3273
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3274
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3275
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3276
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3277
    "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
  3278
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3279
    aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:''';
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3280
            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
  3281
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3282
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3283
    "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
  3284
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3285
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3286
addChangeRecordForPrimitiveFunctions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3287
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3288
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3289
    "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
  3290
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3291
    aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:''';
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3292
            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
  3293
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3294
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3295
    "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
  3296
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3297
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3298
addChangeRecordForPrimitiveVariables:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3299
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3300
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3301
    "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
  3302
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3303
    aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:''';
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3304
            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
  3305
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3306
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3307
    "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
  3308
! !
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3309
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3310
!Class methodsFor:'protocol printOut'!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3311
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3312
printOutProtocolOn:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3313
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3314
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3315
    |collectionOfCategories|
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3316
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3317
    self printOutDefinitionOn:aPrintStream.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3318
    aPrintStream cr.
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3319
    collectionOfCategories := self class categories asSortedCollection.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3320
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3321
        aPrintStream nextPutLine:'class protocol'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3322
        aPrintStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3323
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3324
            self class printOutCategoryProtocol:aCategory on:aPrintStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3325
        ]
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3326
    ].
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3327
    collectionOfCategories := self categories asSortedCollection.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3328
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3329
        aPrintStream nextPutLine:'instance protocol'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3330
        aPrintStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3331
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3332
            self printOutCategoryProtocol:aCategory on:aPrintStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3333
        ]
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3334
    ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3335
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3336
    "Modified: / 25.11.1998 / 12:40:38 / cg"
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3337
! !
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3338
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3339
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3340
9815
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3341
canHaveExtensions
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3342
    "return true, if this class allows extensions from other packages.
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3343
     Private classes, namespaces and projectDefinitions dont allow this"
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3344
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3345
    ^ self isPrivate not
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3346
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3347
    "
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3348
     Smalltalk allClasses select:[:each | each canHaveExtensions not]
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3349
    "
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3350
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3351
    "Created: / 30-08-2006 / 15:27:53 / cg"
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3352
!
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3353
8167
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3354
classResources
8185
e09efa26b6f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8167
diff changeset
  3355
    self isPrivate ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3356
        ^ self owningClass classResources
8185
e09efa26b6f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8167
diff changeset
  3357
    ].
9930
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3358
    ^ ResourcePack for:self cached:true.
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3359
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3360
    "Modified: / 18-09-2006 / 20:37:16 / cg"
8167
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3361
!
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3362
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3363
extensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3364
    "return a collection of extension-methods from any package, or empty if there are none."
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3365
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3366
    |extensions classPackage|
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3367
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3368
    classPackage := self package.
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3369
    self instAndClassMethodsDo:[:mthd |
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3370
        mthd package ~= classPackage ifTrue:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3371
            extensions isNil ifTrue:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3372
                extensions := OrderedCollection new.
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3373
            ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3374
            extensions add:mthd
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3375
        ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3376
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3377
    ^ extensions ? #()
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3378
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3379
    "
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3380
     CType extensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3381
     Rectangle extensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3382
     Rectangle hasExtensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3383
    "
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3384
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3385
    "Created: / 12-10-2006 / 18:29:51 / cg"
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3386
    "Modified: / 05-03-2007 / 17:12:04 / cg"
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3387
!
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3388
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3389
extensionsFrom:aPackageID
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3390
    "return the set of extension-methods from the given package."
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3391
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3392
    |extensions|
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3393
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3394
    aPackageID = self package ifTrue:[^ #() ].
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3395
    self instAndClassMethodsDo:[:mthd | 
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3396
        mthd package = aPackageID ifTrue:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3397
            extensions isNil ifTrue:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3398
                extensions := OrderedCollection new.
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3399
            ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3400
            extensions add:mthd
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3401
        ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3402
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3403
    ^ extensions ? #()
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3404
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3405
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3406
     CType extensionsFrom:#'bosch:dapasx'
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3407
     Rectangle extensionsFrom:#'bosch:dapasx/support' 
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3408
     Rectangle extensions
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3409
     Class extensions
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3410
     Class extensionsFrom:#'stx:libboss'
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3411
    "
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3412
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3413
    "Created: / 07-08-2006 / 22:02:15 / fm"
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3414
    "Modified: / 06-03-2007 / 11:54:53 / cg"
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3415
!
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3416
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3417
hasExtensions
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3418
    "return true, if there are methods in the receiver, which belong to
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3419
     a different package (i.e. package of class ~= package of method).
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3420
     Those are class extensions, which must be treated specially when checking classes
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3421
     into the sourceCode repository. (extensions are stored separate)"
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3422
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3423
    |clsPkg defaultPkg|
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3424
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3425
    defaultPkg := Project noProjectID.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3426
    clsPkg := self package.
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3427
    self instAndClassMethodsDo:[:mthd |
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3428
        |mthdPkg|
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3429
        (((mthdPkg := mthd package) ~= clsPkg) and:[ mthdPkg ~= defaultPkg ]) ifTrue:[^ true ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3430
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3431
    ^ false
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3432
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3433
    "
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3434
     Time millisecondsToRun:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3435
        Smalltalk allClasses select:[:each | each hasExtensions]
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3436
     ]. 190 130 260
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3437
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3438
     Dictionary 
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3439
        withAssociations:
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3440
            (Smalltalk allClasses 
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3441
                select:[:each | each hasExtensions]
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3442
                thenCollect:[:each | each -> each extensions])
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3443
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3444
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3445
    "Modified: / 05-03-2007 / 17:06:20 / cg"
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3446
!
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3447
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3448
hasExtensionsFrom:aPackageID
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3449
    "return true, if there are methods in the receiver, which belong to
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3450
     the package with aPackageID (i.e. package of class ~= package of method).
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3451
     Those are class extensions, which must be treated specially when checking classes
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3452
     into the sourceCode repository. (extensions are stored separate)"
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3453
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3454
    |clsPkg|
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3455
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3456
    clsPkg := self package.
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3457
    aPackageID = clsPkg ifTrue:[^ #()].
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3458
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3459
    self instAndClassMethodsDo:[:mthd | 
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3460
        mthd package = aPackageID ifTrue:[ ^ true].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3461
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3462
    ^ false
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3463
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3464
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3465
     Smalltalk allClasses 
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3466
        select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser']
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3467
     Smalltalk allClasses 
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3468
        select:[:each | each hasExtensionsFrom:'stx:libboss']
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3469
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3470
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3471
    "Modified: / 06-03-2007 / 11:55:39 / cg"
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3472
!
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3473
10042
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3474
isBrowserStartable
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3475
    "return true, if this is an application class,
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3476
     which can be started from the browser"
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3477
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3478
    ^ self isVisualStartable or:[self isStartableWithStart or:[ self isStartableWithMain ]]
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3479
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3480
    "Created: / 06-10-2006 / 11:34:28 / cg"
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3481
!
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3482
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3483
isClass
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3484
    "return true, if the receiver is some kind of class
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3485
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3486
     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
  3487
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3488
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3489
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3490
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3491
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3492
     Point isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3493
     1 isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3494
     Behavior new isBehavior
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3495
     Behavior new isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3496
     Class new isBehavior
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3497
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3498
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3499
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3500
8933
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  3501
isJavaScriptClass
8936
e098919f2f79 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8933
diff changeset
  3502
    ^ self class isJavaScriptMetaclass
8933
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  3503
!
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  3504
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3505
isStartableWithMain
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3506
    "return true, if this is an application class,
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3507
     which can be started via #main"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3508
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3509
    ^ self theMetaclass includesSelector:#main
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3510
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3511
    "Created: / 2.11.2001 / 09:37:01 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3512
    "Modified: / 2.11.2001 / 09:48:05 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3513
!
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3514
8756
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3515
isStartableWithStart
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3516
    "return true, if this is an application class,
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3517
     which can be started via #start"
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3518
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3519
    ^ self theMetaclass includesSelector:#start
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3520
!
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3521
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3522
rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3523
    "return a collection of classes which have a nil superclass"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3524
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3525
    |set|
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3526
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3527
    set := IdentitySet new.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3528
    Smalltalk allClassesDo:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3529
        aClass superclass isNil ifTrue:[set add:aClass]
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3530
    ].
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3531
    ^ set asOrderedCollection
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3532
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3533
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3534
     Class rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3535
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3536
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3537
    "Modified: 18.4.1997 / 20:55:34 / cg"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3538
!
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3539
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3540
subclasses
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3541
    "return a collection of the direct subclasses of the receiver"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3542
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3543
    |newColl|
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3544
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3545
    "/ use cached information (avoid class hierarchy search)
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3546
    "/ if possible
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3547
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3548
    SubclassInfo notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3549
        newColl := SubclassInfo at:self ifAbsent:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3550
        newColl notNil ifTrue:[^ newColl asOrderedCollection]
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3551
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3552
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3553
    newColl := OrderedCollection new.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3554
    self subclassesDo:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3555
        newColl add:aClass
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3556
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3557
    SubclassInfo notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3558
        SubclassInfo at:self put:newColl.
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3559
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3560
    ^ newColl
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3561
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3562
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3563
     Class flushSubclassInfo.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3564
     Collection subclasses
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3565
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3566
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3567
    "Modified: 22.1.1997 / 18:43:52 / cg"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3568
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3569
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3570
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3571
    "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
  3572
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3573
     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
  3574
     Autoload. The interface here is for your convenience."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3575
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3576
    ^ 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
  3577
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3578
    "Modified: 21.3.1996 / 16:27:09 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3579
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3580
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3581
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3582
    "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
  3583
     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
  3584
     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
  3585
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3586
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3587
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3588
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3589
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3590
    [cls notNil] whileTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3591
        (cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3592
        cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3593
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3594
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3595
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3596
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3597
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3598
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3599
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3600
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3601
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3602
!Class methodsFor:'renaming'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3603
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3604
makePrivateIn:newOwner
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3605
    "make a private class of newOwner from the receiver;
5612
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3606
     the receiver must be a public class.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3607
     Returns the new private class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3608
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3609
    |sel newClass|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3610
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3611
    self owningClass notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3612
        ^ self
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3613
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3614
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3615
    sel := self definitionSelectorPrivate.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3616
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3617
    newClass := self superclass
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3618
        perform:sel
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3619
        withArguments:(Array
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3620
                        with:(self nameWithoutPrefix asSymbol)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3621
                        with:(self instanceVariableString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3622
                        with:(self classVariableString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3623
                        with:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3624
                        with:newOwner).
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3625
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3626
    "/ copy over methods ...
6023
63f7111fd2f9 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5938
diff changeset
  3627
    ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class.
63f7111fd2f9 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5938
diff changeset
  3628
    ClassBuilder copyInvalidatedMethodsFrom:self for:newClass.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3629
    newClass class recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3630
    newClass recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3631
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3632
    newOwner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3633
    Smalltalk changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3634
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3635
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3636
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3637
3494
23a6cf28b3a6 fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents: 3407
diff changeset
  3638
    "Modified: / 29.5.1998 / 19:03:49 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3639
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3640
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3641
makePublic
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3642
    "make a public class from the receiver.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3643
     The receiver must be a private class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3644
     Returns the new public class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3645
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3646
    ^ self makePublicIn:Smalltalk
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3647
!
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3648
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3649
makePublicIn:newNameSpace
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3650
    "make a public class from the receiver.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3651
     The receiver must be a private class.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3652
     Returns the new public class."
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3653
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3654
    |sel owner baseName newName newClass|
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3655
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3656
    owner := self topOwningClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3657
    owner isNil ifTrue:[^ self].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3658
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3659
    "/ first, create the public class ...
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3660
    sel := self definitionSelector.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3661
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3662
    Class nameSpaceQuerySignal answer:newNameSpace
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3663
    do:[
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3664
        baseName := self nameWithoutPrefix.
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3665
"/        (newNameSpace isNil or:[newNameSpace == Smalltalk]) ifTrue:[
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3666
"/            newName := baseName
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3667
"/        ] ifFalse:[
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3668
"/            newName := newNameSpace name , '::' , baseName
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3669
"/        ].
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3670
        newName := baseName.
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3671
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3672
        newClass := self superclass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3673
            perform:sel
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3674
            withArguments:(Array
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3675
                            with:(newName asSymbol)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3676
                            with:(self instanceVariableString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3677
                            with:(self classVariableString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3678
                            with:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3679
                            with:(owner category)).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3680
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3681
        "/ copy over methods ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3682
        ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3683
        ClassBuilder copyInvalidatedMethodsFrom:self for:newClass.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3684
        newClass class recompileInvalidatedMethods.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3685
        newClass recompileInvalidatedMethods.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3686
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3687
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3688
    owner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3689
    Smalltalk changed:#newClass with:newClass.
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3690
    (newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3691
        newNameSpace changed:#newClass with:newClass.
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3692
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3693
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3694
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3695
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3696
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3697
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3698
    "Created: / 23-06-1997 / 13:28:52 / cg"
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3699
    "Modified: / 04-07-2006 / 16:27:12 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3700
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3701
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3702
renameTo:newName
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3703
    "change the name of the class. This does not write a change record."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3704
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3705
    <resource:#obsolete>
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3706
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3707
    |oldSym newSym|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3708
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3709
    "/ the code below is obsolete - it does not deal with
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3710
    "/ classVariables, private classes and does not
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3711
    "/ recompile other classes in order to care for namespace
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3712
    "/ changes.
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3713
    "/ Please use Smalltalk>>renameClass:to:,
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3714
    "/ which deals with all of that.
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3715
    self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'.
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3716
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3717
    oldSym := name asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3718
    newSym := newName asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3719
    self setName:newSym.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3720
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3721
    Smalltalk at:oldSym put:nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3722
    Smalltalk removeKey:oldSym.             "26.jun 93"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3723
    Smalltalk at:newSym put:self.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3724
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3725
    "Created: / 1.4.1997 / 15:27:53 / stefan"
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3726
    "Modified: / 31.7.1998 / 15:21:34 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3727
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3728
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3729
!Class methodsFor:'signature checking'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3730
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3731
classinstSizeFromSignature:aSignature
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3732
    "for checking class compatibility: return some number based on
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3733
     the classinstSize from a signature key (not always the real classinstsize)."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3734
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3735
    ^ (aSignature bitShift:-7) bitAnd:7
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3736
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3737
    "Created: 1.4.1997 / 15:23:01 / stefan"
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3738
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3739
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3740
instNameKeyFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3741
    "for checking class compatibility: return a number based on the
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3742
     names and order of the instance variables from a signature key."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3743
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3744
    ^ (aSignature bitShift:-14) bitAnd:16rFFFF
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3745
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3746
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3747
     Point instNameKeyFromSignature:Point signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3748
     Association instNameKeyFromSignature:Association signature.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3749
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3750
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3751
    "Created: 1.4.1997 / 15:23:07 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3752
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3753
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3754
instSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3755
    "for checking class compatibility: return the some number based on
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3756
     the instSize from a signature key (not always the real instSize)."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3757
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3758
    ^ aSignature bitAnd:16r7F
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3759
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3760
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3761
     Class instSizeFromSignature:Point signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3762
     Class instSizeFromSignature:Association signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3763
     Class instSizeFromSignature:Dictionary signature.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3764
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3765
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3766
    "Created: 1.4.1997 / 15:23:15 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3767
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3768
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3769
instTypeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3770
    "for checking class compatibility: return some number based on
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3771
     the instType (i.e. variableBytes/Pointers etc.) from a signature key."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3772
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3773
    ^ (aSignature bitShift:-10) bitAnd:(Class maskIndexType)
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3774
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3775
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3776
     Class instTypeFromSignature:Object signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3777
     Class instTypeFromSignature:Array signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3778
     Class instTypeFromSignature:String signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3779
     Class instTypeFromSignature:OrderedCollection signature.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3780
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3781
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3782
    "Created: 1.4.1997 / 15:23:20 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3783
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3784
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3785
signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3786
    "return a signature number - this number is useful for a quick
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3787
     check for changed classes, and is done in the binary-object loader,
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3788
     and the dynamic class loader.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3789
     Do NOT change the algorithm here - others may depend on it.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3790
     Also, the algorithm may change - so never interpret the returned value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3791
     (if at all, use the access #XXXFromSignature: methods)"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3792
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3793
    |value   "{ Class: SmallInteger }"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3794
     nameKey "{ Class: SmallInteger }" |
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3795
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3796
    signature notNil ifTrue:[^ signature].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3797
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3798
    value := self flags bitAnd:(Class maskIndexType).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3799
    value := (value bitShift:3) + ((self class instSize - Class instSize) bitAnd:7).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3800
    value := (value bitShift:7) + (self instSize bitAnd:16r7F).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3801
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3802
    nameKey := 0.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3803
    self allInstVarNames do:[:name |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3804
        nameKey := nameKey bitShift:1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3805
        (nameKey bitAnd:16r10000) ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3806
            nameKey := nameKey bitXor:1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3807
            nameKey := nameKey bitAnd:16rFFFF.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3808
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3809
        nameKey := (nameKey + (name at:1) codePoint) bitAnd:16rFFFF.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3810
    ].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3811
    value := value + (nameKey bitShift:14).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3812
    signature := value.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3813
    ^ value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3814
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3815
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3816
     Array signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3817
     ByteArray signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3818
     View signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3819
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3820
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3821
    "Created: 1.4.1997 / 15:23:24 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3822
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3823
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
  3824
!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
  3825
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3826
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
  3827
    "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
  3828
     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
  3829
     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
  3830
     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
  3831
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3832
    |owner info c|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3833
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3834
    (owner := self owningClass) notNil ifTrue:[^ owner binaryRevision].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3835
    revision notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3836
        c := revision first.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3837
        c == $$ ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3838
            info := Class revisionInfoFromString:revision.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3839
            info isNil ifTrue:[^ '0'].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3840
            ^ info at:#revision ifAbsent:'0'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3841
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3842
        c isDigit ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3843
            ^ '0'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3844
        ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3845
    ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3846
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
  3847
    ^ 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
  3848
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3849
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3850
     Object binaryRevision
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3851
     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
  3852
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3853
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3854
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3855
     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
  3856
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3857
     |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
  3858
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3859
     classes := Smalltalk allClasses
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3860
                    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
  3861
     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
  3862
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3863
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3864
    "Created: 7.12.1995 / 10:58:47 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3865
    "Modified: 1.4.1997 / 23:33:01 / stefan"
2909
b4df6be2ed52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2906
diff changeset
  3866
    "Modified: 9.9.1997 / 12:05:41 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3867
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3868
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3869
currentSourceStream
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3870
    "return an open stream on the current source of the receiver"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3871
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3872
    |theWriteStream theCurrentSource|
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3873
8222
f2c454a9a038 replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents: 8212
diff changeset
  3874
    theWriteStream := String writeStream.
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3875
    Method flushSourceStreamCache.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3876
    self fileOutOn:theWriteStream withTimeStamp:false.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3877
    theCurrentSource := theWriteStream contents asString.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3878
    theWriteStream close.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3879
    ^ theCurrentSource
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3880
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3881
    "Modified: 15.10.1996 / 18:59:40 / cg"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3882
    "Modified: 1.4.1997 / 14:33:12 / stefan"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3883
!
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3884
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3885
localSourceStreamFor:sourceFile
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3886
    "return an open stream on a local sourcefile, nil if that is not available"
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3887
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3888
    |fileName info module dir fn package packageDir zar entry|
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3889
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3890
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3891
    "/ old: look in 'source/<filename>'
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3892
    "/ this is still kept in order to find user-private
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3893
    "/ classes in her currentDirectory.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3894
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3895
    fileName := Smalltalk getSourceFileName:sourceFile.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3896
    fileName notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3897
        ^ fileName asFilename readStreamOrNil.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3898
    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3899
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3900
    (package := self package) notNil ifTrue:[
10009
72c87816423e fix typo
Stefan Vogel <sv@exept.de>
parents: 9959
diff changeset
  3901
        "/ newest scheme ...
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3902
        packageDir := package copyReplaceAll:$: with:$/.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3903
        packageDir := Smalltalk getPackageFileName:packageDir.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3904
        packageDir notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3905
            "/ present there ?
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3906
            packageDir := packageDir asFilename.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3907
            (fn := packageDir construct:sourceFile) exists ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3908
                ^ fn readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3909
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3910
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3911
            "/ a source subdirectory ?
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3912
            fn := (packageDir construct:'source') construct:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3913
            fn exists ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3914
                ^ fn readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3915
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3916
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3917
            "/ a zip-file ?
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3918
            fn := (packageDir construct:'source.zip').
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3919
            fn exists ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3920
                zar := ZipArchive oldFileNamed:fn.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3921
                zar notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3922
                    entry := zar extract:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3923
                    entry notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3924
                        ^ entry asString readStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3925
                    ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3926
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3927
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3928
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3929
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3930
        "/ will vanish ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3931
        (package includes:$:) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3932
            package := package asString copyReplaceAll:$: with:$/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3933
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3934
            package := 'stx/' , package
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3935
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3936
        fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3937
        fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3938
            ^ fileName asFilename readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3939
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3940
        (package startsWith:'stx/') ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3941
            fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3942
            fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3943
                ^ fileName asFilename readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3944
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3945
        ]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3946
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3947
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3948
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3949
    "/ new: look in 'source/<module>/<package>/<filename>
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3950
    "/ this makes the symbolic links to (or copy of) the source files
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3951
    "/ obsolete.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3952
    info := self packageSourceCodeInfo.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3953
    info notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3954
        module := info at:#module ifAbsent:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3955
        module notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3956
            dir := info at:#directory ifAbsent:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3957
            dir notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3958
                fn := (module asFilename construct:dir) construct:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3959
                fileName := Smalltalk getSourceFileName:(fn name).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3960
                fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3961
                    ^ fileName asFilename readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3962
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3963
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3964
                "/ brand new: look for source/<module>/package.zip
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3965
                "/ containing an entry for <filename>
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3966
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3967
                fn := (module asFilename construct:dir) withSuffix:'zip'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3968
                fileName := Smalltalk getSourceFileName:(fn name).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3969
                fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3970
                    zar := ZipArchive oldFileNamed:fileName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3971
                    zar notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3972
                        entry := zar extract:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3973
                        entry notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3974
                            ^ entry asString readStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3975
                        ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3976
                    ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3977
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3978
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3979
                "/ and also in source/source.zip ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3980
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3981
                fileName := Smalltalk getSourceFileName:'source.zip'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3982
                fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3983
                    zar := ZipArchive oldFileNamed:fileName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3984
                    zar notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3985
                        entry := zar extract:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3986
                        entry notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3987
                            ^ entry asString readStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3988
                        ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3989
                    ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3990
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3991
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3992
        ]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3993
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3994
    ^ nil
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3995
3657
9e9fe2dd4c30 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  3996
    "Modified: / 18.7.1998 / 22:53:19 / cg"
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3997
!
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3998
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  3999
nameOfVersionMethod
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4000
    ^ #version
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4001
!
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4002
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
  4003
packageSourceCodeInfo
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4004
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4005
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
  4006
    "return the sourceCodeInfo, which defines the module and the subdirectory
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4007
     in which the receiver class was built.
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
  4008
     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
  4009
     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
  4010
     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
  4011
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4012
     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
  4013
     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
  4014
     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
  4015
     (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
  4016
     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
  4017
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4018
     By convention, this info is encoded in the classes package
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4019
     string (which is given as argument to stc) as the last word in parenthesis.
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
  4020
     The info consists of 1 to 3 subcomponents, separated by colons.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4021
     The first defines the classes module (i.e. some application identifier),
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4022
     the second defines the subdirectory within that module, the third
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4023
     defines the name of the class library.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4024
     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
  4025
     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
  4026
     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
  4027
     (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
  4028
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4029
     For example:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4030
        '....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4031
        '....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4032
        '....(stx:foo:libbfoo)'                  -> module: stx directory: foo library: libfoo
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4033
        '....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4034
        '....(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
  4035
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4036
     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
  4037
     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
  4038
     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
  4039
     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
  4040
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4041
     Caveat:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4042
        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
  4043
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4044
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4045
    |owner sourceInfo packageString idx1 idx2
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4046
     moduleString directoryString libraryString components component1 component2 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
  4047
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4048
    (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4049
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
  4050
    package isNil ifTrue:[^ nil].
8085
b1ce10168352 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8075
diff changeset
  4051
    package == (Project noProjectID) 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
  4052
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4053
    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
  4054
    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
  4055
    idx1 ~~ 0 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4056
        idx2 := packageString indexOf:$) startingAt:idx1+1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4057
        idx2 ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4058
            sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4059
        ]
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4060
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4061
        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
  4062
    ].
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4063
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
  4064
    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
  4065
    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
  4066
    components size == 0 ifTrue:[
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4067
"/        moduleString := 'stx'.
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4068
"/        directoryString := libraryString := ''.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4069
        ^ nil
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4070
    ].
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4071
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4072
    component1 := components at:1.
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4073
    components size == 1 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4074
        "/ a single name given - the module becomes 'stx' or
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4075
        "/ the very first directory component (if such a module exists).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4076
        "/ If the component includes slashes, its the directory
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4077
        "/ otherwise the library.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4078
        "/
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  4079
        dirComponents := Filename components:component1.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4080
        (dirComponents size > 1
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4081
        and:[(mgr := self sourceCodeManager) notNil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4082
        and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4083
            moduleString := dirComponents first.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4084
            directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4085
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4086
            "/ non-existing; assume directory under the stx package.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4087
            moduleString := 'stx'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4088
            (component1 startsWith:'stx/') ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4089
                component1 := component1 copyFrom:5
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4090
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4091
            directoryString := libraryString := component1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4092
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4093
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4094
        (libraryString includes:$/) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4095
            libraryString := libraryString asFilename baseName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4096
        ]
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
  4097
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4098
        component2 := components at:2.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4099
        components size == 2 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4100
            "/ two components - assume its the module and the directory;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4101
            "/ the library is assumed to be named after the directory
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4102
            "/ except, if slashes are in the name; then the libraryname
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4103
            "/ is the last component.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4104
            "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4105
            moduleString := component1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4106
            directoryString := libraryString := component2.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4107
            (libraryString includes:$/) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4108
                libraryString := libraryString asFilename baseName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4109
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4110
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4111
            "/ all components given
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4112
            moduleString := component1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4113
            directoryString := component2.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4114
            libraryString := components at:3.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4115
        ]
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
  4116
    ].
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4117
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
  4118
    libraryString isEmpty ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4119
        directoryString notEmpty ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4120
            libraryString := directoryString asFilename baseName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4121
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4122
        libraryString isEmpty ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4123
            "/ lets extract the library from the liblist file ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4124
            libraryString := Smalltalk libraryFileNameOfClass:self.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4125
            libraryString isNil ifTrue:[^ nil].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4126
        ]
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
  4127
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4128
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4129
    moduleString isEmpty ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4130
        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
  4131
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4132
    directoryString isEmpty ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4133
        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
  4134
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4135
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4136
    ^ IdentityDictionary
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4137
        with:(#module->moduleString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4138
        with:(#directory->directoryString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4139
        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
  4140
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4141
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4142
     Object packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4143
     View packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4144
     Model packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4145
     BinaryObjectStorage packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4146
     MemoryMonitor packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4147
     ClockView packageSourceCodeInfo
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
  4148
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4149
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4150
    "Created: 4.11.1995 / 20:36:53 / cg"
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4151
    "Modified: 19.9.1997 / 10:42:25 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4152
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4153
8770
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4154
projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4155
    "return my projects directory - thats where the sources, binaries, classLib, 
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4156
     resources etc. are typically found."
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4157
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4158
    ^ Smalltalk projectDirectoryForClass:self
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4159
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4160
    "
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4161
     Object projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4162
     View projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4163
     ApplicationModel projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4164
    "
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4165
!
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4166
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4167
resourceDirectory
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4168
    "return the directory where my resource file is supposed to live.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4169
     Here, take the package and assume that a directory named 'resources' exists
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4170
     in my package directory.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4171
     Return nil, if no such directory exists."
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4172
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4173
    ^ Smalltalk resourceDirectoryForPackage:(self package)
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4174
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4175
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4176
     Object resourceDirectory
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4177
     View resourceDirectory
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4178
     ApplicationModel resourceDirectory
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4179
    "
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4180
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4181
    "Modified: / 19-10-2006 / 23:08:37 / cg"
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4182
!
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4183
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4184
resourcePackName
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4185
    "return the name which is used as the fileNameBase of my resource file.
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4186
     Notice, that this will undergo the same name translation process as
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4187
     done with class-source file names. (see ResourcePack).
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4188
     The default here is the classes name - this can be redefined in classes
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4189
     which want to use another classes resources (NewLauncher -> Launcher)."
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4190
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4191
    ^ self name
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4192
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4193
    "Created: / 29-01-1998 / 22:20:12 / cg"
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4194
    "Modified: / 19-10-2006 / 23:11:57 / cg"
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4195
!
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4196
8267
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4197
resourcePackage
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4198
    "return the package from where my resources are loaded.
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4199
     By default, that is the classes package."
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4200
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4201
    ^ self package
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4202
!
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4203
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
  4204
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
  4205
    "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
  4206
     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
  4207
     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
  4208
     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
  4209
     the old revision, while logically, the class has the new (checked-in) revision.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4210
     To check if a source corresponds to a compiled binary, compare this
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
  4211
     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
  4212
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4213
    |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
  4214
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4215
    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
  4216
    info notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4217
        ^ 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
  4218
    ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4219
    ^ 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
  4220
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4221
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4222
     Object 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
  4223
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4224
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4225
    "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
  4226
    "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
  4227
    "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
  4228
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4229
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4230
revisionDateString
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4231
    "return the revision-Date of the class as a string.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4232
     This is extracted from the version string."
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4233
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4234
    |info|
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4235
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4236
    info := self revisionInfo.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4237
    info notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4238
        ^ info at:#date ifAbsent:'??/??/??'
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4239
    ].
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4240
    ^ '??/??/??'
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4241
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4242
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4243
     Object revisionDateString
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4244
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4245
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4246
    "Created: 23.4.1997 / 12:29:21 / cg"
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4247
!
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4248
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
  4249
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
  4250
    "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
  4251
     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
  4252
     The revisionInfo contains all or a subset of:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4253
        #binaryRevision - the revision upon which the binary of this class is based
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4254
        #revision       - the revision upon which the class is based logically
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4255
                          (different, if a changed class was checked in, but not yet recompiled)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4256
        #user           - the user who checked in the logical revision
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4257
        #date           - the date when the logical revision was checked in
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4258
        #time           - the time when the logical revision was checked in
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4259
        #fileName       - the classes source file name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4260
        #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
  4261
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4262
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4263
    |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
  4264
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
    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
  4266
    vsnString notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4267
        mgr := self sourceCodeManager.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4268
        mgr notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4269
            info := mgr revisionInfoFromString:vsnString
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4270
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4271
            info := Class revisionInfoFromString:vsnString.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4272
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4273
        info notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4274
            info at:#binaryRevision put:self binaryRevision.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4275
        ]
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
  4276
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4277
    ^ 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
  4278
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
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4280
     Object revisionString
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4281
     Object revisionInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4282
     Image revisionInfo
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
  4283
    "
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
    "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
  4286
    "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
  4287
    "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
  4288
!
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
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
revisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4291
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4292
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
  4293
    "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
  4294
     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
  4295
     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
  4296
     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
  4297
     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
  4298
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4299
    |owner cls meta m src val|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4300
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4301
    (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
  4302
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
    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
  4304
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4305
    meta := self theMetaclass.
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4306
    cls := self theNonMetaclass.
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
  4307
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4308
    m := meta compiledMethodAt:(self nameOfVersionMethod).
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
  4309
    m isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4310
        "/ no - do NEVER care for a version method on the instance side
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4311
        "/ m := cls compiledMethodAt:(self nameOfVersionMethod).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4312
        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
  4313
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4314
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4315
    m isExecutable ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4316
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4317
        "/ if its a method returning the string,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4318
        "/ thats the returned value
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4319
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4320
        val := cls perform:(self nameOfVersionMethod).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4321
        val isString ifTrue:[^ val].
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4322
    ].
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
  4323
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4324
    "/
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
    "/ 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
  4326
    "/ 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
  4327
    "/ 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
  4328
    "/ 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
  4329
    "/ 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
  4330
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4331
    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
  4332
    src isNil ifTrue:[^ nil].
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4333
    ^ 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
  4334
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
    "
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
     Smalltalk allClassesDo:[:cls |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4337
        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
  4338
     ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4339
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4340
     Number revisionString
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4341
     FileDirectory revisionString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4342
     Metaclass revisionString
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4343
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4344
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4345
    "Created: / 29.10.1995 / 19:28:03 / cg"
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4346
    "Modified: / 1.4.1997 / 23:37:25 / stefan"
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4347
    "Modified: / 7.2.2001 / 18:03:39 / ps"
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4348
    "Modified: / 5.11.2001 / 16:35: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
  4349
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4350
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4351
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
  4352
    "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
  4353
     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
  4354
     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
  4355
     (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
  4356
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4357
    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
  4358
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4359
    "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
  4360
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4361
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4362
setPackageFromRevision
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4363
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4364
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4365
    "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
  4366
     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
  4367
     (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
  4368
      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
  4369
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4370
    |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
  4371
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4372
    self owningClass notNil ifTrue:[^ self].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4373
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4374
    mgr := self sourceCodeManager.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4375
    mgr notNil ifTrue:[
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4376
        info := mgr sourceInfoOfClass:self.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4377
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4378
        info notNil ifTrue:[
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4379
            mod := info at:#module ifAbsent:nil.    "/ stx, aeg, <your-organization>
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4380
            dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ...
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4381
            lib := info at:#library ifAbsent:dir.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4382
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4383
            p := ''.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4384
            mod notNil ifTrue:[
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4385
"/            mod ~= 'stx' ifTrue:[
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4386
                    p := p , mod
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4387
"/            ]
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4388
            ].
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4389
            dir notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4390
                p notEmpty ifTrue:[p := p , ':'].
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4391
                p := p , dir.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4392
            ] ifFalse:[
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4393
                lib notNil ifTrue:[
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4394
                    p notEmpty ifTrue:[p := p , ':'].
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4395
                    p := p , lib.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4396
                ].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4397
            ].
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4398
            (p notEmpty and:[p ~= package]) ifTrue:[
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4399
"/            package notNil ifTrue:[
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4400
"/                (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR.
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4401
"/            ].
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4402
                package := p.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4403
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4404
                self methodDictionary do:[:aMethod |
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4405
                    aMethod package isNil ifTrue:[
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4406
                        aMethod setPackage:p
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4407
                    ]
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4408
                ]
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4409
            ].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4410
        ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4411
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4412
    ^ self
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4413
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4414
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4415
     MemoryMonitor autoload.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4416
     MemoryMonitor setPackageFromRevision
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4417
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4418
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4419
    "Modified: / 12-06-1996 / 11:49:31 / stefan"
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4420
    "Modified: / 12-09-2006 / 14:15:47 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4421
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4422
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  4423
sourceFileSuffix
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  4424
    ^ self class sourceFileSuffix
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  4425
!
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  4426
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
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
  4428
    "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
  4429
8149
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4430
    |owner source stream encoding|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4431
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4432
    (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
  4433
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
    classFilename notNil ifTrue:[
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4435
        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
  4436
    ] ifFalse:[
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4437
        source := (Smalltalk fileNameForClass:self) , '.st'
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4438
    ].
8149
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4439
    stream := self sourceStreamFor:source.
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4440
    stream notNil ifTrue:[
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4441
        "/ see if its utf8 encoded...
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4442
        encoding := CharacterEncoder guessEncodingOfStream:stream.
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4443
        (encoding notNil and:[encoding ~~ #'iso8859-1' and:[encoding ~~ #'ascii']]) ifTrue:[
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4444
            stream := EncodedStream stream:stream encoder:(CharacterEncoder encoderFor:encoding).
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4445
        ].
8149
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4446
    ].
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4447
    ^ stream.
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4448
!
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4449
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4450
sourceStreamFor:source
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4451
    "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
  4452
6703
ffea6ebb676d Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 6701
diff changeset
  4453
    |owner aStream mgr validated guessedFileName sep mod dir|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4454
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4455
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4456
    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
  4457
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
    "/
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4459
    "/ if there is no SourceCodeManager,
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4460
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4461
    "/ 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
  4462
    "/
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4463
    ((mgr := self sourceCodeManager) isNil
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4464
    or:[TryLocalSourceFirst == true]) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4465
        aStream := self localSourceStreamFor:source.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4466
    ].
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
    aStream isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4469
        "/ mhmh - still no source file.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4470
        "/ If there is a SourceCodeManager, ask it to aquire the
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4471
        "/ the source for my class, and return an open stream on it.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4472
        "/ if that one does not know about the source, look in
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4473
        "/ standard places
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4474
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4475
        mgr notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4476
            classFilename ~= source ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4477
                sep := self package indexOfAny:'/\:'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4478
                sep ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4479
                    mod := package copyTo:sep - 1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4480
                    dir := package copyFrom:sep + 1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4481
                    aStream := mgr streamForClass:nil fileName:source revision:nil directory:dir module:mod cache:true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4482
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4483
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4484
            aStream isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4485
                classFilename isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4486
                    guessedFileName := (Smalltalk fileNameForClass:self) , '.st'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4487
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4488
                source asFilename baseName = classFilename asFilename baseName ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4489
                    aStream := mgr getSourceStreamFor:self.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4490
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4491
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4492
            aStream notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4493
                (self validateSourceStream:aStream) ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4494
                    ('Class [info]: repositories source for `'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4495
                     , (self theNonMetaclass name)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4496
                     , ''' is invalid.') infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4497
                    aStream close.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4498
                    aStream := nil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4499
                ] ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4500
                    validated := true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4501
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4502
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4503
        ]
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4504
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4505
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4506
    aStream isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4507
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4508
        "/ hard case - there is no source file for this class
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4509
        "/ (in the source-dir-path).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4510
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4511
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4512
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4513
        "/ look if my binary is from a dynamically loaded module,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4514
        "/ and, if so, look in the modules directory for the
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4515
        "/ source file.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4516
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4517
        ObjectFileLoader notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4518
            ObjectFileLoader loadedObjectHandlesDo:[:h |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4519
                |f classes|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4520
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4521
                aStream isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4522
                    (classes := h classes) size > 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4523
                        (classes includes:self) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4524
                            f := h pathName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4525
                            f := f asFilename directory.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4526
                            f := f construct:source.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4527
                            f exists ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4528
                                aStream := f readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4529
                            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4530
                        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4531
                    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4532
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4533
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4534
        ].
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4535
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4536
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4537
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4538
    "/ try along sourcePath
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4539
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4540
    aStream isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4541
        aStream := self localSourceStreamFor:source.
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4542
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4543
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4544
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4545
    "/ final chance: try current directory
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4546
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4547
    aStream isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4548
        aStream := source asFilename readStreamOrNil.
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
  4549
    ].
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
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4551
    (aStream notNil and:[validated not]) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4552
        (self validateSourceStream:aStream) ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4553
            (Smalltalk releaseIdentification = 'ST/X_free_demo_vsn') ifTrue:[
3401
da5821d3e57e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
  4554
"/                ('Class [info]: source for ''' , self name , ''' is not available in the demo version.') infoPrintCR
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4555
            ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4556
                ('Class [warning]: source for ''' , self name , ''' is invalid or stripped. Take care.') errorPrintCR
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4557
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4558
        ].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4559
    ].
4744
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4560
    (aStream notNil and:[aStream isFileStream]) ifTrue:[
9610
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  4561
"/        guessedFileName notNil ifTrue:[
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  4562
"/            self setClassFilename:(aStream pathName asFilename baseName).
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  4563
"/        ]
4744
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4564
    ].
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
  4565
    ^ 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
  4566
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4567
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4568
     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
  4569
     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
  4570
     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
  4571
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4572
3391
e012d2965887 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3390
diff changeset
  4573
    "Created: / 10.11.1995 / 21:05:13 / cg"
e012d2965887 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3390
diff changeset
  4574
    "Modified: / 22.4.1998 / 19:20:50 / ca"
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4575
    "Modified: / 5.11.2001 / 16:36:30 / 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
  4576
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4577
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4578
updateVersionMethodFor:newRevisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4579
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4580
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
  4581
    "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
  4582
     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
  4583
4667
2b51bafd8243 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4647
diff changeset
  4584
    |cls mthd "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
  4585
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4586
    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
  4587
    self isMeta ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4588
        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
  4589
    ].
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4590
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4591
"/    m := cls compiledMethodAt:(self nameOfVersionMethod).
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
  4592
"/    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
  4593
"/    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
  4594
"/    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
  4595
"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4596
"/    (mgr := self sourceCodeManager) isNil ifTrue:[^ false].
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4597
"/    newString := mgr updatedRevisionStringOf:cls forRevision:newRevision with:vs.
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
  4598
"/    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
  4599
8838
81ee56a49ac3 Rename #xxxRedefinitionSignal to #xxxRedefinitionNotification.
Stefan Vogel <sv@exept.de>
parents: 8770
diff changeset
  4600
    Class methodRedefinitionNotification answer:#keep do:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4601
        Class withoutUpdatingChangesDo:[
9741
052e9026f42a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9724
diff changeset
  4602
            mthd := Compiler compile:
052e9026f42a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9724
diff changeset
  4603
(self nameOfVersionMethod) , '
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
  4604
    ^ ''' , 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
  4605
'
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4606
                     forClass:cls
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4607
                     inCategory:#documentation
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4608
                     notifying:nil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4609
                     install:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4610
                     skipIfSame:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4611
                     silent:true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4612
            mthd notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4613
                mthd setPackage:self package
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4614
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4615
        ]
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
  4616
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4617
"/ ('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
  4618
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4619
    ^ 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
  4620
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4621
    "Created: 7.12.1995 / 20:42:22 / cg"
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4622
    "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
  4623
!
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4624
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4625
validateSourceStream:aStream
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4626
    "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
  4627
     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
  4628
     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
  4629
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4630
    |cls meta cannotCheckReason versionMethod info
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4631
     versionFromCode versionFromSource oldPos pos src rev
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4632
     versionMethodsName|
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4633
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4634
    meta := self theMetaclass.
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4635
    cls := self theNonMetaclass.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4636
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4637
    cannotCheckReason := nil.
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4638
    versionMethodsName := self nameOfVersionMethod.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4639
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4640
    versionMethod := meta compiledMethodAt:versionMethodsName.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4641
    (versionMethod isNil
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4642
    or:[versionMethod isExecutable not]) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4643
        versionMethod := cls compiledMethodAt:versionMethodsName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4644
        (versionMethod isNil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4645
        or:[versionMethod isExecutable not]) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4646
            cannotCheckReason := 'no valid version method'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4647
        ]
2544
c3a2791de289 care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
  4648
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4649
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4650
        "/ if its a method returning the string,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4651
        "/ thats the returned value
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4652
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4653
        versionFromCode := cls perform:versionMethodsName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4654
        versionFromCode isString ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4655
            cannotCheckReason := 'version method does not return a string'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4656
        ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4657
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4658
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4659
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4660
    "/ 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
  4661
    "/ 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
  4662
    "/ 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
  4663
    "/ 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
  4664
    "/ for the source ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4665
    "/
1942
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4666
    versionMethod notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4667
        pos := versionMethod sourcePosition.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4668
        pos isInteger ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4669
            "/ mhmh - either no version method,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4670
            "/ or updated due to a checkin.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4671
            "/ in any case, this should be a good source.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4672
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4673
            ^ true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4674
            "/ cannotCheckReason := 'no source position for version-method'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4675
        ]
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4676
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4677
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4678
    cannotCheckReason notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4679
        ('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4680
        'Class [info]: cannot validate source; trusting source' infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4681
        ^ true
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4682
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4683
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4684
    oldPos := aStream position.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4685
    Stream positionErrorSignal handle:[:ex |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4686
        'Class [info]: position error when accessing source' infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4687
        ^ false
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4688
    ] do:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4689
        aStream position1Based:pos.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4690
    ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4691
    src := aStream nextChunk.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4692
    aStream position:oldPos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4693
9063
953b305e35d6 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  4694
    (src isEmptyOrNil) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4695
        'Class [info]: empty source for version-method' infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4696
        ^ false
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4697
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4698
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4699
    versionFromSource := Class revisionStringFromSource:src.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4700
    versionFromSource = versionFromCode ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4701
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4702
    versionFromSource isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4703
        'Class [info]: version-from source is nil' infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4704
        ^ false
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4705
    ].
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  4706
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4707
    "/ mhmh - check my binary version ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4708
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4709
    info := Class revisionInfoFromString:versionFromSource.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4710
    info notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4711
        rev := info at:#revision.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4712
        rev = self binaryRevision ifTrue:[^ true].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4713
    ].
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4714
    'Class [info]: source-version is different from binaryRevision' infoPrintCR.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4715
    ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4716
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4717
    "Modified: / 5.11.2001 / 16:36:54 / 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
  4718
! !
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4719
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4720
!Class methodsFor:'special accessing'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4721
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4722
setName:aString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4723
    "set the classes name - be careful, it will be still
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4724
     in the Smalltalk dictionary - under another key.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4725
     This is NOT for general use - see renameTo:"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4726
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4727
    environment := nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4728
    name := aString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4729
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4730
    "Created: 1.4.1997 / 15:46:01 / stefan"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4731
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4732
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4733
!Class::ClassAttributes methodsFor:'accessing'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4734
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4735
primitiveDefinitions
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4736
    ^ primitiveDefinitions
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4737
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4738
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4739
primitiveDefinitions:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4740
    primitiveDefinitions := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4741
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4742
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4743
primitiveFunctions
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4744
    ^ primitiveFunctions
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4745
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4746
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4747
primitiveFunctions:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4748
    primitiveFunctions := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4749
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4750
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4751
primitiveVariables
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4752
    ^ primitiveVariables
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4753
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4754
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4755
primitiveVariables:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4756
    primitiveVariables := something.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4757
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4758
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4759
sharedPools
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4760
    ^ sharedPools
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4761
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4762
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4763
sharedPools:something
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4764
    sharedPools := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4765
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4766
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4767
!Class::ClassAttributes methodsFor:'conversion'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4768
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4769
fromSTCPrimitiveArray:anArray
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4770
    "for now, the stc compiler generates a 3- or 4-element primitive spec array
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4771
     (it does not know anything about the ClassAttributes class).
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4772
     This method is invoked to convert."
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4773
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4774
    primitiveDefinitions := anArray at:1.
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4775
    primitiveVariables := anArray at:2.
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4776
    primitiveFunctions := anArray at:3.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4777
    anArray size > 3 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4778
        sharedPools := anArray at:4.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4779
    ].
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4780
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4781
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4782
!Class::SimulatedClassPool class methodsFor:'documentation'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4783
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4784
documentation
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4785
"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4786
    in contrast to other smalltalks, ST/X does not keep the classVariables
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4787
    in a dictionary; instead, classVariables are stored as special globals,
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4788
    with the className as prefix (colon-separated).
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4789
    The reason is that stc-compiled code should be allowed to access classVars
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4790
    in a similar fashion to globals.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4791
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4792
    Whenever a classes classPool is requested, an instance of myself is
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4793
    created, which forwards at: and at:put: messages to the original class.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4794
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4795
    This is an additional goody class; therefore:
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4796
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4797
    THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4798
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4799
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4800
    ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4801
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4802
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4803
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4804
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4805
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4806
    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4807
    SUCH DAMAGE.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4808
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4809
    [author:]
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4810
        Claus Gittinger
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4811
"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4812
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4813
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4814
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4815
!Class::SimulatedClassPool methodsFor:'accessing'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4816
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4817
associationAt:aName
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4818
    "simulate an association"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4819
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4820
    ^ SimulatedVariableBinding key:aName value:(class classVarAt:aName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4821
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4822
    "Modified: / 4.2.2000 / 00:27:40 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4823
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4824
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4825
associationAt:aName ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4826
    "simulate an association"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4827
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4828
    |internalName cls|
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4829
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4830
    cls := class theNonMetaclass. 
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4831
    internalName := (cls name , ':' , aName) asSymbol.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4832
    ^ SimulatedVariableBinding key:internalName value:(cls classVarAt:aName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4833
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4834
    "Created: / 3.2.2000 / 23:30:07 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4835
    "Modified: / 4.2.2000 / 01:58:56 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4836
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4837
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4838
associationsDo:aBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4839
    "evaluate aBlock for all of my simulated classVarName->value associations"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4840
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4841
    class classVarNames do:[:eachName |
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4842
        aBlock value:(self associationAt:eachName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4843
    ].
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4844
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4845
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4846
at:aKey
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4847
    ^ class classVarAt:aKey
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4848
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4849
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4850
at:aKey ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4851
    ^ class classVarAt:aKey ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4852
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4853
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4854
at:aKey put:something
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4855
    ^ class classVarAt:aKey put:something
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4856
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4857
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4858
keys
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4859
    ^ class classVarNames collect:[:nm | nm asSymbol]
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4860
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4861
    "
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4862
     Button classPool keys 
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4863
     Button classPool at:#ReturnForm
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4864
    "
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4865
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4866
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4867
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4868
keysAndValuesDo:aBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4869
    "evaluate aBlock for all of my simulated classVarName->value associations"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4870
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4871
    class classVarNames do:[:eachName |
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4872
        aBlock value:eachName value:(class classVarAt:eachName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4873
    ].
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4874
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4875
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4876
!Class::SimulatedClassPool methodsFor:'accessing-private'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4877
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4878
setClass:aClass
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4879
    class := aClass
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4880
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4881
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4882
!Class::SimulatedClassPool::SimulatedVariableBinding methodsFor:'queries'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4883
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4884
isVariableBinding
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4885
     ^ true
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4886
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4887
    "Created: / 4.2.2000 / 00:27:20 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4888
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  4889
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4890
!Class class methodsFor:'documentation'!
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4891
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4892
version
11261
e8dcdce0b2ae changed #classMenuCompareTwoRepositoryVersions
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  4893
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.532 2008-10-21 22:20:59 cg Exp $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  4894
! !