Class.st
author Claus Gittinger <cg@exept.de>
Thu, 04 Mar 2004 21:01:41 +0100
changeset 8075 819735e0ca47
parent 8072 e7542f2dbb9c
child 8085 b1ce10168352
permissions -rw-r--r--
*** empty log message ***
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
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
     3
	       All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
5340
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
    13
"{ Package: 'stx:libbasic' }"
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
    14
719
c557a530f971 dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
    15
ClassDescription subclass:#Class
5849
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
    16
	instanceVariableNames:'name category classvars comment subclasses classFilename package
7371
e6fccc3b935c kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents: 7369
diff changeset
    17
		revision environment signature attributes'
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
    18
	classVariableNames:'DefaultCategoryForSTV DefaultCategoryForVAGE
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
    19
		DefaultCategoryForDolphin'
5849
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
    20
	poolDictionaries:''
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
    21
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    23
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    24
Object subclass:#ClassAttributes
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
    25
	instanceVariableNames:'primitiveDefinitions primitiveVariables primitiveFunctions'
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    26
	classVariableNames:''
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    27
	poolDictionaries:''
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    28
	privateIn:Class
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
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    31
!Class class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    32
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    33
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    34
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    35
 COPYRIGHT (c) 1989 by Claus Gittinger
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    36
	       All Rights Reserved
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    37
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    38
 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
    39
 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
    40
 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
    41
 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
    42
 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
    43
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    44
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    45
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    46
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    47
documentation
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
    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
    50
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    51
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    52
    [Instance variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    53
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    54
	name            <Symbol>        the classes name
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    55
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    56
	category        <Symbol>        the classes category
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    57
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    58
	classvars       <String>        the names of the class variables
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    59
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    60
	comment         <String>        the classes comment; either a string,
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    61
					a number specifying the offset in classFilename, or nil
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    62
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    63
	subclasses      <Collection>    cached collection of subclasses
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    64
					(currently unused - but will be soon)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    65
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    66
	classFilename   <String>        the file (or nil) where the classes
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    67
					sources are found 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    68
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    69
	package         <Symbol>        the package, in which the class was defined
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    70
					(inserted by compilers)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    71
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    72
	revision        <String>        revision string - inserted by stc
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    73
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    74
	environment     <Symbol | nil>  cached environment (i.e. Smalltalk or a namespace)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    75
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    76
	signature       <SmallInteger>  the classes signature (used to detect obsolete
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    77
					or changed classes with binaryStorage)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    78
					This is filled in lazy - i.e. upon the first signature query.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    79
7371
e6fccc3b935c kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents: 7369
diff changeset
    80
	attributes   <Array | nil>      describes primitiveIncludes, primitiveFunctions etc.
e6fccc3b935c kludge to compile - primitiveDefinitions is a bad variable name - sigh
Claus Gittinger <cg@exept.de>
parents: 7369
diff changeset
    81
					also a place to add additional attributes,
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    82
					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
    83
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    84
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    85
    WARNING: layout known by compiler and runtime system
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    86
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    87
    [author:]
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    88
	Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
    89
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
    90
    [see also:]
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
    91
	Behavior ClassDescription Metaclass
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    92
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
    93
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    94
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
    95
!Class class methodsFor:'accessing-flags'!
362
claus
parents: 360
diff changeset
    96
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    97
tryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    98
    ^ TryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    99
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   100
    "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
   101
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   102
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   103
tryLocalSourceFirst:aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   104
    TryLocalSourceFirst := aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   105
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   106
    "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
   107
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   108
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   109
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   110
    "turn on/off changes management. Return the prior value of the flag.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   111
     This value is used as a default fallback - a querySignal handler may still 
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   112
     decide to return something else."
362
claus
parents: 360
diff changeset
   113
claus
parents: 360
diff changeset
   114
    |prev|
claus
parents: 360
diff changeset
   115
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   116
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   117
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   118
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   119
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   120
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   121
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   122
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   123
     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
   124
     decide to return something else."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   125
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   126
    ^ UpdatingChanges
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   127
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   128
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   129
!Class class methodsFor:'helpers'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   130
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   131
revisionInfoFromString:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   132
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   133
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   134
    "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
   135
     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
   136
     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
   137
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   138
    |mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   139
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   140
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   141
    "/ 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
   142
    "/
7755
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   143
    (mgr := SourceCodeManager) isNil ifTrue:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   144
        "/
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   145
        "/ fallBack - assume CVS header
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
   146
        "/
7755
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   147
        mgr := CVSSourceCodeManager
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   148
    ].
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   149
    "/
7755
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   150
    "/ care for standAlone apps which have no CVS (libbasic3) included
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   151
    "/
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   152
    mgr isNil ifTrue:[
7755
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   153
        AbstractSourceCodeManager notNil ifTrue:[
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   154
            ^ AbstractSourceCodeManager revisionInfoFromRCSString:aString    
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   155
        ].
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   156
        ^ nil
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   157
    ].
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   158
    ^ mgr revisionInfoFromString:aString.
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   159
!
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   160
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   161
revisionStringFromSource:aMethodSourceString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   162
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   163
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   164
    "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
   165
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   166
    |lines line|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   167
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   168
    lines := aMethodSourceString asCollectionOfLines.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   169
    lines do:[:l |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   170
	|i|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   171
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   172
	i := l indexOfSubCollection:'$Header: '.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   173
	i ~~ 0 ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   174
	    line := l copyFrom:i.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   175
	    i := line lastIndexOf:$$.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   176
	    i > 1 ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   177
		line := line copyTo:i.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   178
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   179
	    ^ line
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   180
	]
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   181
    ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   182
    ^ nil
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   183
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   184
    "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
   185
    "Modified: 16.10.1996 / 16:54:40 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   186
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   187
3618
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   188
!Class class methodsFor:'misc'!
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   189
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   190
template:aCategoryString
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   191
    "return a class-definition template"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   192
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   193
    ^ 'NameOfSuperclass subclass:#NameOfClass
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   194
    instanceVariableNames:''instVarName1 instVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   195
    classVariableNames:''classVarName1 classVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   196
    poolDictionaries:''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   197
    category:''' , aCategoryString , ''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   198
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   199
    "Created: / 19.6.1998 / 02:09:06 / cg"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   200
! !
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   201
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   202
!Class class methodsFor:'private'!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   203
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   204
flushSubclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   205
    "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
   206
     by #subclassInfo.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   207
     This is private protocol"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   208
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   209
    SubclassInfo := nil.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   210
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   211
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   212
     Class flushSubclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   213
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   214
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   215
    "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
   216
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   217
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   218
subclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   219
    "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
   220
     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
   221
     by #flushSubclassInfo.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   222
     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
   223
     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
   224
     hierarchy.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   225
     This is private protocol."
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   226
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   227
    |d|
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   228
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   229
    SubclassInfo notNil ifTrue:[^ SubclassInfo].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   230
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   231
    d := IdentityDictionary new.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   232
    Smalltalk allClassesDo:[:aClass |
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   233
        |superCls setToAddSubclass|
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   234
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   235
        superCls := aClass superclass.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   236
        superCls notNil ifTrue:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   237
            setToAddSubclass := d at:superCls ifAbsent:nil.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   238
            setToAddSubclass isNil ifTrue:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   239
                d at:superCls put:(Set with:aClass).
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   240
            ] ifFalse:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   241
                setToAddSubclass add:aClass
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   242
            ]
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   243
        ]
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   244
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   245
    SubclassInfo := d.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   246
    ^ d
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   247
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   248
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   249
     Class subclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   250
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   251
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   252
    "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
   253
! !
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   254
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   255
!Class class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   256
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
   257
defaultExternalEncoding
8075
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
   258
    ^ nil    "/ for backward compatibility
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
   259
    "/ ^ #'utf-8'
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
   260
!
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
   261
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   262
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   263
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   264
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   265
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   266
    ^ self == Class class or:[self == Class]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   267
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   268
    "Created: 15.4.1996 / 17:17:13 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   269
    "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
   270
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   271
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   272
!Class methodsFor:'Compatibility-Dolphin'!
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   273
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   274
defaultCategoryForDolphinClasses
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   275
    ^ DefaultCategoryForDolphin ? 'Dolphin classes'.
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   276
!
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   277
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   278
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   279
    "{ Pragma: +optSpace }"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   280
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   281
    "this method allows fileIn of Dolphin classes "
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   282
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   283
    ^ self subclass:t 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   284
	   instanceVariableNames:f
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   285
	   classVariableNames:d
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   286
	   poolDictionaries:s
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   287
	   category:(self defaultCategoryForDolphinClasses)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   288
	   classInstanceVariableNames:classInstanceVariableNames
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   289
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   290
    "Modified: / 15.6.1998 / 21:31:34 / cg"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   291
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   292
!
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   293
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   294
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   295
    "{ Pragma: +optSpace }"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   296
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   297
    "this method allows fileIn of Dolphin classes "
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   298
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   299
    ^ self variableSubclass:t 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   300
	   instanceVariableNames:f
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   301
	   classVariableNames:d
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   302
	   poolDictionaries:s
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   303
	   category:(self defaultCategoryForDolphinClasses)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   304
	   classInstanceVariableNames:classInstanceVariableNames
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   305
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   306
    "Modified: / 15.6.1998 / 21:31:34 / cg"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   307
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   308
! !
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   309
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   310
!Class methodsFor:'Compatibility-ST/V and V''Age'!
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   311
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   312
defaultCategoryForSTVorVAGEClasses
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   313
    |cat app|
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   314
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   315
    DefaultApplicationQuerySignal isHandled ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   316
	app := DefaultApplicationQuerySignal query.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   317
	app notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   318
	    cat := 'Applications-' , app name.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   319
	] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   320
	    cat := DefaultCategoryForVAGE ? 'V''Age classes'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   321
	].
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   322
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   323
	cat := DefaultCategoryForSTV ? 'ST/V classes'.
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   324
    ].
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   325
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   326
    ^ cat
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   327
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   328
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   329
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   330
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   331
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   332
    "this method allows fileIn of ST/V and V'Age classes 
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   333
     (which seem to have no category)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   334
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   335
    ^ self subclass:t 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   336
	   instanceVariableNames:f
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   337
	   classVariableNames:d
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   338
	   poolDictionaries:s
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   339
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   340
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   341
    "Modified: / 15.6.1998 / 21:31:34 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   342
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   343
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   344
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   345
variableByteSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   346
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   347
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   348
    "this method allows fileIn of ST/V and V'Age variable byte classes 
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   349
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   350
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   351
    ^ self variableByteSubclass:t 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   352
	   instanceVariableNames:''
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   353
	   classVariableNames:d
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   354
	   poolDictionaries:s
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   355
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   356
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   357
    "Modified: / 15.6.1998 / 21:31:38 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   358
    "Modified: / 18.3.1999 / 18:16:21 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   359
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   360
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   361
variableLongSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   362
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   363
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   364
    "this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes 
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   365
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   366
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   367
    ^ self variableLongSubclass:t 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   368
	   instanceVariableNames:''
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   369
	   classVariableNames:d
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   370
	   poolDictionaries:s
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   371
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   372
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   373
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   374
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   375
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   376
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   377
    "this method allows fileIn of ST/V and V'Age variable pointer classes 
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   378
     (which seem to have no category)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   379
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   380
    ^ self variableSubclass:t 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   381
	   instanceVariableNames:f
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   382
	   classVariableNames:d
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   383
	   poolDictionaries:s
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   384
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   385
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   386
    "Modified: / 15.6.1998 / 21:31:41 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   387
    "Modified: / 18.3.1999 / 18:16:33 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   388
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   389
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   390
variableWordSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   391
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   392
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   393
    "this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes 
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   394
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   395
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   396
    ^ self variableWordSubclass:t 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   397
	   instanceVariableNames:''
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   398
	   classVariableNames:d
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   399
	   poolDictionaries:s
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   400
	   category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   401
! !
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   402
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   403
!Class methodsFor:'Compatibility-ST80'!
5190
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   404
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   405
fileOutSourceOn:aStream
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   406
    self fileOutOn:aStream withTimeStamp:false
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   407
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   408
    "Created: 20.6.1997 / 17:18:14 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   409
    "Modified: 20.6.1997 / 17:18:26 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   410
!
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   411
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   412
rename:newName
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   413
    "same as renameTo: - for ST80 compatibility"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   414
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   415
    ^ Smalltalk renameClass:self to:newName.
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   416
"/    ^ self renameTo:newName
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   417
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   418
    "Created: / 18.6.1998 / 22:08:45 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   419
! !
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   420
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   421
!Class methodsFor:'Compatibility-VW'!
6136
e509e0a0141a where is the main
Claus Gittinger <cg@exept.de>
parents: 6097
diff changeset
   422
5190
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   423
isVisualStartable
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   424
    "return true, if this is an application class,
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   425
     which can be started via #open"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   426
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   427
    ^ false
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   428
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   429
    "Created: / 27.10.1997 / 16:42:05 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   430
! !
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   431
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   432
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   433
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   434
addChangeRecordForClass:aClass andNotifyChangeOf:aspect
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   435
    "writes a change record and notifies dependents."
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   436
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   437
    |namespace|
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   438
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   439
    self addChangeRecordForClass:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   440
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   441
    aClass changed:#definition.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   442
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   443
    namespace := aClass nameSpace.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   444
    namespace changed:#classDefinition with:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   445
    namespace ~~ Smalltalk ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   446
	Smalltalk changed:#classDefinition with:aClass.
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   447
    ].
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   448
    namespace changed:aspect with:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   449
    namespace ~~ Smalltalk ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   450
	Smalltalk changed:aspect with:aClass.
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   451
    ].
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   452
!
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   453
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   454
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   455
    "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
   456
     Also writes a change record and notifies dependents."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   457
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   458
    (self classVarNames includes:aString) ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   459
	self classVariableString:(self classVariableString , ' ' , aString).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   460
	Class withoutUpdatingChangesDo:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   461
	    self withAllSubclasses do:[:cls|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   462
		cls recompileMethodsAccessingAnyClassvarOrGlobal:
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   463
					(Array with:aString asSymbol)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   464
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   465
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   466
	self addChangeRecordForClass:self andNotifyChangeOf:#classVariables.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   467
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   468
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
   469
    "Created: / 29.10.1995 / 19:40:51 / cg"
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
   470
    "Modified: / 23.1.1998 / 15:46:23 / stefan"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   471
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   472
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   473
allPrivateClasses
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   474
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   475
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   476
    "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
   477
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   478
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   479
    ^ self privateClassesOrAll:true
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   480
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   481
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   482
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   483
category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   484
    "return the category of the class. 
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   485
     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
   486
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   487
    |owner|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   488
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   489
    (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
   490
    ^ category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   491
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   492
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   493
     Point category                
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   494
     Dictionary category           
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   495
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   496
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   497
    "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
   498
    "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
   499
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   500
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   501
category:aStringOrSymbol
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   502
    "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
   503
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   504
    |ns|
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   505
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
   506
    self setCategory:aStringOrSymbol.
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   507
    Project addChangeRecordForClass:self.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   508
    ns := self nameSpace.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   509
    ns changed:#organization.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   510
    ns ~~ Smalltalk ifTrue:[
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   511
        Smalltalk changed:#organization.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   512
    ]
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   513
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   514
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   515
classFilename
4744
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
   516
    "return the name of the file from which the class was compiled."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   517
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   518
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   519
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   520
    (owner := self owningClass) notNil ifTrue:[^ owner classFilename].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   521
    ^ classFilename
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   522
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   523
    "Modified: 15.10.1996 / 18:53:21 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   524
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   525
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   526
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   527
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   528
     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
   529
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   530
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   531
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   532
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   533
     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
   534
     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
   535
     no classPools yet.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   536
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   537
    ^ Smalltalk at:(self globalKeyForClassVar:aSymbol)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   538
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   539
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   540
classVarAt:aSymbol ifAbsent:exceptionBlock
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   541
    "return the value of a class variable.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   542
     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
   543
     this may change."
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   544
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   545
    "
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   546
     this hides the (current) implementation of classVariables
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   547
     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
   548
     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
   549
     no classPools yet.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   550
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   551
    ^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   552
!
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   553
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   554
classVarAt:aSymbol put:something
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   555
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   556
     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
   557
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   558
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   559
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   560
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   561
     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
   562
     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
   563
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   564
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   565
    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
   566
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   567
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   568
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   569
    "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
   570
     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
   571
     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
   572
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   573
    classvars isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   574
	^ #()
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   575
    ].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   576
    classvars isString ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   577
	classvars := classvars asCollectionOfWords asArray collect:[:varName| varName asSymbol].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   578
	^ classvars
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   579
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   580
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   581
    ^ classvars
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   582
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   583
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   584
     Object classVarNames 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   585
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   586
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   587
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   588
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   589
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   590
    "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
   591
     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
   592
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   593
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   594
    classvars isNil ifTrue:[^ ''].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   595
    classvars isString ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   596
	^ classvars
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   597
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   598
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   599
    ^ classvars asStringWith:(Character space)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   600
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   601
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   602
     Object classVariableString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   603
     Float classVariableString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   604
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   605
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   606
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   607
classVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   608
    "set the classes classvarnames string; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   609
     Initialize new class variables with nil, clear and remove old ones. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   610
     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
   611
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   612
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   613
7517
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   614
    (aString ~= self classVariableString) ifTrue:[
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   615
        prevVarNames := self classVarNames asOrderedCollection.
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   616
        classvars := aString.
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   617
        varNames := self classVarNames.
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   618
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   619
        "new ones get initialized to nil;
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   620
         - old ones are nilled and removed from Smalltalk"
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   621
        any := false.
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   622
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   623
        varNames do:[:aName |
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   624
            (prevVarNames includes:aName) ifFalse:[
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   625
                "a new one"
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   626
                self classVarAt:aName put:nil.
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   627
                any := true.
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   628
            ] ifTrue:[
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   629
                prevVarNames remove:aName
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   630
            ]
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   631
        ].
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   632
        "left overs are gone"
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   633
        prevVarNames do:[:aName |
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   634
            self classVarAt:aName put:nil.
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   635
            Smalltalk removeKey:(self name , ':' , aName) asSymbol.
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   636
        ].
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   637
        any ifTrue:[
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   638
            Smalltalk changed:#classVariables with:self
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   639
        ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   640
    ]
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   641
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   642
    "Modified: 2.4.1997 / 00:16:05 / stefan"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   643
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   644
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   645
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   646
    "return the comment (aString) of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   647
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   648
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   649
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   650
    "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
   651
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   652
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   653
    comment isNumber ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   654
	classFilename notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   655
	    stream := self sourceStream. 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   656
	    stream notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   657
		stream position1Based:comment.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   658
		string := String readFrom:stream onError:''.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   659
		stream close.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   660
		^ string
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   661
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   662
	    ^ nil
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   663
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   664
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   665
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   666
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   667
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   668
     Object comment 
7054
685d359f9847 code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   669
     RunArray comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   670
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   671
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   672
7128
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   673
comment:aStringOrNil
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   674
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   675
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   676
    "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
   677
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   678
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   679
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   680
7128
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   681
    newComment := aStringOrNil.
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   682
    (aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   683
	newComment := nil
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   684
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   685
    comment ~= newComment ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   686
	oldComment := self comment.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   687
	comment := newComment.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   688
	self addChangeRecordForClassComment:self.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   689
	self changed:#comment with:oldComment.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   690
	Smalltalk changed:#classComment with:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   691
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   692
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   693
2444
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   694
environment
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   695
    "return the namespace I am contained in; ST-80 compatible name"
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   696
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   697
    ^ self nameSpace
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   698
!
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   699
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   700
globalKeyForClassVar:aStringOrSymbol
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   701
    "this helps to encapsulate the (current) implementation of classVariables
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   702
     from the outside world. Currently, classvars are stored in
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   703
     the Smalltalk dictionary with a funny name, since there are
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   704
     no classPools yet.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   705
    "
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   706
    ^ (self name , ':' , aStringOrSymbol) asSymbol
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   707
!
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   708
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   709
name
6657
a0fa5a821176 comment
Claus Gittinger <cg@exept.de>
parents: 6520
diff changeset
   710
    "return the name of the class. 
a0fa5a821176 comment
Claus Gittinger <cg@exept.de>
parents: 6520
diff changeset
   711
     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
   712
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   713
    ^ name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   714
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   715
    "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
   716
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   717
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   718
nameSpace
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   719
    "return the namespace I am contained in;
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   720
     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
   721
     for public classes, Smalltalk is returned."
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   722
7321
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
   723
    |idx nsName e|
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
   724
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
   725
    "/ cached in environment
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
   726
    environment isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   727
	e := Smalltalk. "/ default
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   728
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   729
	"/ due to the implementation, extract this from my name
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   730
	"/ (physically, all classes are found in Smalltalk)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   731
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   732
	idx := name lastIndexOf:$:.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   733
	idx ~~ 0 ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   734
	    (name at:idx-1) == $: ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   735
		nsName := name copyTo:(idx - 2).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   736
		e := Smalltalk at:nsName asSymbol.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   737
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   738
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   739
	environment := e.
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   740
    ].
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   741
    ^ environment
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   742
3661
161322291871 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
   743
    "Modified: / 20.7.1998 / 14:21:36 / cg"
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   744
!
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   745
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   746
package
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   747
    "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
   748
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   749
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   750
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   751
    (owner := self owningClass) notNil ifTrue:[^ owner package].
5562
76675d5a0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5545
diff changeset
   752
    ^ package ? ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   753
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   754
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   755
     Object package  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   756
    "
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   757
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
   758
    "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
   759
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   760
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   761
package:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   762
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   763
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   764
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   765
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   766
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   767
packageInfo
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   768
    "return the package-info of the class - or nil.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   769
     The packageManager contains information relevant to the package,
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   770
     to which this class belongs - especially, things like pathes to
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   771
     resources, additional files etc. can be optioned this way.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   772
     A packageInfo loosely relates to ehat a classLoader is in Java.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   773
     Experimental."
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   774
4742
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   775
    |packageId prj handle t|
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   776
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   777
    packageId := self package.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   778
    packageId notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   779
	prj := Project projectWithId:packageId.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   780
	prj notNil ifTrue:[^ prj].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   781
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   782
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   783
	"/ intermediate kludge (will be removed)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   784
	"/ search for a loaded class library and extract
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   785
	"/ information from it ...
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   786
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   787
	handle := ObjectFileLoader loadedObjectHandles 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   788
		    detect:[:h | |cls|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   789
			cls := h classes firstIfEmpty:nil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   790
			cls notNil and:[cls package = packageId]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   791
		    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   792
		    ifNone:nil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   793
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   794
	handle notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   795
	    prj := Project new.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   796
	    prj name:packageId.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   797
	    prj directory:(handle pathName asFilename directory pathName).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   798
	    prj package:packageId.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   799
	    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   800
	    prj repositoryModule:(t first).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   801
	    prj repositoryDirectory:(packageId copyFrom:t first size + 2).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   802
	    prj isLoaded:true.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   803
	    ^ prj
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   804
	]
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   805
    ].
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   806
    ^ nil
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   807
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   808
    "
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   809
     Object packageInfo 
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   810
     OSI::FTAMOperation packageInfo 
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   811
    "
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   812
!
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   813
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   814
primitiveDefinitions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   815
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   816
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   817
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   818
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   819
    (self isPrivate) ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   820
        self error:'private classes cannot have their own primitiveDefinitions'.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   821
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
   822
    self setPrimitiveDefinitions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   823
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   824
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   825
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   826
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   827
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   828
primitiveDefinitionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   829
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   830
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   831
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   832
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   833
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   834
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   835
    (owner := self owningClass) notNil ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   836
        ^ owner primitiveDefinitionsString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   837
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   838
    ^ self getSourceChunkAttribute:#primitiveDefinitions
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   839
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   840
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   841
     Object primitiveDefinitionsString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   842
     String primitiveDefinitionsString
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
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   846
primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   847
    "return the primitiveDefinition string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   848
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   849
    ^ self primitiveDefinitionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   850
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   851
/*
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   852
 * includes, defines, structure definitions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   853
 * and typedefs come here.
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   854
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   855
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   856
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   857
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   858
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   859
     Object primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   860
     String primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   861
     ExternalStream primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   862
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   863
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   864
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   865
primitiveFunctions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   866
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   867
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   868
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   869
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   870
    (self isPrivate) ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   871
        self error:'private classes cannot have their own primitiveFunctions'.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   872
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
   873
    self setPrimitiveFunctions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   874
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   875
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   876
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   877
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   878
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   879
primitiveFunctionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   880
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   881
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   882
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   883
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   884
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   885
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   886
    (owner := self owningClass) notNil ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   887
        ^ owner primitiveFunctionsString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   888
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   889
    ^ self getSourceChunkAttribute:#primitiveFunctions
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   890
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   891
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   892
primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   893
    "return the primitiveFunction string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   894
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   895
    ^ self primitiveFunctionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   896
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   897
/* 
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   898
 * any local C (helper) functions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   899
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   900
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   901
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   902
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   903
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   904
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   905
     Object primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   906
     String primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   907
     ExternalStream primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   908
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   909
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   910
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   911
primitiveVariables:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   912
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   913
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   914
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   915
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   916
    (self isPrivate) ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   917
        self error:'private classes cannot have their own primitiveVariables'.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   918
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
   919
    self setPrimitiveVariables:aString.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   920
    self addChangeRecordForPrimitiveVariables:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   921
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   922
    "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
   923
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   924
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   925
primitiveVariablesString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   926
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   927
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   928
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   929
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   930
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   931
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   932
    (owner := self owningClass) notNil ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   933
        ^ owner primitiveVariablesString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   934
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
   935
    ^ self getSourceChunkAttribute:#primitiveVariables
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   936
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   937
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   938
primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   939
    "return the primitiveVariable string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   940
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   941
    ^ self primitiveVariablesString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   942
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   943
/* 
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   944
 * any local C variables
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   945
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   946
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   947
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   948
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   949
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   950
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   951
     Object primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   952
     String primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   953
     ExternalStream primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   954
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   955
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   956
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   957
privateClasses
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   958
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   959
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   960
    "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
   961
     The classes are in any order."
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   962
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   963
    ^ self privateClassesOrAll:false
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   964
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   965
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   966
     Object privateClasses
2718
f7b5e3bffd78 sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
   967
     ObjectMemory privateClasses 
f7b5e3bffd78 sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
   968
     UILayoutTool privateClasses 
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   969
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   970
3495
31ae10035c74 skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents: 3494
diff changeset
   971
    "Modified: / 29.5.1998 / 23:23:18 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   972
!
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   973
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   974
privateClassesAt:aClassNameStringOrSymbol
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   975
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   976
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   977
    "return a private class if present; nil otherwise"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   978
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   979
    |nmSym|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   980
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   981
    nmSym := (self name , '::' , aClassNameStringOrSymbol) asSymbolIfInterned.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   982
    nmSym isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   983
	"/ no such symbol - there cannot be a corresponding private class
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
   984
	^ nil
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   985
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   986
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   987
    ^ Smalltalk at:nmSym.
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   988
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   989
    "Modified: 26.6.1997 / 11:44:04 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   990
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   991
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   992
privateClassesAt:aClassNameStringOrSymbol put:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   993
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   994
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   995
    "add a private class"
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   996
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   997
    self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   998
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   999
    "Modified: 26.6.1997 / 11:44:12 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1000
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1001
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1002
privateClassesOrAll:allOfThem
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1003
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1004
4495
4804e3e33d76 tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents: 4400
diff changeset
  1005
    "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
  1006
     or direct plus indirect private classes (if allOfThem).
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1007
     An empty collection if there are none.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1008
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1009
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1010
    |classes myName myNamePrefix myNamePrefixLen|
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1011
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1012
    myName := self name.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1013
    myNamePrefix := myName , '::'.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1014
    myNamePrefixLen := myNamePrefix size.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1015
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
  1016
    Smalltalk keysDo:[:nm |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1017
	|cls|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1018
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1019
	(nm startsWith:myNamePrefix) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1020
	    (allOfThem
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1021
	    or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1022
		cls := Smalltalk at:nm.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1023
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1024
		(cls isBehavior and:[cls isMeta not]) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1025
		    classes isNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1026
			classes := Set new:10.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1027
		    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1028
		    classes add:cls.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1029
		]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1030
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1031
	]
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1032
    ].
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
  1033
4578
705211312d94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  1034
    ^ classes ? #()
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1035
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1036
    "
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1037
     UILayoutTool privateClassesOrAll:true 
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1038
     UILayoutTool privateClassesOrAll:false 
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1039
    "
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1040
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1041
    "Modified: / 29.5.1998 / 23:23:18 / cg"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1042
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1043
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1044
privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1045
    "{ Pragma: +optSpace }"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1046
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1047
    "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
  1048
     The classes are sorted by inheritance."
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1049
7894
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1050
    |classes pivateClassesOf|
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1051
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1052
    classes := self privateClasses.
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1053
    (classes size > 0) ifTrue:[
7894
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1054
        classes := classes asOrderedCollection.
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1055
        classes sort:[:a :b | a name < b name].
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1056
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1057
        pivateClassesOf := IdentityDictionary new.
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1058
        classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)].
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1059
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1060
        classes topologicalSort:[:a :b | 
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1061
            "/ a must come before b iff:
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1062
            "/    b is a subclass of a
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1063
            "/    b has a private class which is a subclass of a
7084
e53302e0134b oops - must also sort private classes according
Claus Gittinger <cg@exept.de>
parents: 7054
diff changeset
  1064
            
7894
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1065
            |mustComeBefore pivateClassesOfB|
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1066
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1067
            mustComeBefore := b isSubclassOf:a.
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1068
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1069
            pivateClassesOfB := pivateClassesOf at:b.
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1070
            pivateClassesOfB do:[:eachClassInB |
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1071
                mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a]
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1072
            ].
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1073
            mustComeBefore
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1074
        ].
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1075
    ].
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1076
    ^ classes.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1077
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1078
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1079
     Object privateClassesSorted
5731
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1080
     NewSystemBrowser privateClassesSorted
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1081
     NewSystemBrowser privateClasses
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1082
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1083
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1084
    "Created: 22.3.1997 / 16:10:42 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1085
    "Modified: 22.3.1997 / 16:11:20 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1086
!
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1087
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1088
removeClassVarName:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1089
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1090
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1091
    "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
  1092
     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
  1093
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1094
    |names newNames|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1095
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1096
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1097
    (names includes:aString) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1098
	newNames := ''.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1099
	names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1100
	self classVariableString:newNames withoutSpaces.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1101
	Class withoutUpdatingChangesDo:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1102
	    self withAllSubclasses do:[:cls|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1103
		cls recompileMethodsAccessingAnyClassvarOrGlobal:
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1104
					(Array with:aString asSymbol)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1105
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1106
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1107
	self addChangeRecordForClass:self andNotifyChangeOf:#classVariables.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1108
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1109
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1110
    "Created: / 29.10.1995 / 19:42:08 / cg"
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1111
    "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
  1112
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1113
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1114
setCategory:aStringOrSymbol
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1115
    "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
  1116
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1117
    aStringOrSymbol isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1118
	category := aStringOrSymbol
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1119
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1120
	category := aStringOrSymbol asSymbol
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1121
    ]
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1122
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1123
    "Created: 1.4.1997 / 15:24:04 / stefan"
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1124
!
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1125
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1126
setClassFilename:aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1127
    "set the classes filename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1128
     This is a dangerous (low level) operation, since the 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1129
     comment and primitiveSpecs may no longer be accessable, if a wrong filename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1130
     is set here."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1131
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1132
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1133
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1134
    "Modified: 8.9.1995 / 14:16:48 / claus"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1135
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1136
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1137
setClassVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1138
    "set the classes classvarnames string. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1139
     This is a dangerous (low level) operation, since the 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1140
     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
  1141
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1142
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1143
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1144
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1145
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1146
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1147
    "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
  1148
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1149
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1150
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1151
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1152
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1153
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1154
    "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
  1155
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1156
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1157
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1158
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1159
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1160
    categoryStringOrSymbol isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1161
	cat := ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1162
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1163
	cat := categoryStringOrSymbol
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1164
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1165
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1166
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1167
5248
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1168
setEnvironment:aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1169
    "set the namespace I am contained in; ST-80 compatible name"
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1170
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1171
    environment := aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1172
!
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1173
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1174
setPackage:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1175
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1176
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1177
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1178
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1179
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1180
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1181
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1182
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1183
    |code aStream tmpFile|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1184
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1185
" this is too slow for big classes ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1186
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1187
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1188
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1189
"
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1190
    tmpFile := '__temp' asFilename.
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1191
    [
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1192
	aStream := tmpFile newReadWriteStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1193
    ] on:FileStream openErrorSignal do:[:ex|
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1194
	self warn:'cannot create temporary file.'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1195
	^ nil
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1196
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1197
    FileOutErrorSignal handle:[:ex |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1198
	aStream nextPutAll:'"no source available"'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1199
    ] do:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1200
	self fileOutOn:aStream.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1201
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1202
    aStream close.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1203
    aStream := tmpFile readStreamOrNil.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1204
    aStream isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1205
	self warn:'oops - cannot reopen temp file'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1206
	^ nil
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1207
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1208
    code := aStream contents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1209
    aStream close.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1210
    tmpFile remove.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1211
    ^ code
385
claus
parents: 384
diff changeset
  1212
!
claus
parents: 384
diff changeset
  1213
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1214
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1215
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1216
     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
  1217
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1218
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1219
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1220
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1221
    (owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager].
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1222
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1223
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1224
    "Created: 7.12.1995 / 13:16:46 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1225
    "Modified: 15.10.1996 / 18:54:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1226
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1227
5257
a90fd9cb3c18 category rename
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
  1228
!Class methodsFor:'adding & removing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1229
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1230
removeFromSystem
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1231
    "ST-80 compatibility
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1232
     remove myself from the system"
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1233
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1234
    ^ Smalltalk removeClass:self
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1235
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1236
    "Created: 6.2.1996 / 11:32:58 / stefan"
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1237
!
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1238
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1239
unload
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1240
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1241
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1242
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1243
     autoloaded. Can be used to get rid of no longer needed autoloaded
328
claus
parents: 326
diff changeset
  1244
     classes. 
claus
parents: 326
diff changeset
  1245
     (maybe, autoloaded classes should unload themselfes when no
claus
parents: 326
diff changeset
  1246
      longer needed - for example, after some delay when the last instance 
claus
parents: 326
diff changeset
  1247
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1248
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1249
    |nm newClass|
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1250
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1251
    self wasAutoloaded ifFalse:[
7833
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1252
        "
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1253
         can it be done ?
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1254
         (all of my methods must have a source)
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1255
        "
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1256
        self instAndClassSelectorsAndMethodsDo:[:sel :aMethod |
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1257
            aMethod source isNil ifTrue:[^false].
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1258
            aMethod hasPrimitiveCode ifTrue:[^ false].
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1259
        ].
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1260
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1261
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1262
    "/ cannot unload, if non-autoloaded subclasses exist ...
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1263
    self allSubclassesDo:[:aClass |
7833
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1264
        aClass wasAutoloaded ifFalse:[
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1265
            aClass isPrivate ifFalse:[
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1266
                self warn:('cannot unload ' , self name , ' (' , aClass name , ' requires it)').
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1267
                ^ false.
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1268
            ]
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1269
        ]
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1270
    ].
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1271
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1272
    self allSubclassesDo:[:aClass |
7833
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1273
        aClass wasAutoloaded ifTrue:[
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1274
            aClass unload
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1275
        ] ifFalse:[
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1276
            aClass removeFromSystem.
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1277
        ]
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1278
    ].
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1279
    self privateClasses do:[:aClass |
7833
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1280
        aClass removeFromSystem.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1281
    ].
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1282
    Transcript showCR:'unloading ' , name , ' ...'.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1283
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1284
    "/ reinstall as autoloaded
359
claus
parents: 357
diff changeset
  1285
    Autoload removeClass:self.    
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1286
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1287
    Smalltalk at:nm put:nil.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1288
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1289
    ObjectMemory flushMethodCache.
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1290
    newClass := Autoload addClass:nm inCategory:category.
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1291
    newClass notNil ifTrue:[
7833
08f541e77f8e change warn box string
penk
parents: 7755
diff changeset
  1292
        newClass package:package
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1293
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1294
    Smalltalk flushCachedClasses.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1295
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1296
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1297
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1298
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1299
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1300
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1301
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1302
    "
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1303
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1304
    "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
  1305
    "Modified: 4.6.1997 / 14:48:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1306
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1307
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1308
!Class methodsFor:'binary storage'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1309
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1310
addGlobalsForBinaryStorageTo:globalDictionary
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1311
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1312
    classPool == nil ifFalse: [
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1313
	classPool associationsDo: [:assoc|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1314
	    globalDictionary at: assoc put: self
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1315
	]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1316
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1317
"
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1318
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1319
    "Created: 21.3.1997 / 15:40:45 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1320
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1321
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1322
binaryClassDefinitionFrom:stream manager:manager
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1323
    "retrieve a class as stored previously with
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1324
     #storeBinaryClassOn:manager:
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1325
     The namespace, where the class is to be installed is queries via the
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1326
     NameSpaceQuerySignal - it should answer with nil, to suppress installation."
1699
42a53290bd5d allow for a class to be loaded into another environment
Claus Gittinger <cg@exept.de>
parents: 1687
diff changeset
  1327
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1328
    |superclassName name flags instvars classvars category classInstVars
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1329
     comment package superclassSig rev
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1330
     newClass superClass methods cmethods formatID environment
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1331
     ownerName owner nPrivate privateClass cls|
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1332
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1333
    "/ the following order must correlate to
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1334
    "/ the storing in #storeBinaryClassOn:manager:
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1335
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1336
    "/ retrieve
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1337
    "/   formatID
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1338
    "/   superclasses name,
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1339
    "/   superclasses signature
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1340
    "/   name,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1341
    "/   typeSymbol,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1342
    "/   instVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1343
    "/   classVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1344
    "/   category
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1345
    "/   classInstVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1346
    "/   comment
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1347
    "/   revision
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1348
    "/   package
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1349
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1350
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1351
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1352
    "/   number of private classes
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1353
    "/   private classes, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1354
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1355
    formatID := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1356
    formatID isInteger ifFalse:[       "/ backward compatibilty
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1357
	formatID := nil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1358
	superclassName := formatID
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1359
    ] ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1360
	superclassName := manager nextObject.
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1361
    ].
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1362
    superclassSig := manager nextObject.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1363
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1364
    superclassName notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1365
	superClass := Smalltalk at:superclassName ifAbsent:nil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1366
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1367
	superClass isNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1368
	    BinaryIOManager nonexistingClassSignal
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1369
		raiseRequestWith:'non existent superclass (in binaryLoad)'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1370
	    ^ nil
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1371
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1372
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1373
	"/ ('loading superclass: ' ,  superclassName ) printNL.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1374
	superClass autoload.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1375
	superClass := Smalltalk at:superclassName.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1376
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1377
	superclassSig ~= superClass signature ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1378
	    BinaryIOManager changedInstLayoutSignal
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1379
		raiseRequestWith:'incompatible superclass (in binaryLoad)'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1380
	    ^ nil
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1381
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1382
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1383
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1384
    name := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1385
    flags := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1386
    instvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1387
    instvars isNil ifTrue:[instvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1388
    classvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1389
    classvars isNil ifTrue:[classvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1390
    category := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1391
    classInstVars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1392
    classInstVars isNil ifTrue:[classInstVars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1393
    comment := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1394
    package := manager nextObject.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1395
    formatID == 1 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1396
	rev := manager nextObject.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1397
	ownerName := manager nextObject.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1398
	ownerName notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1399
	    name := name copyFrom:(ownerName size + 2 + 1).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1400
	    owner := Smalltalk at:ownerName.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1401
	]
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1402
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1403
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1404
"/    'got superName:' print. superclassName printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1405
"/    'got name:' print. name printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1406
"/    'got flags: ' print. flags printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1407
"/    'got instvars: ' print. instvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1408
"/    'got classvars: ' print. classvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1409
"/    'got category: ' print. category printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1410
"/    'got classInstvars: ' print. classInstVars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1411
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1412
"/ ('create class: ' ,  name ) printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1413
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1414
    owner notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1415
	environment := owner
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1416
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1417
	environment := Class nameSpaceQuerySignal query.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1418
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1419
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1420
    cls := superClass.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1421
    superClass isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1422
	cls := Object
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1423
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1424
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1425
    newClass := cls class
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1426
	    name:name asSymbol
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1427
	    inEnvironment:environment
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1428
	    subclassOf:cls
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1429
	    instanceVariableNames:instvars
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1430
	    variable:false
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1431
	    words:false 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1432
	    pointers:true
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1433
	    classVariableNames:classvars
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1434
	    poolDictionaries:'' 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1435
	    category:category
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1436
	    comment:comment 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1437
	    changed:false 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1438
	    classInstanceVariableNames:classInstVars.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1439
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1440
    newClass isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1441
	^ nil.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1442
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1443
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1444
    superClass isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1445
	newClass setSuperclass:nil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1446
	newClass class setSuperclass:Class.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1447
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1448
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1449
"/ Transcript showCR:'loaded ' , name , ' in ' , environment name.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1450
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1451
    newClass flags:flags.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1452
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1453
    "/ retrieve class methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1454
    cmethods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1455
    "/ retrieve inst methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1456
    methods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1457
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1458
    formatID == 1 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1459
	"/ privateClasses
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1460
	nPrivate := manager nextObject.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1461
	nPrivate timesRepeat:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1462
	    Class nameSpaceQuerySignal
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1463
		answer:newClass
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1464
		do:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1465
		    privateClass := manager nextObject
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1466
		]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1467
	]
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1468
    ].
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1469
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1470
    (superClass isNil and:[superclassName notNil]) ifTrue:[^ nil].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1471
    newClass isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1472
	^ nil
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1473
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1474
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1475
    owner notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1476
	newClass setCategory:nil.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1477
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1478
	newClass setPackage:package.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1479
    ].
6077
d777721e42c8 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 6023
diff changeset
  1480
    newClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:package].
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1481
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1482
    newClass methodDictionary:methods.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1483
    newClass class methodDictionary:cmethods.
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1484
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1485
    newClass initializeWithAllPrivateClasses.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1486
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1487
    ^ newClass
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1488
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1489
    "Created: / 8.10.1996 / 17:57:02 / cg"
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1490
    "Modified: / 16.2.1999 / 10:09:22 / cg"
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1491
    "Modified: / 18.3.1999 / 18:15:58 / stefan"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1492
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1493
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1494
storeBinaryClassOn:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1495
    "store a classes complete description (i.e. including methods).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1496
     However, the superclass chain is not stored - at load time, that must
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1497
     be either present or autoloadable."
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1498
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  1499
    |s sig owner superclass privateClasses nPrivate|
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1500
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1501
    stream nextPut: manager codeForClass.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1502
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1503
    "/ the following order must correlate to
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1504
    "/ the storing in #binaryDefinitionFrom:manager:
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1505
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1506
    "/ store
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1507
    "/   format ID
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1508
    "/   superclasses name
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1509
    "/   superclasses signature
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1510
    "/   name
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1511
    "/   typeSymbol,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1512
    "/   instVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1513
    "/   classVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1514
    "/   category
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1515
    "/   classInstVarNames
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1516
    "/   comment
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1517
    "/   package
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1518
    "/   revision
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1519
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1520
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1521
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1522
    "/   # of privateClass names
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1523
    "/   privateClasses, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1524
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1525
    1 storeBinaryOn:stream manager:manager.  "/ formatID
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1526
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1527
    owner := self owningClass.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1528
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  1529
    superclass := self superclass.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1530
    superclass isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1531
	s := nil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1532
	sig := 0.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1533
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1534
	s := superclass name.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1535
	sig := superclass signature.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1536
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1537
    s storeBinaryOn:stream manager:manager.
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1538
    sig storeBinaryOn:stream manager:manager.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1539
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1540
    name storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1541
    flags storeBinaryOn:stream manager:manager.
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1542
    (instvars isNil or:[instvars isEmpty]) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1543
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1544
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1545
	s := self instanceVariableString
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1546
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1547
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1548
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
  1549
    (classvars isNil or:[classvars isEmpty]) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1550
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1551
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1552
	s := self classVariableString
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1553
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1554
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1555
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1556
    "/ the category
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1557
    owner notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1558
	nil storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1559
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1560
	category storeBinaryOn:stream manager:manager.
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1561
    ].
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1562
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1563
    "/ the classInstVarString
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1564
    s := self class instanceVariableString.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1565
    (s notNil and:[s isEmpty]) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1566
	s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1567
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1568
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1569
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1570
    "/ the comment
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1571
    s := comment.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1572
    manager sourceMode == #discard ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1573
	s := nil
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1574
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1575
    s storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1576
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1577
    "/ the revision, package & owner
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1578
    owner notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1579
	nil storeBinaryOn:stream manager:manager.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1580
	nil storeBinaryOn:stream manager:manager.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1581
	owner name storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1582
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1583
	package storeBinaryOn:stream manager:manager.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1584
	revision storeBinaryOn:stream manager:manager.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1585
	nil storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1586
    ].
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1587
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1588
    "/
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1589
    "/ store class method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1590
    "/ 
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1591
    self class methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1592
    "/ store inst method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1593
    self methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.    
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1594
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1595
    "/
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1596
    "/ names of private classes
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1597
    "/
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1598
    privateClasses := self privateClassesSorted.
4022
173f99e823ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4021
diff changeset
  1599
    (nPrivate := privateClasses size) storeBinaryOn:stream manager:manager.
173f99e823ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4021
diff changeset
  1600
    nPrivate > 0 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1601
	privateClasses do:[:aClass |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1602
	    aClass storeBinaryClassOn:stream manager:manager
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1603
	]
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1604
    ].
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1605
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1606
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1607
     |bos|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1608
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1609
     bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1610
     bos nextPutClasses:(Array with:FileBrowser).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1611
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1612
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1613
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1614
     |bos cls|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1615
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1616
     bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1617
     cls := bos next.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1618
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1619
     cls open.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1620
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1621
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  1622
    "Modified: / 7.6.1996 / 13:39:02 / stefan"
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1623
    "Modified: / 16.2.1999 / 07:07:00 / cg"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1624
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1625
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1626
storeBinaryDefinitionOf: anAssociation on: stream manager: manager
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1627
    "not usable at the moment - there are no classpools currently"
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1628
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1629
    | string |
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1630
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1631
    string := self name, ' classPool at: ', anAssociation key storeString.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1632
    stream nextNumber: 2 put: string size.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1633
    stream nextPutBytes:(string size) from:string startingAt:1.
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1634
"/    string do: [:char| stream nextPut: char asciiValue]
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1635
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1636
    "Modified: 19.3.1997 / 18:49:54 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1637
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1638
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1639
storeBinaryDefinitionOn: stream manager: manager
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1640
    "store the receiver in a binary format on stream.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1641
     This is an internal interface for binary storage mechanism.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1642
     classes only store the name, signature and instvar names.
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1643
     They restore by looking for that name in the Smalltalk dictionary.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1644
     However, using the signature, a check for being valid is made at
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1645
     restore time.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1646
     This avoids a full recursive store of a class in the normal binary
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1647
     storage - however, it also means that a classes semantics cannot
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1648
     be stored with the basic storeBinary operation
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1649
     (we depend on the class being present at binaryLoad time.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1650
    To store classes, use #storeBinaryClassOn:manager: or BOSS>>nextPutClasses:."
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1651
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1652
    |varnames n sz|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1653
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1654
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1655
     output the signature
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1656
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1657
    stream nextNumber:4 put:self signature.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1658
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1659
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1660
     output the instance variable name string
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1661
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1662
    varnames := self allInstVarNames.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1663
    n := varnames size.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1664
    n == 0 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1665
	sz := 0
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1666
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1667
	sz := varnames inject:0 into:[:sum :nm | sum + nm size].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1668
	sz := sz + n - 1.
877
63ebb325ed20 flush global-access cache (using snapshotID) when saving a methods binary code
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
  1669
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1670
    stream nextNumber:2 put:sz.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1671
    varnames keysAndValuesDo:[:i :nm |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1672
	stream nextPutBytes:(nm size) from:nm startingAt:1.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1673
"/        nm do:[:c |
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1674
"/            stream nextPut:c asciiValue
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1675
"/        ].
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1676
	i ~~ n ifTrue:[stream nextPut:(Character space asciiValue)]
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1677
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1678
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1679
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1680
     output my name
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1681
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1682
    stream nextNumber:2 put:name size.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1683
    stream nextPutBytes:(name size) from:name startingAt:1.
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1684
"/    name do:[:c| 
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1685
"/        stream nextPut:c asciiValue
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1686
"/    ]
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1687
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1688
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1689
     |s|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1690
     s := WriteStream on:ByteArray new.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1691
     Rectangle storeBinaryOn:s.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1692
     Object readBinaryFrom:(ReadStream on:s contents)  
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1693
    "
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1694
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1695
    "Modified: 19.3.1997 / 18:47:10 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1696
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1697
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1698
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1699
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1700
addChangeRecordForChangeCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1701
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1702
6097
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1703
    "add a category change"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1704
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1705
    Class updateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1706
	self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
6097
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1707
    ].
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1708
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1709
    "this test allows a smalltalk without Projects/ChangeSets"
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1710
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1711
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1712
	    Project addClassDefinitionChangeFor:self
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1713
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1714
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1715
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1716
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1717
addChangeRecordForClass:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1718
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1719
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1720
    "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
  1721
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1722
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1723
	self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1724
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1725
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1726
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1727
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1728
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1729
	    Project addClassDefinitionChangeFor:aClass 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1730
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1731
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1732
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1733
    "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
  1734
    "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
  1735
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1736
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1737
addChangeRecordForClassCheckIn:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1738
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1739
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1740
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1741
1938
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1742
    |rv|
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1743
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1744
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1745
	rv := aClass revision.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1746
	rv isNil ifTrue:[rv := '???'].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1747
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1748
	self 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1749
	    writingChangeWithTimeStamp:false 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1750
	    perform:#addInfoRecord:to: 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1751
	    with:('checkin ' , aClass name , ' (' , rv , ')').
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1752
    ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1753
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1754
    "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
  1755
    "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
  1756
    "Modified: / 18.3.1999 / 18:14:14 / stefan"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1757
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1758
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1759
addChangeRecordForClassComment:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1760
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1761
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1762
    "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
  1763
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1764
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1765
	self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1766
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1767
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1768
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1769
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1770
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1771
	    Project addClassCommentChangeFor:aClass
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1772
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1773
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1774
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1775
    "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
  1776
    "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
  1777
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1778
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1779
addChangeRecordForClassContainerRemove:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1780
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1781
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1782
    "append a container-was-removed-record to the changes file"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1783
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1784
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1785
	self 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1786
	    writingChangeWithTimeStamp:false 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1787
	    perform:#addInfoRecord:to: 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1788
	    with:('removed source container of ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1789
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1790
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1791
    "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
  1792
    "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
  1793
    "Modified: / 18.3.1999 / 18:14:31 / stefan"
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1794
!
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1795
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1796
addChangeRecordForClassFileOut:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1797
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1798
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1799
    "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
  1800
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1801
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1802
	self 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1803
	    writingChangeWithTimeStamp:false 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1804
	    perform:#addInfoRecord:to: 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1805
	    with:('fileOut ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1806
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1807
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1808
    "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
  1809
    "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
  1810
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1811
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1812
addChangeRecordForClassInstvars:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1813
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1814
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1815
    "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
  1816
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1817
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1818
	self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1819
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1820
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1821
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1822
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1823
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1824
	    Project addInstVarDefinitionChangeFor:aClass class
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1825
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1826
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1827
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1828
    "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
  1829
    "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
  1830
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1831
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1832
addChangeRecordForClassRemove
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1833
    "{ Pragma: +optSpace }"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1834
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1835
    "add a class-remove-record to the changes file"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1836
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1837
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1838
	self writingChangePerform:#addChangeRecordForClassRemove:to: with:self.
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1839
    ].
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1840
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1841
    "this test allows a smalltalk without Projects/ChangeSets"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1842
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1843
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1844
	    Project addClassRemoveChange:self
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1845
	]
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1846
    ]
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1847
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1848
    "Modified: / 24.1.1997 / 19:10:25 / cg"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1849
    "Modified: / 18.3.1999 / 18:14:53 / stefan"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1850
!
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1851
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1852
addChangeRecordForClassRemove:oldClassName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1853
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1854
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1855
    "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
  1856
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1857
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1858
	self writingChangePerform:#addChangeRecordForClassRemove:to: with:self.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1859
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1860
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1861
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1862
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1863
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1864
	    Project addClassRemoveChange:self
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1865
	]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1866
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1867
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1868
    "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
  1869
    "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
  1870
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1871
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1872
addChangeRecordForClassRename:oldName to:newName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1873
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1874
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1875
    "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
  1876
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1877
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1878
	self writingChangeDo:[:aStream |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1879
	    self addChangeRecordForClassRename:oldName to:newName to:aStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1880
	]
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1881
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1882
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1883
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1884
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1885
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1886
	    Project addClassRenameChangeFrom:oldName to:newName
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1887
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1888
    ]
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1889
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1890
    "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
  1891
    "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
  1892
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1893
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1894
addChangeRecordForPrimitiveDefinitions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1895
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1896
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1897
    "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
  1898
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1899
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1900
	self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1901
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1902
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1903
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1904
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1905
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1906
	    Project addPrimitiveDefinitionsChangeFor:aClass
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1907
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1908
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1909
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1910
    "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
  1911
    "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
  1912
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1913
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1914
addChangeRecordForPrimitiveFunctions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1915
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1916
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1917
    "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
  1918
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1919
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1920
	self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1921
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1922
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1923
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1924
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1925
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1926
	    Project addPrimitiveFunctionsChangeFor:aClass
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1927
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1928
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1929
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1930
    "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
  1931
    "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
  1932
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1933
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1934
addChangeRecordForPrimitiveVariables:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1935
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1936
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1937
    "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
  1938
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1939
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1940
	self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1941
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1942
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1943
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1944
    Project notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1945
	UpdateChangeListQuerySignal query ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1946
	    Project addPrimitiveVariablesChangeFor:aClass
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1947
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1948
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1949
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1950
    "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
  1951
    "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
  1952
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1953
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1954
addChangeRecordForSnapshot:aFileName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1955
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1956
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1957
    "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
  1958
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1959
    UpdateChangeFileQuerySignal query ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1960
	self 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1961
	    writingChangeWithTimeStamp:false 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1962
	    perform:#addChangeRecordForSnapshot:to: 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  1963
	    with:aFileName.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1964
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1965
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1966
    "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
  1967
    "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
  1968
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1969
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1970
addChangeRecordForSnapshot:aFileName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1971
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1972
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1973
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1974
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1975
    self addInfoRecord:('snapshot ' , aFileName) to:aStream
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1976
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1977
    "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
  1978
    "Modified: / 18.3.1999 / 18:15:30 / stefan"
2917
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  1979
! !
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  1980
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1981
!Class methodsFor:'enumerating'!
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1982
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1983
allPrivateClassesDo:aBlock
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1984
    "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
  1985
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1986
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1987
    self allPrivateClasses do:aBlock 
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1988
!
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1989
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1990
privateClassesDo:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1991
    "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
  1992
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1993
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1994
    self privateClasses do:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1995
!
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1996
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1997
subclassesDo:aBlock
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  1998
    "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
  1999
     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
  2000
     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
  2001
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2002
    |coll|
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2003
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2004
    "/ 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
  2005
    "/ if possible
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2006
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2007
    SubclassInfo isNil ifTrue:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2008
        Class subclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2009
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2010
    SubclassInfo notNil ifTrue:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2011
        coll := SubclassInfo at:self ifAbsent:nil.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2012
        coll notNil ifTrue:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2013
            coll do:aBlock.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2014
        ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2015
        ^ self
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2016
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2017
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2018
    Smalltalk allClassesDo:[:aClass |
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2019
        (aClass superclass == self) ifTrue:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2020
            aBlock value:aClass
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2021
        ]
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2022
    ]
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2023
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2024
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2025
     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
  2026
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2027
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2028
    "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
  2029
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2030
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2031
withAllPrivateClassesDo:aBlock
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2032
    "evaluate aBlock on myself and all of my private classes (if any).
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2033
     This recurses into private classes of private classes.
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2034
     Evaluation is in no particular order."
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2035
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2036
    aBlock value:self.
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2037
    self allPrivateClasses do:aBlock 
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2038
! !
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2039
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2040
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2041
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2042
primitiveDefinitions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2043
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2044
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2045
     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
  2046
     unprocessed contents in the classes primitiveDefinitions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2047
     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
  2048
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2049
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2050
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2051
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2052
    "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
  2053
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2054
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2055
primitiveFunctions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2056
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2057
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2058
     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
  2059
     unprocessed contents in the classes primitiveFunctions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2060
     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
  2061
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2062
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2063
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2064
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2065
    "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
  2066
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2067
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2068
primitiveVariables
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2069
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2070
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2071
     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
  2072
     unprocessed contents in the classes primitiveVariables section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2073
     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
  2074
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2075
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2076
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2077
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2078
    "Modified: 10.2.1996 / 12:47:28 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2079
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2080
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2081
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2082
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2083
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2084
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  2085
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2086
    self
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2087
	basicFileOutDefinitionOn:aStream 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2088
	withNameSpace:forceNameSpace 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2089
	withPackage:true
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2090
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2091
!
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2092
6520
430a6d467003 fileout private classes (no namespace prefix)
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  2093
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
  2094
    "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
  2095
7617
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7611
diff changeset
  2096
    self class 
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7611
diff changeset
  2097
        basicFileOutDefinitionOf:self
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7611
diff changeset
  2098
        on:aStream 
a557bbe96ef1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7611
diff changeset
  2099
        withNameSpace:forceNameSpace withPackage:showPackage 
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2100
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2101
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2102
basicFileOutInstvarTypeKeywordOn:aStream
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2103
    "a helper for fileOutDefinition"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2104
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2105
    |isVar superclass|
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2106
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2107
    superclass := self superclass.
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2108
    superclass isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2109
	isVar := self isVariable
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2110
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2111
	"I cant remember what this is for ?"
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2112
	isVar := (self isVariable and:[superclass isVariable not])
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2113
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2114
3920
0c1b9b2fa23b added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents: 3788
diff changeset
  2115
    aStream nextPutAll:(self firstDefinitionSelectorPart).
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2116
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2117
    "Created: 11.10.1996 / 18:57:29 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2118
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2119
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2120
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2121
    "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
  2122
     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
  2123
     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
  2124
     directory. Care is taken, to not clobber any existing file in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2125
     case of errors (for example: disk full). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2126
     Also, since the classes methods need a valid sourcefile, the current 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2127
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2128
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2129
    |dirName nm fileName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2130
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2131
    nm := (Smalltalk fileNameForClass:self name) , '.st'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2132
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2133
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2134
     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
  2135
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2136
    Project notNil ifTrue:[
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2137
        dirName := Project currentProjectDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2138
    ] ifFalse:[
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2139
        dirName := Filename currentDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2140
    ].
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2141
    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
  2142
    fileName makeLegalFilename.
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2143
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2144
    self fileOutAs:fileName name.
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2145
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2146
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2147
"/     add a change record; that way, administration is much easier,
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2148
"/     since we can see in that changeBrowser, which changes have 
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2149
"/     already found their way into a sourceFile and which must be
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2150
"/     applied again
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2151
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2152
"/    self addChangeRecordForClassFileOut:self
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2153
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2154
    "Modified: / 7.6.1996 / 09:14:43 / stefan"
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2155
    "Modified: / 27.8.1998 / 02:02:57 / cg"
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2156
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2157
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2158
fileOutAllDefinitionsOn:aStream
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2159
    "append expressions on aStream, which defines myself and all of my private classes."
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2160
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2161
    self fileOutDefinitionOn:aStream.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2162
    aStream nextPutChunkSeparator. 
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2163
    aStream cr; cr.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2164
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2165
    "/
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2166
    "/ optional classInstanceVariables
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2167
    "/
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2168
    self class instanceVariableString isBlank ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2169
	self fileOutClassInstVarDefinitionOn:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2170
	aStream nextPutChunkSeparator. 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2171
	aStream cr; cr
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2172
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2173
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2174
    "/ here, the full nameSpace prefixes are output,
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2175
    "/ to avoid confusing stc 
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2176
    "/ (which otherwise could not find the correct superclass)
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2177
    "/
6520
430a6d467003 fileout private classes (no namespace prefix)
Claus Gittinger <cg@exept.de>
parents: 6409
diff changeset
  2178
    FileOutNameSpaceQuerySignal answer:false do:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2179
	ForceNoNameSpaceQuerySignal answer:true do:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2180
	    self privateClassesSorted do:[:aClass |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2181
		 aClass fileOutAllDefinitionsOn:aStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2182
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2183
	]
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2184
    ].
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2185
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2186
    "Created: 15.10.1996 / 11:15:19 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2187
    "Modified: 22.3.1997 / 16:11:56 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2188
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2189
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2190
fileOutAllMethodsOn:aStream
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2191
    self fileOutAllMethodsOn:aStream methodFilter:nil
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2192
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2193
    "Created: 15.10.1996 / 11:13:00 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2194
    "Modified: 22.3.1997 / 16:12:17 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2195
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2196
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2197
fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2198
    |collectionOfCategories|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2199
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2200
    collectionOfCategories := self class categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2201
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2202
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2203
	    self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2204
	    aStream cr
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2205
	]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2206
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2207
    collectionOfCategories := self categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2208
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2209
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2210
	    self fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2211
	    aStream cr
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2212
	]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2213
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2214
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2215
    self privateClassesSorted do:[:aClass |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2216
	aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2217
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2218
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2219
    "Created: 15.10.1996 / 11:13:00 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2220
    "Modified: 22.3.1997 / 16:12:17 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2221
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2222
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2223
fileOutAs:fileNameString
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2224
    "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
  2225
     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
  2226
     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
  2227
     Care is taken, to not clobber any existing file in
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2228
     case of errors (for example: disk full). 
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2229
     Also, since the classes methods need a valid sourcefile, the current 
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2230
     sourceFile may not be rewritten."
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2231
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2232
    |aStream fileName newFileName savFilename needRename
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2233
     mySourceFileName sameFile s mySourceFileID anySourceRef|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2234
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2235
    self isLoaded ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2236
	^ FileOutErrorSignal 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2237
	    raiseRequestWith:self
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2238
		 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
  2239
    ].
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2240
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2241
    fileName := fileNameString asFilename.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2242
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2243
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2244
     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
  2245
     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
  2246
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2247
    "
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2248
    (fileName exists) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2249
	sameFile := false.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2250
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2251
	"/ check carefully - maybe, my source does not really come from that
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2252
	"/ file (i.e. all of my methods have their source as string)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2253
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2254
	anySourceRef := false.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2255
	self instAndClassMethodsDo:[:m |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2256
	    m sourcePosition notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2257
		anySourceRef := true
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2258
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2259
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2260
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2261
	anySourceRef ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2262
	    s := self sourceStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2263
	    s notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2264
		mySourceFileID := s pathName asFilename info id.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2265
		sameFile := (fileName info id) == mySourceFileID.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2266
		s close.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2267
	    ] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2268
		classFilename notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2269
		    "
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2270
		     check for overwriting my current source file
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2271
		     this is not allowed, since it would clobber my methods source
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2272
		     file ... you have to save it to some other place.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2273
		     This happens if you ask for a fileOut into the source-directory
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2274
		     (from which my methods get their source)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2275
		    "
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2276
		    mySourceFileName := Smalltalk getSourceFileName:classFilename. 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2277
		    sameFile := (fileNameString = mySourceFileName).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2278
		    sameFile ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2279
			mySourceFileName notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2280
			    sameFile := (fileName info id) == (mySourceFileName asFilename info id)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2281
			]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2282
		    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2283
		]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2284
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2285
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2286
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2287
	sameFile ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2288
	    ^ FileOutErrorSignal 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2289
		raiseRequestWith:fileNameString
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2290
		errorString:(' - may not overwrite sourcefile:', fileNameString)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2291
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2292
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2293
	savFilename := Filename newTemporary.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2294
	fileName copyTo:savFilename.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2295
	newFileName := fileName withSuffix:'new'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2296
	needRename := true
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2297
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2298
	"/ another possible trap: if my sourceFileName is
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2299
	"/ the same as the written one AND the new files directory
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2300
	"/ is along the sourcePath, we also need a temporary file
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2301
	"/ first, to avoid accessing the newly written file.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2302
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2303
	anySourceRef := false.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2304
	self instAndClassMethodsDo:[:m |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2305
	    |mSrc|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2306
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2307
	    (mSrc := m sourceFilename) notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2308
		mSrc asFilename baseName = fileName baseName ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2309
		    anySourceRef := true
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2310
		]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2311
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2312
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2313
	anySourceRef ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2314
	    newFileName := fileName withSuffix:'new'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2315
	    needRename := true
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2316
	] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2317
	    newFileName := fileName.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2318
	    needRename := false
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2319
	]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2320
    ].
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2321
    [
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2322
	aStream := newFileName writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2323
    ] on:FileStream openErrorSignal do:[:ex|
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2324
	savFilename notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2325
	    savFilename delete
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2326
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2327
	^ FileOutErrorSignal 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2328
		raiseRequestWith:newFileName
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2329
		errorString:(' - cannot create file:', newFileName name)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2330
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2331
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2332
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2333
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2334
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2335
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2336
     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
  2337
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2338
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2339
    needRename ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2340
	newFileName copyTo:fileName.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2341
	newFileName delete
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2342
    ].
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2343
    savFilename notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2344
	savFilename delete
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2345
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2346
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
     add a change record; that way, administration is much easier,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2349
     since we can see in that changeBrowser, which changes have 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2350
     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
  2351
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2352
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2353
    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
  2354
3180
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2355
    "Modified: / 7.6.1996 / 09:14:43 / stefan"
1c225dd8c5b2 care for target file being in the sourcePath, when filing out (fileOut to tempFile first)
Claus Gittinger <cg@exept.de>
parents: 3165
diff changeset
  2356
    "Created: / 16.4.1997 / 20:44:05 / cg"
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2357
    "Modified: / 12.8.1998 / 11:14:56 / cg"
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2358
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2359
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2360
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2361
    "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
  2362
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2363
    self
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2364
	fileOutClassInstVarDefinitionOn:aStream 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2365
	withNameSpace:false
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2366
!
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2367
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2368
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2369
    "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
  2370
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2371
    |anySuperClassInstVar|
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2372
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2373
    self isLoaded ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2374
	^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2375
    ].
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2376
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2377
    withNameSpace ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2378
	self name printOn:aStream.
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2379
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2380
	self printClassNameOn:aStream.
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2381
    ].
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2382
    aStream nextPutAll:' class instanceVariableNames:'''.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2383
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2384
    aStream nextPutAll:''''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2385
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2386
    "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
  2387
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2388
    anySuperClassInstVar := false.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2389
    self allSuperclassesDo:[:aSuperClass |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2390
	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
  2391
    ].
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2392
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2393
    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
  2394
    anySuperClassInstVar ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2395
	aStream  
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2396
	    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
  2397
    ] ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2398
	aStream  
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2399
	    nextPutLine:'The following class instance variables are inherited by this class:'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2400
	aStream cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2401
	self allSuperclassesDo:[:aSuperClass |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2402
	    aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2403
	    aStream nextPutLine:(aSuperClass class instanceVariableString).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2404
	].
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2405
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2406
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2407
    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
  2408
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2409
    "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
  2410
    "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
  2411
    "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
  2412
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2413
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2414
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2415
    "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
  2416
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2417
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2418
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2419
    self printClassNameOn:aStream.
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2420
    aStream nextPutAll:' comment:'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2421
    (comment := self comment) isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2422
	s := ''''''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2423
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2424
	s := comment storeString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2425
    ].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2426
    aStream nextPutAllAsChunk:s.
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  2427
    aStream nextPutChunkSeparator.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2428
    aStream cr
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2429
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2430
    "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
  2431
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2432
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2433
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2434
    "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
  2435
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2436
    ^ 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
  2437
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2438
    "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
  2439
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2440
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2441
fileOutIn:aDirectoryName
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2442
    "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
  2443
     directory aDirectoryName (ignoring any directory setting in
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2444
     the current project). 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2445
     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
  2446
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2447
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2448
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2449
    fileName := (Smalltalk fileNameForClass:self name), '.st'.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2450
    [
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2451
	aStream := (aDirectoryName asFilename construct:fileName) writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2452
    ] on:FileStream openErrorSignal do:[:ex|
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2453
	^ FileOutErrorSignal 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2454
		raiseRequestWith:fileName
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2455
		errorString:(' - cannot create file:', fileName)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2456
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2457
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2458
    aStream close
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2459
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2460
    "
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2461
	self fileOutIn:'/tmp'
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2462
	self fileOutIn:'/tmp/doesNotExistBla'
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2463
	self fileOutIn:'/tmp' asFilename
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2464
    "
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2465
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2466
    "Modified: 19.9.1997 / 00:03:53 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2467
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2468
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2469
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2470
    "file out my definition and all methods onto aStream"
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
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2473
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2474
    "Created: 15.11.1995 / 12:53:32 / cg"
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2475
    "Modified: 3.1.1997 / 17:50:28 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2476
!
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
fileOutOn:aStream withTimeStamp:stampIt
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2479
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2480
     If stampIt is true, a timeStamp comment is prepended."
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2481
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2482
    self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2483
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2484
    "Modified: / 13.3.1998 / 12:23:02 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2485
!
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2486
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2487
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2488
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2489
     If stampIt is true, a timeStamp comment is prepended.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2490
     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
  2491
     append a corresponding doIt expression for initialization."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2492
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2493
    self 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2494
	fileOutOn:aStream 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2495
	withTimeStamp:stampIt 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2496
	withInitialize:initIt 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2497
	withDefinition:true
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2498
	methodFilter:nil
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2499
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2500
    "Created: / 15.11.1995 / 12:53:06 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2501
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2502
    "Modified: / 13.3.1998 / 12:23:59 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2503
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2504
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2505
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
  2506
    "file out my definition and all methods onto aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2507
     If stampIt is true, a timeStamp comment is prepended.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2508
     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
  2509
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2510
     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
  2511
     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
  2512
8075
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2513
    |encoding encoder|
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2514
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2515
    encoding := Class defaultExternalEncoding.
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2516
    encoding notNil ifTrue:[
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2517
        encoder := CharacterEncoder encoderFor:encoding
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2518
    ].
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2519
    ^ self
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2520
        fileOutOn:aStream 
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2521
        withTimeStamp:stampIt 
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2522
        withInitialize:initIt 
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2523
        withDefinition:withDefinition 
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2524
        methodFilter:methodFilter 
8075
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2525
        encoder:encoder
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2526
!
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2527
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2528
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
  2529
    "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
  2530
     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
  2531
     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
  2532
     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
  2533
     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
  2534
     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
  2535
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2536
    |collectionOfCategories copyrightMethod copyrightText comment versionMethod skippedMethods
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2537
     meta classesImplementingInitialize outStream|
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2538
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2539
    self isLoaded ifFalse:[
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2540
        ^ FileOutErrorSignal 
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2541
            raiseRequestWith:self
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2542
                 errorString:' - will not fileOut unloaded class: ', self name
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2543
    ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2544
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2545
    encoderOrNil isNil ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2546
        outStream := outStreamArg.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2547
    ] ifFalse:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2548
        outStream := EncodedStream stream:outStreamArg encoder:encoderOrNil.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2549
        outStream nextPutAll:'"{ Encoding: ' , encoderOrNil nameOfEncoding , ' }"'; cr; cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2550
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2551
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2552
    meta := self theMetaclass.
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2553
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2554
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2555
     if there is a copyright method, add a copyright comment
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2556
     at the beginning, taking the string from the copyright method.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2557
     We cannot do this unconditionally - that would lead to my copyrights
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2558
     being put on your code ;-).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2559
     On the other hand: I want every file created by myself to have the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2560
     copyright string at the beginning be preserved .... even if the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2561
     code was edited in the browser and filedOut.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2562
    "
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2563
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2564
        "
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2565
         get the copyright methods source,
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2566
         and insert at beginning.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2567
        "
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2568
        copyrightText := copyrightMethod source.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2569
        copyrightText isNil ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2570
            "
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2571
             no source available - trigger an error
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2572
            "
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2573
            FileOutErrorSignal
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2574
                raiseRequestWith:'no source for class ' , self name , ' available. Cannot fileOut'.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2575
            ^ self
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2576
        ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2577
        "
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2578
         strip off the selector-line
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2579
        "
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2580
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2581
        copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2582
"/        copyrightText do:[:line | outStream nextPutAll:line. aStream cr.].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2583
        copyrightText := copyrightText asString.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2584
        outStream nextPutAllAsChunk:copyrightText.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2585
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2586
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2587
    stampIt ifTrue:[
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2588
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2589
        "/ first, a timestamp
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2590
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2591
        outStream nextPutAll:(Smalltalk timeStamp).
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2592
        outStream nextPutChunkSeparator. 
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2593
        outStream cr; cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2594
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2595
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2596
    withDefinition ifTrue:[
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2597
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2598
        "/ then the definition(s)
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2599
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2600
        self fileOutAllDefinitionsOn:outStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2601
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2602
        "/ a comment - if any
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2603
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2604
        (comment := self comment) notNil ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2605
            self fileOutCommentOn:outStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2606
            outStream cr.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2607
        ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2608
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2609
        "/ primitive definitions - if any
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2610
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2611
        self fileOutPrimitiveSpecsOn:outStream.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2612
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2613
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2614
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2615
    "/ methods from all categories in metaclass (i.e. class methods)
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2616
    "/ EXCEPT: the version method is placed at the very end, to
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2617
    "/         avoid sourcePosition-shifts when checked out later.
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  2618
    "/         (RCS expands this string, so its size is not constant)
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2619
    "/
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2620
    collectionOfCategories := meta categories asSortedCollection.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2621
    collectionOfCategories notNil ifTrue:[
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2622
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2623
        "/ documentation first (if any), but not the version method
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2624
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2625
        (collectionOfCategories includes:'documentation') ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2626
            versionMethod := meta compiledMethodAt:(self nameOfVersionMethod).
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2627
            versionMethod notNil ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2628
                skippedMethods := Array with:versionMethod
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2629
            ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2630
            meta fileOutCategory:'documentation' except:skippedMethods only:nil methodFilter:methodFilter on:outStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2631
            outStream cr.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2632
        ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2633
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2634
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2635
        "/ initialization next (if any)
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2636
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2637
        (collectionOfCategories includes:'initialization') ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2638
            meta fileOutCategory:'initialization' methodFilter:methodFilter on:outStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2639
            outStream cr.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2640
        ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2641
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2642
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2643
        "/ instance creation next (if any)
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2644
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2645
        (collectionOfCategories includes:'instance creation') ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2646
            meta fileOutCategory:'instance creation' methodFilter:methodFilter on:outStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2647
            outStream cr.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2648
        ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2649
        collectionOfCategories do:[:aCategory |
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2650
            ((aCategory ~= 'documentation')
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2651
            and:[(aCategory ~= 'initialization')
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2652
            and:[aCategory ~= 'instance creation']]) ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2653
                meta fileOutCategory:aCategory methodFilter:methodFilter on:outStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2654
                outStream cr
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2655
            ]
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2656
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2657
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2658
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2659
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2660
    "/ methods from all categories in myself
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2661
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2662
    collectionOfCategories := self categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2663
    collectionOfCategories notNil ifTrue:[
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2664
        collectionOfCategories do:[:aCategory |
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2665
            self fileOutCategory:aCategory methodFilter:methodFilter on:outStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2666
            outStream cr
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2667
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2668
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2669
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2670
    "/
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2671
    "/ any private classes' methods
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2672
    "/
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2673
    self privateClassesSorted do:[:aClass |
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2674
        aClass fileOutAllMethodsOn:outStream methodFilter:methodFilter
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2675
    ].
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2676
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2677
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2678
    "/
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2679
    "/ finally, the previously skipped version method
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2680
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2681
    versionMethod notNil ifTrue:[
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2682
        meta fileOutCategory:'documentation' except:nil only:skippedMethods methodFilter:methodFilter on:outStream.
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2683
    ].
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2684
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2685
    initIt ifTrue:[
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2686
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2687
        "/ optionally an initialize message
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2688
        "/
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2689
        classesImplementingInitialize := OrderedCollection new.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2690
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2691
        (meta includesSelector:#initialize) ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2692
            classesImplementingInitialize add:self
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2693
        ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2694
        self privateClassesSorted do:[:aPrivateClass |
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2695
            (aPrivateClass theMetaclass includesSelector:#initialize) ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2696
                classesImplementingInitialize add:aPrivateClass
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2697
            ]
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2698
        ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2699
        classesImplementingInitialize size ~~ 0 ifTrue:[
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2700
            classesImplementingInitialize topologicalSort:[:a :b | b isSubclassOf:a].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2701
            outStream cr.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2702
            classesImplementingInitialize do:[:eachClass |
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2703
                eachClass printClassNameOn:outStream. outStream nextPutAll:' initialize'.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2704
                outStream nextPutChunkSeparator.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2705
                outStream cr.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2706
            ].
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2707
        ].
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2708
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2709
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2710
    "Created: / 15.11.1995 / 12:53:06 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2711
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2712
    "Modified: / 13.3.1998 / 12:23:59 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2713
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2714
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2715
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2716
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2717
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2718
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2719
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2720
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2721
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2722
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2723
    (s := self primitiveDefinitionsString) notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2724
	aStream nextPutChunkSeparator.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2725
	self printClassNameOn:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2726
	aStream nextPutAll:' primitiveDefinitions';
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2727
		nextPutChunkSeparator;
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2728
		cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2729
	aStream nextPutAll:s.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2730
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2731
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2732
    (s := self primitiveVariablesString) notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2733
	aStream nextPutChunkSeparator.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2734
	self printClassNameOn:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2735
	aStream nextPutAll:' primitiveVariables';
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2736
		nextPutChunkSeparator;
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2737
		cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2738
	aStream nextPutAll:s.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2739
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2740
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2741
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2742
    "Modified: 8.1.1997 / 17:45:40 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2743
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2744
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2745
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2746
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2747
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2748
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2749
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2750
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2751
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2752
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2753
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2754
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2755
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2756
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2757
    (s := self primitiveFunctionsString) notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2758
	aStream nextPutChunkSeparator.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2759
	self printClassNameOn:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2760
	aStream nextPutAll:' primitiveFunctions';
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2761
		nextPutChunkSeparator;
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2762
		cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2763
	aStream nextPutAll:s.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2764
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2765
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2766
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2767
    "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
  2768
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2769
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2770
!Class methodsFor:'fileOut-binary'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2771
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2772
binaryFileOut
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2773
    "create a file 'class.cls' (in the current projects fileOut-directory),
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2774
     consisting of all methods in myself in a portable binary format. 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2775
     The methods source is saved by reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2776
     to the classes sourceFile if there is any.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2777
     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
  2778
     browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2779
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2780
    self binaryFileOutWithSourceMode:#reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2781
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2782
    "Modified: 5.1.1997 / 15:40:05 / cg"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2783
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2784
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2785
binaryFileOutOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2786
    "append a binary representation of myself to aStream"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2787
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2788
    self binaryFileOutOn:aStream sourceMode:#reference 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2789
!
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
binaryFileOutOn:aStream sourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2792
    "append a binary representation of myself to aStream in
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2793
     a portable binary format. 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2794
     The argument controls how sources are to be saved:
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2795
	#keep - include the source
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2796
	#reference - include a reference to the sourceFile
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2797
	#discard - dont save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2798
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2799
     With #reference, the sourceFile needs to be present after reload 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2800
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2801
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2802
    |bos|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2803
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2804
    bos := BinaryObjectStorage onNew:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2805
    bos sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2806
    bos nextPutClasses:(Array with:self).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2807
    bos close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2808
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2809
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2810
binaryFileOutWithSourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2811
    "create a file 'class.cls' (in the current projects fileOut-directory),
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2812
     consisting of all methods in myself in a portable binary format. 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2813
     The argument controls how sources are to be saved:
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2814
        #keep - include the source
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2815
        #reference - include a reference to the sourceFile
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2816
        #discard - dont save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2817
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2818
     With #reference, the sourceFile needs to be present after reload 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2819
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2820
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2821
    |fileName dirName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2822
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2823
    fileName := (Smalltalk fileNameForClass:self name) , '.cls'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2824
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2825
    Project notNil ifTrue:[
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2826
        dirName := Project currentProjectDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2827
    ] ifFalse:[
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2828
        dirName := '.'
5374
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
    fileName := dirName asFilename construct:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2831
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2832
    fileName := fileName name.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2833
    self binaryFileOutWithSourceMode:sourceMode as:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2834
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2835
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2836
binaryFileOutWithSourceMode:sourceMode as:fileNameString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2837
    "create a file fileNameString,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2838
     consisting of all methods in myself in a portable binary format. 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2839
     The argument controls how sources are to be saved:
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2840
	#keep - include the source
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2841
	#reference - include a reference to the sourceFile
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2842
	#discard - dont save sources.
5374
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
     With #reference, the sourceFile needs to be present after reload 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2845
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2846
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2847
    |fileName aStream|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2848
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2849
    fileName := fileNameString asFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2850
    fileName makeLegalFilename.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2851
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2852
    [
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2853
	aStream := fileName newReadWriteStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2854
    ] on:FileStream openErrorSignal do:[:ex|
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2855
	^ FileOutErrorSignal 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2856
		raiseRequestWith:fileName name
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2857
		errorString:(' - cannot create file:', fileName name)
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2858
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2859
        
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2860
    aStream binary.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2861
    self binaryFileOutOn:aStream sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2862
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2863
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2864
    "Created: / 29.12.1998 / 21:38:38 / cg"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2865
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2866
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2867
!Class methodsFor:'fileOut-xml'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2868
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2869
fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2870
    "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
  2871
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2872
     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
  2873
     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
  2874
     case of errors (for example: disk full)"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2875
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2876
    |dirName nm fileName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2877
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2878
    nm := (Smalltalk fileNameForClass:self name) , '.xml'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2879
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2880
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2881
     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
  2882
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2883
    Project notNil ifTrue:[
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2884
        dirName := Project currentProjectDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2885
    ] ifFalse:[
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2886
        dirName := Filename currentDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2887
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2888
    fileName := (dirName asFilename construct:nm).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2889
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2890
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2891
    self fileOutXMLAs:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2892
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
     Class fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2895
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2896
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2897
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2898
fileOutXMLAllDefinitionsOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2899
    "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
  2900
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2901
    self fileOutXMLDefinitionOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2902
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2903
    "/ here, the full nameSpace prefixes are output,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2904
    "/ to avoid confusing stc 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2905
    "/ (which otherwise could not find the correct superclass)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2906
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2907
    FileOutNameSpaceQuerySignal answer:true do:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2908
	self privateClassesSorted do:[:aClass |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2909
	    aClass fileOutXMLAllDefinitionsOn:aStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2910
	]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2911
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2912
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2913
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
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2916
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2917
    |collectionOfCategories|
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2918
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2919
    collectionOfCategories := self class categories asSortedCollection.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2920
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2921
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2922
	    self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2923
	    aStream cr
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2924
	]
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2925
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2926
    collectionOfCategories := self categories asSortedCollection.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2927
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2928
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2929
	    self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2930
	    aStream cr
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2931
	]
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2932
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2933
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2934
    self privateClassesSorted do:[:aClass |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2935
	aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2936
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2937
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2938
!
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2939
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2940
fileOutXMLAs:fileNameOrString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2941
    "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
  2942
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2943
     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
  2944
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2945
    |aStream fileName|
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
    self isLoaded ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2948
	^ FileOutErrorSignal 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2949
	    raiseRequestWith:self
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2950
		 errorString:' - will not fileOut unloaded class: ', self name
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2951
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2952
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2953
    fileName := fileNameOrString asFilename.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2954
    [
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2955
	aStream := fileName writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2956
    ] on:FileStream openErrorSignal do:[:ex|
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2957
	^ FileOutErrorSignal 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2958
		raiseRequestWith:fileName
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  2959
		errorString:(' - cannot create file: ', fileName name)
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2960
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2961
    self fileOutXMLOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2962
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2963
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2964
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2965
     Class fileOutXMLAs:'test.xml'
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2966
     Class fileOutXMLAs:'/blaDoesNotExist/test.xml'
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2967
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2968
!
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
fileOutXMLDefinitionOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2971
    "append an xml expression on aStream, which defines myself."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2972
6703
ffea6ebb676d Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 6701
diff changeset
  2973
    |varNames|
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2974
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2975
    aStream nextPutLine:'<class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2976
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2977
    aStream nextPutAll:'  <name>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2978
    aStream nextPutAll:(self nameWithoutPrefix).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2979
    aStream nextPutLine:'</name>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2980
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2981
    aStream nextPutAll:'  <environment>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2982
    aStream nextPutAll:(self nameSpace name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2983
    aStream nextPutLine:'</environment>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2984
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2985
    aStream nextPutAll:'  <super>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2986
    aStream nextPutAll:(self theNonMetaclass superclass name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2987
    aStream nextPutLine:'</super>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2988
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2989
    aStream nextPutAll:'  <private>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2990
    aStream nextPutAll:(self isPrivate printString).
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2991
    aStream nextPutLine:'</private>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2992
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2993
    aStream nextPutAll:'  <indexed-type>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2994
    aStream nextPutAll:'none'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2995
    aStream nextPutLine:'</indexed-type>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2996
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2997
    aStream nextPutAll:'  <inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2998
    varNames := self instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2999
    varNames size > 0 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3000
	aStream cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3001
	varNames do:[:nm |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3002
	    aStream nextPutAll:'    <name>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3003
	    aStream nextPutAll:nm.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3004
	    aStream nextPutLine:'</name>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3005
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3006
	aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3007
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3008
    aStream nextPutLine:'</inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3009
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3010
    aStream nextPutAll:'  <class-inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3011
    varNames := self class instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3012
    varNames size > 0 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3013
	aStream cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3014
	varNames do:[:nm |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3015
	    aStream nextPutAll:'    <name>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3016
	    aStream nextPutAll:nm.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3017
	    aStream nextPutLine:'</name>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3018
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3019
	aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3020
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3021
    aStream nextPutLine:'</class-inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3022
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3023
    aStream nextPutAll:'  <imports>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3024
    aStream nextPutAll:''.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3025
    aStream nextPutLine:'</imports>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3026
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3027
    aStream nextPutAll:'  <category>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3028
    aStream nextPutAll:self category.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3029
    aStream nextPutLine:'</category>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3030
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3031
    aStream nextPutLine:'</class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3032
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3033
    varNames := self classVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3034
    varNames size > 0 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3035
	varNames do:[:nm |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3036
	    aStream nextPutLine:'<static>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3037
	    aStream nextPutAll:' <name>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3038
	    aStream nextPutAll:nm.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3039
	    aStream nextPutLine:'</name>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3040
	    aStream nextPutAll:' <environment>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3041
	    aStream nextPutAll:self name.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3042
	    aStream nextPutLine:'</environment>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3043
	    aStream nextPutLine:'</static>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3044
	].
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3045
    ].
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3046
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3047
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3048
fileOutXMLOn:aStream 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3049
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3050
     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
  3051
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3052
    self
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3053
	fileOutXMLOn:aStream 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3054
	withTimeStamp:true 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3055
	withInitialize:true 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3056
	withDefinition:true 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3057
	methodFilter:nil
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3058
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3059
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3060
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3061
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
  3062
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3063
     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
  3064
     If stampIt is true, a timeStamp comment is prepended.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3065
     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
  3066
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3067
     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
  3068
     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
  3069
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3070
    |collectionOfCategories copyrightMethod copyrightText comment meta|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3071
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3072
    self isLoaded ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3073
	^ FileOutErrorSignal 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3074
	    raiseRequestWith:self
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3075
		 errorString:' - will not fileOut unloaded class: ', self name
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3076
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3077
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3078
    meta := self class.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3079
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3080
    aStream nextPutLine:'<?xml version="1.0"?>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3081
    aStream nextPutLine:'<st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3082
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3083
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3084
     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
  3085
     taking the string from the copyright method.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3086
     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
  3087
     being put on your code ;-).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3088
     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
  3089
     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
  3090
     code was edited in the browser and filedOut.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3091
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3092
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3093
	"
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3094
	 get the copyright methods source,
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3095
	 and insert at beginning.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3096
	"
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3097
	copyrightText := copyrightMethod source.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3098
	copyrightText isNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3099
	    "
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3100
	     no source available - trigger an error
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3101
	    "
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3102
	    FileOutErrorSignal
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3103
		raiseRequestWith:' - no source for class: '.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3104
	    ^ self
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3105
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3106
	"
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3107
	 strip off the selector-line
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3108
	"
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3109
	copyrightText := copyrightText asCollectionOfLines asStringCollection.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3110
	copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3111
	[copyrightText last isEmpty] whileTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3112
	    copyrightText := copyrightText copyWithoutLast:1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3113
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3114
	(copyrightText first = '"') ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3115
	    (copyrightText last = '"') ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3116
		copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3117
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3118
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3119
	copyrightText := copyrightText asString.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3120
        
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3121
	aStream nextPutAll:'<copyright>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3122
	self fileOutXMLString:copyrightText on:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3123
	aStream nextPutLine:'</copyright>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3124
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3125
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3126
    stampIt ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3127
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3128
	"/ first, a timestamp
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3129
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3130
	aStream nextPutAll:'<time-stamp>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3131
	self fileOutXMLString:(Smalltalk timeStampString) on:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3132
	aStream nextPutLine:'</time-stamp>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3133
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3134
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3135
    withDefinition ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3136
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3137
	"/ then the definition
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3138
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3139
	self fileOutXMLAllDefinitionsOn:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3140
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3141
	"/ a comment - if any
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3142
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3143
	(comment := self comment) notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3144
	    aStream nextPutLine:'<comment>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3145
	    aStream nextPutAll:'<class-id>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3146
	    aStream nextPutAll:(self name).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3147
	    aStream nextPutLine:'</class-id>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3148
	    aStream nextPutLine:'</comment>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3149
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3150
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3151
	"/ primitive definitions - if any
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3152
	"/
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3153
"/        self fileOutPrimitiveSpecsOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3154
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3155
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3156
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3157
    "/ 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
  3158
    "/ 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
  3159
    "/         avoid sourcePosition-shifts when checked out later.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3160
    "/         (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
  3161
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3162
    collectionOfCategories := meta categories asSortedCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3163
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3164
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3165
	    meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3166
	]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3167
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3168
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3169
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3170
    "/ methods from all categories in myself
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3171
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3172
    collectionOfCategories := self categories asSortedCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3173
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3174
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3175
	    self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3176
	]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3177
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3178
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3179
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3180
    "/ any private classes' methods
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3181
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3182
    self privateClassesSorted do:[:aClass |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3183
	aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3184
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3185
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3186
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3187
    initIt ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3188
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3189
	"/ optionally an initialize message
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3190
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3191
	(meta includesSelector:#initialize) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3192
	    aStream nextPutLine:'<initialize>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3193
	    aStream nextPutAll:'<class-id>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3194
	    aStream nextPutAll:(self name).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3195
	    aStream nextPutLine:'</class-id>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3196
	    aStream nextPutLine:'</initialize>'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3197
	]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3198
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3199
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3200
    aStream nextPutLine:'</st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3201
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3202
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3203
     Class 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3204
	fileOutXMLOn:'test.xml' asFilename writeStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3205
	withTimeStamp:true
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3206
	withInitialize:true 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3207
	withDefinition:true
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3208
	methodFilter:nil
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3209
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3210
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3211
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3212
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3213
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3214
htmlDocumentation
7227
5df22f2ffebc htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents: 7222
diff changeset
  3215
    self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'.
5df22f2ffebc htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents: 7222
diff changeset
  3216
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3217
    ^ HTMLDocGenerator htmlDocOf:self
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3218
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3219
    "Created: 22.3.1997 / 14:18:23 / cg"
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3220
!
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3221
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3222
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3223
    "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
  3224
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3225
    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
  3226
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3227
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3228
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3229
    "print myself and all subclasses on aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3230
     recursively calls itself to print subclasses. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3231
     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
  3232
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3233
    |nm|
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3234
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3235
    nm := self name.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3236
    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
  3237
    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
  3238
    aStream nextPutLine:')'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3239
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3240
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3241
	aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3242
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3243
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3244
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3245
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3246
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3247
     printStream close"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3248
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3249
    "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
  3250
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3251
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3252
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3253
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3254
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  3255
    |comment s superclass|
333
claus
parents: 328
diff changeset
  3256
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3257
    aPrintStream nextPutAll:'class                '; bold; nextPutLine:self name; normal. 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3258
    aPrintStream nextPutAll:'superclass           '.
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  3259
    superclass := self superclass.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3260
    superclass isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3261
	s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3262
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3263
	s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3264
    ].
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3265
    aPrintStream nextPutLine:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3266
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3267
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3268
    self printInstVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3269
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3270
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3271
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3272
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3273
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3274
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3275
    category notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3276
	aPrintStream nextPutAll:'category             '; 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3277
		     nextPutLine:(category printString).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3278
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3279
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  3280
    (comment := self comment) notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3281
	aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3282
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3283
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3284
    "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
  3285
    "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
  3286
    "Modified: 1.4.1997 / 16:01:26 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3287
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3288
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3289
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3290
    "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
  3291
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3292
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3293
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3294
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3295
    aPrintStream cr.
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3296
    collectionOfCategories := self class categories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3297
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3298
	aPrintStream nextPutLine:'class protocol'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3299
	aPrintStream cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3300
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3301
	    self class printOutCategory:aCategory on:aPrintStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3302
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3303
    ].
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3304
    collectionOfCategories := self categories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3305
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3306
	aPrintStream nextPutLine:'instance protocol'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3307
	aPrintStream cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3308
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3309
	    self printOutCategory:aCategory on:aPrintStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3310
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3311
    ]
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3312
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3313
    "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
  3314
!
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3315
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3316
storeOn:aStream
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3317
    "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
  3318
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3319
    aStream nextPutAll:self name
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3320
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3321
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3322
!Class methodsFor:'private-accessing'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3323
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3324
attributes
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3325
    "return the extra class attributes or nil"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3326
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3327
    attributes isArray ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3328
        attributes := ClassAttributes new fromSTCPrimitiveArray:attributes.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3329
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3330
    ^  attributes
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3331
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3332
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3333
attributes:aClassAttributesObject
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3334
    "set the extra class attributes"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3335
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3336
    attributes := aClassAttributesObject
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3337
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3338
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3339
classAttributes
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3340
    "return the extra class attributes or nil"
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3341
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3342
    attributes isArray ifTrue:[
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3343
        attributes := ClassAttributes new fromSTCPrimitiveArray:attributes.
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3344
    ].
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3345
    ^  attributes
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3346
!
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3347
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3348
classAttributes:aClassAttributesObject
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3349
    "set the extra class attributes"
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3350
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3351
    attributes := aClassAttributesObject
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3352
!
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3353
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3354
getAttribute:aKey
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3355
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3356
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3357
    "get an attribute (by symbolic key)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3358
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3359
    attributes isNil ifTrue:[ ^ nil].
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3360
    ^ self classAttributes perform:aKey asSymbol
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3361
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3362
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3363
getSourceChunkAttribute:aKey
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3364
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3365
7472
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3366
    |pos stream string|
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3367
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3368
    pos := self getAttribute:aKey.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3370
    "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
  3371
     position within the classes sourcefile ..."
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3372
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3373
    pos isNumber ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3374
"/        classFilename notNil ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3375
            stream := self sourceStream. 
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3376
            stream notNil ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3377
                stream position0Based:pos.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3378
                string := stream nextChunk.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3379
                stream close.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3380
                ^ string
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3381
            ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3382
"/        ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3383
        ^ nil
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3384
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3385
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3386
    ^ pos
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3387
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3388
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3389
setAttribute:key to:aValue
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3390
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3391
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3392
    attributes isNil ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3393
        attributes := ClassAttributes new.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3394
    ].
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3395
    self classAttributes perform:(key , ':') asSymbol with:aValue
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3396
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3397
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3398
setPrimitiveDefinitions:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3399
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3400
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3401
    "set the primitiveDefinition string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3402
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3403
    ^ self setAttribute:#primitiveDefinitions to:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3404
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3405
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3406
setPrimitiveFunctions:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3407
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3408
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3409
    "set the primitiveFunction string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3410
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3411
    ^ self setAttribute:#primitiveFunctions to:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3412
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3413
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3414
setPrimitiveVariables:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3415
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3416
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3417
    "set the primitiveVariable string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3418
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3419
    ^ 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
  3420
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3421
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3422
setSuperclass:aClass
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3423
    "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
  3424
     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
  3425
     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
  3426
     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
  3427
     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
  3428
     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
  3429
e7542f2dbb9c flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents: 8051
diff changeset
  3430
    SubclassInfo := nil.  "/ flush it
e7542f2dbb9c flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents: 8051
diff changeset
  3431
    superclass := aClass
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3432
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3433
7258
9ccdbee7d1ad method category rename
Claus Gittinger <cg@exept.de>
parents: 7227
diff changeset
  3434
!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
  3435
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3436
addChangeRecordForChangeCategory:category to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3437
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3438
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3439
    "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
  3440
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3441
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3442
    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
  3443
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3444
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3445
    "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
  3446
    "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
  3447
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3448
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3449
addChangeRecordForClass:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3450
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3451
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3452
    "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
  3453
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3454
    aClass isLoaded ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3455
	aClass basicFileOutDefinitionOn:aStream withNameSpace:true.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3456
	aStream nextPutChunkSeparator.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3457
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3458
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3459
    "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
  3460
    "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
  3461
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3462
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3463
addChangeRecordForClassComment:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3464
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3465
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3466
    "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
  3467
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3468
    aClass fileOutCommentOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3469
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3470
    "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
  3471
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3472
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3473
addChangeRecordForClassInstvars:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3474
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3475
5225
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3476
    "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
  3477
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  3478
    aClass 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
  3479
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3480
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3481
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  3482
addChangeRecordForClassRemove:oldClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3483
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3484
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3485
    "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
  3486
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  3487
    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
  3488
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3489
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3490
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3491
addChangeRecordForClassRename:oldName to:newName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3492
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3493
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3494
    "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
  3495
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3496
    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
  3497
    aStream nextPutChunkSeparator.
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3498
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3499
    "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
  3500
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3501
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3502
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3503
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3504
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3505
    "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
  3506
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3507
    aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3508
	    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
  3509
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3510
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3511
    "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
  3512
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3513
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3514
addChangeRecordForPrimitiveFunctions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3515
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3516
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3517
    "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
  3518
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3519
    aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3520
	    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
  3521
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3522
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3523
    "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
  3524
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3525
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3526
addChangeRecordForPrimitiveVariables:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3527
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3528
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3529
    "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
  3530
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3531
    aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3532
	    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
  3533
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3534
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3535
    "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
  3536
! !
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3537
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3538
!Class methodsFor:'protocol printOut'!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3539
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3540
printOutProtocolOn:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3541
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3542
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3543
    |collectionOfCategories|
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3544
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3545
    self printOutDefinitionOn:aPrintStream.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3546
    aPrintStream cr.
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3547
    collectionOfCategories := self class categories asSortedCollection.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3548
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3549
	aPrintStream nextPutLine:'class protocol'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3550
	aPrintStream cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3551
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3552
	    self class printOutCategoryProtocol:aCategory on:aPrintStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3553
	]
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3554
    ].
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3555
    collectionOfCategories := self categories asSortedCollection.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3556
    collectionOfCategories notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3557
	aPrintStream nextPutLine:'instance protocol'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3558
	aPrintStream cr.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3559
	collectionOfCategories do:[:aCategory |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3560
	    self printOutCategoryProtocol:aCategory on:aPrintStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3561
	]
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3562
    ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3563
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3564
    "Modified: / 25.11.1998 / 12:40:38 / cg"
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3565
! !
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3566
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3567
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3568
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3569
hasExtensions
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3570
    "return true, if there are methods in the receiver, which belong to
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3571
     a different package (i.e. package of class ~= package of method).
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3572
     Those are class extensions, which must be treated specially when checking classes
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3573
     into the sourceCode repository. (extensions are stored separate)" 
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3574
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3575
    |clsPkg defaultPkg|
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3576
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3577
    defaultPkg := Project defaultProject package.
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3578
    clsPkg := self package.
6077
d777721e42c8 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 6023
diff changeset
  3579
    self instAndClassSelectorsAndMethodsDo:[:sel :mthd |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3580
	|mthdPkg|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3581
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3582
	mthdPkg := mthd package.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3583
	mthdPkg ~= clsPkg ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3584
	    mthdPkg ~= defaultPkg ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3585
		^ true
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3586
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3587
	].
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3588
    ].
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3589
    ^ false
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3590
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3591
    "
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3592
     Smalltalk allClasses select:[:each | each hasExtensions] 
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3593
    "
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3594
!
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3595
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3596
hasExtensionsFrom:aPackageID
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3597
    "return true, if there are methods in the receiver, which belong to
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3598
     the package with aPackageID (i.e. package of class ~= package of method).
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3599
     Those are class extensions, which must be treated specially when checking classes
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3600
     into the sourceCode repository. (extensions are stored separate)" 
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3601
6077
d777721e42c8 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 6023
diff changeset
  3602
    self instAndClassSelectorsAndMethodsDo:[:sel :mthd |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3603
	mthd package = aPackageID ifTrue:[^ true].
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3604
    ].
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3605
    ^ false
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3606
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3607
    "
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3608
     Smalltalk allClasses select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser'] 
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3609
    "
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3610
!
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3611
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3612
isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3613
    "return true, if the receiver is some kind of class 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3614
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3615
     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
  3616
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3617
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3618
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3619
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3620
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3621
     Point isClass  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3622
     1 isClass      
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3623
     Behavior new isBehavior  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3624
     Behavior new isClass       
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3625
     Class new isBehavior    
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3626
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3627
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3628
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3629
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3630
isStartableWithMain
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3631
    "return true, if this is an application class,
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3632
     which can be started via #main"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3633
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3634
    ^ self theMetaclass includesSelector:#main
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3635
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3636
    "Created: / 2.11.2001 / 09:37:01 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3637
    "Modified: / 2.11.2001 / 09:48:05 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3638
!
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3639
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3640
rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3641
    "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
  3642
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3643
    |set|
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3644
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3645
    set := IdentitySet new.
5581
7bef1c75fb06 allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
  3646
    Smalltalk allClassesDo:[:aClass | 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3647
	aClass superclass isNil ifTrue:[set add:aClass]
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3648
    ].
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3649
    ^ set asOrderedCollection
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3650
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3651
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3652
     Class rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3653
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3654
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3655
    "Modified: 18.4.1997 / 20:55:34 / cg"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3656
!
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3657
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3658
subclasses
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3659
    "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
  3660
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3661
    |newColl|
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3662
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3663
    "/ 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
  3664
    "/ if possible
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3665
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3666
    SubclassInfo notNil ifTrue:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3667
        newColl := SubclassInfo at:self ifAbsent:nil.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3668
        newColl notNil ifTrue:[^ newColl asOrderedCollection]
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3669
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3670
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3671
    newColl := OrderedCollection new.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3672
    self subclassesDo:[:aClass |
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3673
        newColl add:aClass
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3674
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3675
    SubclassInfo notNil ifTrue:[
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3676
        SubclassInfo at:self put:newColl.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3677
    ].
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3678
    ^ newColl
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3679
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3680
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3681
     Class flushSubclassInfo.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3682
     Collection subclasses
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3683
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3684
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3685
    "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
  3686
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3687
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3688
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3689
    "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
  3690
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3691
     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
  3692
     Autoload. The interface here is for your convenience."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3693
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3694
    ^ 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
  3695
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3696
    "Modified: 21.3.1996 / 16:27:09 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3697
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3698
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3699
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3700
    "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
  3701
     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
  3702
     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
  3703
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3704
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3705
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3706
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3707
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3708
    [cls notNil] whileTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3709
	(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3710
	cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3711
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3712
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3713
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3714
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3715
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3716
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3717
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3718
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3719
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3720
!Class methodsFor:'renaming'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3721
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3722
makePrivateIn:newOwner
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3723
    "make a private class of newOwner from the receiver;
5612
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3724
     the receiver must be a public class.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3725
     Returns the new private class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3726
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3727
    |sel newClass|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3728
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3729
    self owningClass notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3730
	^ self
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3731
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3732
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3733
    sel := self definitionSelectorPrivate.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3734
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3735
    newClass := self superclass
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3736
	perform:sel
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3737
	withArguments:(Array 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3738
			with:(self nameWithoutPrefix asSymbol)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3739
			with:(self instanceVariableString)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3740
			with:(self classVariableString)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3741
			with:''
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3742
			with:newOwner).
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3743
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3744
    "/ copy over methods ...
6023
63f7111fd2f9 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5938
diff changeset
  3745
    ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class.
63f7111fd2f9 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5938
diff changeset
  3746
    ClassBuilder copyInvalidatedMethodsFrom:self for:newClass.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3747
    newClass class recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3748
    newClass recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3749
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3750
    newOwner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3751
    Smalltalk changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3752
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3753
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3754
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3755
3494
23a6cf28b3a6 fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents: 3407
diff changeset
  3756
    "Modified: / 29.5.1998 / 19:03:49 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3757
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3758
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3759
makePublic
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3760
    "make a public class from the receiver.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3761
     The receiver must be a private class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3762
     Returns the new public class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3763
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3764
    ^ self makePublicIn:Smalltalk
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3765
!
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3766
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3767
makePublicIn:aNameSpace
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3768
    "make a public class from the receiver.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3769
     The receiver must be a private class.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3770
     Returns the new public class."
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3771
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3772
    |sel owner newName newClass|
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3773
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3774
    owner := self topOwningClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3775
    owner isNil ifTrue:[^ self].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3776
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3777
    "/ first, create the public class ...
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3778
    sel := self definitionSelector.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3779
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3780
    Class nameSpaceQuerySignal answer:aNameSpace
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3781
    do:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3782
	(aNameSpace isNil or:[aNameSpace == Smalltalk]) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3783
	    newName := self nameWithoutPrefix
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3784
	] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3785
	    newName := aNameSpace name , '::' , self nameWithoutPrefix
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3786
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3787
	newClass := self superclass
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3788
	    perform:sel
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3789
	    withArguments:(Array 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3790
			    with:(newName asSymbol)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3791
			    with:(self instanceVariableString)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3792
			    with:(self classVariableString)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3793
			    with:''
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3794
			    with:(owner category)).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3795
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3796
	"/ copy over methods ...
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3797
	ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3798
	ClassBuilder copyInvalidatedMethodsFrom:self for:newClass.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3799
	newClass class recompileInvalidatedMethods.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3800
	newClass recompileInvalidatedMethods.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3801
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3802
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3803
    owner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3804
    Smalltalk changed:#newClass with:newClass.
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3805
    (aNameSpace notNil and:[aNameSpace ~~ Smalltalk]) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3806
	aNameSpace changed:#newClass with:newClass.
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3807
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3808
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3809
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3810
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3811
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3812
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3813
    "Created: 23.6.1997 / 13:28:52 / cg"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3814
    "Modified: 20.10.1997 / 21:43:38 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3815
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3816
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3817
renameTo:newName
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3818
    "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
  3819
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3820
    <resource:#obsolete>
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3821
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3822
    |oldSym newSym|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3823
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3824
    "/ the code below is obsolete - it does not deal with
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3825
    "/ classVariables, private classes and does not
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3826
    "/ recompile other classes in order to care for namespace
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3827
    "/ changes.
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3828
    "/ Please use Smalltalk>>renameClass:to:,
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3829
    "/ which deals with all of that.
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3830
    self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'.
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3831
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3832
    oldSym := name asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3833
    newSym := newName asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3834
    self setName:newSym.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3835
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3836
    Smalltalk at:oldSym put:nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3837
    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
  3838
    Smalltalk at:newSym put:self.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3839
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3840
    "Created: / 1.4.1997 / 15:27:53 / stefan"
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3841
    "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
  3842
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3843
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3844
!Class methodsFor:'signature checking'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3845
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3846
classinstSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3847
    "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
  3848
     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
  3849
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3850
    ^ (aSignature bitShift:-7) bitAnd:7
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3851
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3852
    "Created: 1.4.1997 / 15:23:01 / stefan"
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3853
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3854
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3855
instNameKeyFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3856
    "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
  3857
     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
  3858
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3859
    ^ (aSignature bitShift:-14) bitAnd:16rFFFF
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3860
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3861
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3862
     Point instNameKeyFromSignature:Point signature.             
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3863
     Association instNameKeyFromSignature:Association signature.  
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3864
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3865
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3866
    "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
  3867
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3868
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3869
instSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3870
    "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
  3871
     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
  3872
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3873
    ^ aSignature bitAnd:16r7F
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3874
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3875
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3876
     Class instSizeFromSignature:Point signature.     
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3877
     Class instSizeFromSignature:Association signature.   
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3878
     Class instSizeFromSignature:Dictionary signature.    
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3879
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3880
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3881
    "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
  3882
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3883
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3884
instTypeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3885
    "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
  3886
     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
  3887
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3888
    ^ (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
  3889
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3890
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3891
     Class instTypeFromSignature:Object signature.               
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3892
     Class instTypeFromSignature:Array signature.                
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3893
     Class instTypeFromSignature:String signature.               
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3894
     Class instTypeFromSignature:OrderedCollection signature.    
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3895
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3896
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3897
    "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
  3898
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3899
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3900
signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3901
    "return a signature number - this number is useful for a quick
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3902
     check for changed classes, and is done in the binary-object loader, 
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3903
     and the dynamic class loader.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3904
     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
  3905
     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
  3906
     (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
  3907
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3908
    |value   "{ Class: SmallInteger }"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3909
     nameKey "{ Class: SmallInteger }" |
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3910
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3911
    signature notNil ifTrue:[^ signature].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3912
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3913
    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
  3914
    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
  3915
    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
  3916
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3917
    nameKey := 0.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3918
    self allInstVarNames do:[:name |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3919
	nameKey := nameKey bitShift:1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3920
	(nameKey bitAnd:16r10000) ~~ 0 ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3921
	    nameKey := nameKey bitXor:1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3922
	    nameKey := nameKey bitAnd:16rFFFF.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3923
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3924
	nameKey := (nameKey + (name at:1) asciiValue) bitAnd:16rFFFF.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3925
    ].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3926
    value := value + (nameKey bitShift:14).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3927
    signature := value.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3928
    ^ value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3929
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3930
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3931
     Array signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3932
     ByteArray signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3933
     View signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3934
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3935
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3936
    "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
  3937
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3938
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
  3939
!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
  3940
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3941
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
  3942
    "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
  3943
     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
  3944
     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
  3945
     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
  3946
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3947
    |owner info c|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3948
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3949
    (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
  3950
    revision notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3951
	c := revision first.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3952
	c == $$ ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3953
	    info := Class revisionInfoFromString:revision.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3954
	    info isNil ifTrue:[^ '0'].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3955
	    ^ info at:#revision ifAbsent:'0'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3956
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3957
	c isDigit ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3958
	    ^ '0'
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3959
	].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3960
    ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3961
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
  3962
    ^ 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
  3963
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3964
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3965
     Object binaryRevision
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3966
     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
  3967
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3968
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3969
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3970
     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
  3971
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3972
     |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
  3973
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3974
     classes := Smalltalk allClasses 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  3975
		    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
  3976
     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
  3977
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3978
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3979
    "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
  3980
    "Modified: 1.4.1997 / 23:33:01 / stefan"
2909
b4df6be2ed52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2906
diff changeset
  3981
    "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
  3982
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3983
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3984
currentSourceStream
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3985
    "return an open stream on the current source of the receiver"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3986
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3987
    |theWriteStream theCurrentSource|
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3988
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  3989
    theWriteStream := '' writeStream.
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3990
    Method flushSourceStreamCache.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3991
    self fileOutOn:theWriteStream withTimeStamp:false.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3992
    theCurrentSource := theWriteStream contents asString.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3993
    theWriteStream close.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3994
    ^ theCurrentSource
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3995
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3996
    "Modified: 15.10.1996 / 18:59:40 / cg"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3997
    "Modified: 1.4.1997 / 14:33:12 / stefan"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3998
!
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3999
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4000
localSourceStreamFor:sourceFile
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4001
    "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
  4002
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  4003
    |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
  4004
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4005
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4006
    "/ old: look in 'source/<filename>'
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4007
    "/ 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
  4008
    "/ classes in her currentDirectory.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4009
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4010
    fileName := Smalltalk getSourceFileName:sourceFile.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4011
    fileName notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4012
	^ fileName asFilename readStreamOrNil.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4013
    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4014
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4015
    (package := self package) notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4016
	"/ newest sceme ...
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4017
	packageDir := package copyReplaceAll:$: with:$/.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4018
	packageDir := Smalltalk getPackageFileName:packageDir.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4019
	packageDir notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4020
	    "/ present there ?
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4021
	    packageDir := packageDir asFilename.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4022
	    (fn := packageDir construct:sourceFile) exists ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4023
		^ fn readStreamOrNil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4024
	    ].
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  4025
            
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4026
	    "/ a source subdirectory ?
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4027
	    fn := (packageDir construct:'source') construct:sourceFile.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4028
	    fn exists ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4029
		^ fn readStreamOrNil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4030
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4031
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4032
	    "/ a zip-file ?
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4033
	    fn := (packageDir construct:'source.zip').
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4034
	    fn exists ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4035
		zar := ZipArchive oldFileNamed:fn.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4036
		zar notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4037
		    entry := zar extract:sourceFile.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4038
		    entry notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4039
			^ entry asString readStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4040
		    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4041
		]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4042
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4043
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4044
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4045
	"/ will vanish ...
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4046
	(package includes:$:) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4047
	    package := package asString copyReplaceAll:$: with:$/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4048
	] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4049
	    package := 'stx/' , package
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4050
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4051
	fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4052
	fileName notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4053
	    ^ fileName asFilename readStreamOrNil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4054
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4055
	(package startsWith:'stx/') ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4056
	    fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4057
	    fileName notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4058
		^ fileName asFilename readStreamOrNil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4059
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4060
	]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4061
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4062
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4063
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4064
    "/ new: look in 'source/<module>/<package>/<filename>
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4065
    "/ 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
  4066
    "/ obsolete.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4067
    info := self packageSourceCodeInfo.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4068
    info notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4069
	module := info at:#module ifAbsent:nil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4070
	module notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4071
	    dir := info at:#directory ifAbsent:nil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4072
	    dir notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4073
		fn := (module asFilename construct:dir) construct:sourceFile.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4074
		fileName := Smalltalk getSourceFileName:(fn name).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4075
		fileName notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4076
		    ^ fileName asFilename readStreamOrNil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4077
		].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4078
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4079
		"/ brand new: look for source/<module>/package.zip
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4080
		"/ containing an entry for <filename>
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4081
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4082
		fn := (module asFilename construct:dir) withSuffix:'zip'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4083
		fileName := Smalltalk getSourceFileName:(fn name).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4084
		fileName notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4085
		    zar := ZipArchive oldFileNamed:fileName.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4086
		    zar notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4087
			entry := zar extract:sourceFile.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4088
			entry notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4089
			    ^ entry asString readStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4090
			]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4091
		    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4092
		].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4093
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4094
		"/ and also in source/source.zip ...
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4095
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4096
		fileName := Smalltalk getSourceFileName:'source.zip'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4097
		fileName notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4098
		    zar := ZipArchive oldFileNamed:fileName.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4099
		    zar notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4100
			entry := zar extract:sourceFile.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4101
			entry notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4102
			    ^ entry asString readStream
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4103
			]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4104
		    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4105
		].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4106
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4107
	]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4108
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4109
    ^ nil
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4110
3657
9e9fe2dd4c30 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4111
    "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
  4112
!
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4113
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4114
nameOfVersionMethod
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4115
    ^ #version
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4116
!
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
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
packageSourceCodeInfo
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4119
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4120
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
  4121
    "return the sourceCodeInfo, which defines the module and the subdirectory
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4122
     in which the receiver class was built. 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4123
     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
  4124
     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
  4125
     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
  4126
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
     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
  4128
     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
  4129
     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
  4130
     (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
  4131
     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
  4132
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4133
     By convention, this info is encoded in the classes package
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4134
     string (which is given as argument to stc) as the last word in parenthesis. 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4135
     The info consists of 1 to 3 subcomponents, separated by colons.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4136
     The first defines the classes module (i.e. some application identifier), 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4137
     the second defines the subdirectory within that module, the third
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4138
     defines the name of the class library. 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4139
     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
  4140
     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
  4141
     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
  4142
     (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
  4143
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4144
     For example: 
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4145
	'....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4146
	'....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4147
	'....(stx:foo:libbfoo)'                  -> module: stx directory: foo library: libfoo
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4148
	'....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4149
	'....(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
  4150
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4151
     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
  4152
     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
  4153
     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
  4154
     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
  4155
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4156
     Caveat:
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4157
	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
  4158
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4159
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4160
    |owner sourceInfo packageString idx1 idx2 
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4161
     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
  4162
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4163
    (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4164
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
  4165
    package isNil ifTrue:[^ nil].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4166
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4167
    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
  4168
    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
  4169
    idx1 ~~ 0 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4170
	idx2 := packageString indexOf:$) startingAt:idx1+1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4171
	idx2 ~~ 0 ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4172
	    sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4173
	]
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4174
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4175
	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
  4176
    ].
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4177
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
  4178
    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
  4179
    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
  4180
    components size == 0 ifTrue:[
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4181
"/        moduleString := 'stx'.
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4182
"/        directoryString := libraryString := ''.
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4183
	^ nil
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4184
    ].
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4185
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4186
    component1 := components at:1.
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4187
    components size == 1 ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4188
	"/ a single name given - the module becomes 'stx' or
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4189
	"/ the very first directory component (if such a module exists).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4190
	"/ If the component includes slashes, its the directory
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4191
	"/ otherwise the library.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4192
	"/ 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4193
	dirComponents := Filename concreteClass components:component1.     
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4194
	(dirComponents size > 1
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4195
	and:[(mgr := self sourceCodeManager) notNil
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4196
	and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4197
	    moduleString := dirComponents first.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4198
	    directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4199
	] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4200
	    "/ non-existing; assume directory under the stx package.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4201
	    moduleString := 'stx'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4202
	    (component1 startsWith:'stx/') ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4203
		component1 := component1 copyFrom:5
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4204
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4205
	    directoryString := libraryString := component1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4206
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4207
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4208
	(libraryString includes:$/) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4209
	    libraryString := libraryString asFilename baseName
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4210
	]
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
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4212
	component2 := components at:2.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4213
	components size == 2 ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4214
	    "/ two components - assume its the module and the directory; 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4215
	    "/ the library is assumed to be named after the directory
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4216
	    "/ except, if slashes are in the name; then the libraryname
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4217
	    "/ is the last component.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4218
	    "/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4219
	    moduleString := component1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4220
	    directoryString := libraryString := component2.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4221
	    (libraryString includes:$/) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4222
		libraryString := libraryString asFilename baseName
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4223
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4224
	] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4225
	    "/ all components given
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4226
	    moduleString := component1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4227
	    directoryString := component2.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4228
	    libraryString := components at:3.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4229
	]
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
  4230
    ].
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4231
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
  4232
    libraryString isEmpty ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4233
	directoryString notEmpty ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4234
	    libraryString := directoryString asFilename baseName
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4235
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4236
	libraryString isEmpty ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4237
	    "/ lets extract the library from the liblist file ...
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4238
	    libraryString := Smalltalk libraryFileNameOfClass:self.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4239
	    libraryString isNil ifTrue:[^ nil].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4240
	]
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
  4241
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4242
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4243
    moduleString isEmpty ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4244
	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
  4245
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4246
    directoryString isEmpty ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4247
	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
  4248
    ].
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
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
    ^ IdentityDictionary
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4251
	with:(#module->moduleString)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4252
	with:(#directory->directoryString)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4253
	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
  4254
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4255
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4256
     Object packageSourceCodeInfo     
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4257
     View packageSourceCodeInfo    
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4258
     Model packageSourceCodeInfo  
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4259
     BinaryObjectStorage packageSourceCodeInfo  
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4260
     MemoryMonitor packageSourceCodeInfo  
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4261
     ClockView packageSourceCodeInfo  
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4262
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4263
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
    "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
  4265
    "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
  4266
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4267
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4268
resourceDirectory
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4269
    "return the directory where my resource file is supposed to live.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4270
     Here, take the package and assume that a directory named 'resources' exists
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4271
     in my package directory.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4272
     Return nil, if no such directory exists."
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4273
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4274
    |prjDir rsrcDir|
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4275
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4276
    prjDir := Smalltalk projectDirectoryForClass:self.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4277
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4278
    (prjDir notNil 
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4279
    and:[(prjDir := prjDir asFilename) exists
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4280
    and:[(rsrcDir := prjDir construct:'resources') exists]]) ifTrue:[
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4281
        ^ rsrcDir 
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4282
    ].
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4283
    ^ nil
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4284
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4285
    "
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4286
     Object resourceDirectory    
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4287
     View resourceDirectory      
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4288
     ApplicationModel resourceDirectory  
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4289
    "
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4290
!
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4291
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4292
resourcePackName
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4293
    "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
  4294
     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
  4295
     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
  4296
     The default here is the classes name - this can be redefined in classes
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4297
     which want use another classes resources (NewLauncher -> Launcher)."
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4298
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4299
    ^ self name
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4300
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4301
    "Created: / 29.1.1998 / 22:20:12 / cg"
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4302
!
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4303
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
  4304
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
  4305
    "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
  4306
     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
  4307
     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
  4308
     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
  4309
     the old revision, while logically, the class has the new (checked-in) revision.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4310
     To check if a source corresponds to a compiled binary, compare this 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4311
     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
  4312
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
    |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
  4314
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4315
    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
  4316
    info notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4317
	^ 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
  4318
    ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4319
    ^ 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
  4320
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4321
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4322
     Object revision 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  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
    "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
  4326
    "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
  4327
    "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
  4328
!
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
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4330
revisionDateString
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4331
    "return the revision-Date of the class as a string.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4332
     This is extracted from the version string."
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4333
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4334
    |info|
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4335
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4336
    info := self revisionInfo.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4337
    info notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4338
	^ info at:#date ifAbsent:'??/??/??'
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4339
    ].
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4340
    ^ '??/??/??'
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4341
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4342
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4343
     Object revisionDateString 
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4344
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4345
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4346
    "Created: 23.4.1997 / 12:29:21 / cg"
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4347
!
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4348
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
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
  4350
    "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
  4351
     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
  4352
     The revisionInfo contains all or a subset of:
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4353
	#binaryRevision - the revision upon which the binary of this class is based
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4354
	#revision       - the revision upon which the class is based logically
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4355
			  (different, if a changed class was checked in, but not yet recompiled)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4356
	#user           - the user who checked in the logical revision
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4357
	#date           - the date when the logical revision was checked in
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4358
	#time           - the time when the logical revision was checked in
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4359
	#fileName       - the classes source file name
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4360
	#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
  4361
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4362
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4363
    |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
  4364
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4365
    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
  4366
    vsnString notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4367
	mgr := self sourceCodeManager.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4368
	mgr notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4369
	    info := mgr revisionInfoFromString:vsnString
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4370
	] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4371
	    info := Class revisionInfoFromString:vsnString.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4372
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4373
	info notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4374
	    info at:#binaryRevision put:self binaryRevision.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4375
	]
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
  4376
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4377
    ^ 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
  4378
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4379
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4380
     Object revisionString 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4381
     Object revisionInfo 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4382
     Image revisionInfo 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4383
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4384
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4385
    "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
  4386
    "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
  4387
    "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
  4388
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4389
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4390
revisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4391
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4392
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4393
    "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
  4394
     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
  4395
     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
  4396
     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
  4397
     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
  4398
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4399
    |owner cls meta m src val|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4400
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4401
    (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
  4402
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4403
    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
  4404
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4405
    meta := self theMetaclass. 
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4406
    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
  4407
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4408
    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
  4409
    m isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4410
	"/ no - do NEVER care for a version method on the instance side
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4411
	"/ m := cls compiledMethodAt:(self nameOfVersionMethod).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4412
	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
  4413
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4414
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4415
    m isExecutable ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4416
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4417
	"/ if its a method returning the string,
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4418
	"/ thats the returned value
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4419
	"/
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4420
	val := cls perform:(self nameOfVersionMethod).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4421
	val isString ifTrue:[^ val].
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4422
    ].
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
  4423
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4424
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4425
    "/ 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
  4426
    "/ 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
  4427
    "/ 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
  4428
    "/ 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
  4429
    "/ 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
  4430
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4431
    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
  4432
    src isNil ifTrue:[^ nil].
1811
8afb43250471 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
  4433
    ^ 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
  4434
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4435
    "
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
     Smalltalk allClassesDo:[:cls |
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4437
	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
  4438
     ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4439
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4440
     Number revisionString  
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4441
     FileDirectory revisionString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4442
     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
  4443
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4444
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4445
    "Created: / 29.10.1995 / 19:28:03 / cg"
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4446
    "Modified: / 1.4.1997 / 23:37:25 / stefan"
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4447
    "Modified: / 7.2.2001 / 18:03:39 / ps"
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4448
    "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
  4449
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4450
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4451
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
  4452
    "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
  4453
     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
  4454
     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
  4455
     (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
  4456
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
    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
  4458
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4459
    "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
  4460
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4461
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4462
setPackageFromRevision
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4463
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4464
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4465
    "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
  4466
     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
  4467
     (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
  4468
      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
  4469
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4470
    |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
  4471
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4472
    self owningClass notNil ifTrue:[^ self].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4473
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4474
    mgr := self sourceCodeManager.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4475
    mgr notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4476
	info := mgr sourceInfoOfClass:self
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4477
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4478
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4479
    info notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4480
	mod := info at:#module ifAbsent:nil.    "/ stx, aeg, <your-organization>
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4481
	dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ...
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4482
	lib := info at:#library ifAbsent:dir.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4483
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4484
	p := ''.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4485
	mod notNil ifTrue:[
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4486
"/            mod ~= 'stx' ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4487
		p := p , mod
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4488
"/            ]
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4489
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4490
	dir notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4491
	    p notEmpty ifTrue:[p := p , ':'].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4492
	    p := p , dir.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4493
	] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4494
	    lib notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4495
		p notEmpty ifTrue:[p := p , ':'].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4496
		p := p , lib.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4497
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4498
	].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4499
	(p notEmpty and:[p ~= package]) ifTrue:[
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4500
"/            package notNil ifTrue:[
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4501
"/                (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR.
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4502
"/            ].
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4503
	    package := p.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4504
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4505
	    self methodDictionary do:[:aMethod |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4506
		aMethod package isNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4507
		    aMethod setPackage:p
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4508
		]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4509
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4510
	].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4511
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4512
    ^ self
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4513
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4514
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4515
     MemoryMonitor autoload.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4516
     MemoryMonitor setPackageFromRevision
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4517
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4518
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4519
    "Modified: 12.6.1996 / 11:49:31 / stefan"
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4520
    "Modified: 7.1.1997 / 12:01:08 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4521
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4522
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
  4523
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
  4524
    "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
  4525
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4526
    |owner source|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4527
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4528
    (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
  4529
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4530
    classFilename notNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4531
	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
  4532
    ] ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4533
	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
  4534
    ].
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4535
    ^ self sourceStreamFor:source
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4536
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4537
    "Modified: 15.10.1996 / 18:59:40 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4538
    "Modified: 1.4.1997 / 14:33:12 / stefan"
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4539
!
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4540
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4541
sourceStreamFor:source
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4542
    "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
  4543
6703
ffea6ebb676d Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 6701
diff changeset
  4544
    |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
  4545
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4546
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4547
    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
  4548
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
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4550
    "/ if there is no SourceCodeManager, 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4551
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4552
    "/ 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
  4553
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4554
    ((mgr := self sourceCodeManager) isNil 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4555
    or:[TryLocalSourceFirst == true]) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4556
	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
  4557
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4558
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4559
    aStream isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4560
	"/ mhmh - still no source file.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4561
	"/ If there is a SourceCodeManager, ask it to aquire the
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4562
	"/ the source for my class, and return an open stream on it. 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4563
	"/ if that one does not know about the source, look in
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4564
	"/ standard places
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4565
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4566
	mgr notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4567
	    classFilename ~= source ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4568
		sep := self package indexOfAny:'/\:'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4569
		sep ~~ 0 ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4570
		    mod := package copyTo:sep - 1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4571
		    dir := package copyFrom:sep + 1.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4572
		    aStream := mgr streamForClass:nil fileName:source revision:nil directory:dir module:mod cache:true.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4573
		].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4574
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4575
	    aStream isNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4576
		classFilename isNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4577
		    guessedFileName := (Smalltalk fileNameForClass:self) , '.st'.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4578
		    self setClassFilename:guessedFileName.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4579
		].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4580
		source asFilename baseName = classFilename asFilename baseName ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4581
		    aStream := mgr getSourceStreamFor:self.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4582
		]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4583
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4584
	    aStream notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4585
		(self validateSourceStream:aStream) ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4586
		    ('Class [info]: repositories source for `' 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4587
		     , (self theNonMetaclass name)
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4588
		     , ''' is invalid.') infoPrintCR.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4589
		    aStream close.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4590
		    aStream := nil
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4591
		] ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4592
		    validated := true.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4593
		].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4594
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4595
	]
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4596
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4597
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4598
    aStream isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4599
	"/      
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4600
	"/ hard case - there is no source file for this class
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4601
	"/ (in the source-dir-path).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4602
	"/      
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4603
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4604
	"/      
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4605
	"/ look if my binary is from a dynamically loaded module,
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4606
	"/ and, if so, look in the modules directory for the
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4607
	"/ source file.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4608
	"/      
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4609
	ObjectFileLoader notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4610
	    ObjectFileLoader loadedObjectHandlesDo:[:h |
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4611
		|f classes|
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4612
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4613
		aStream isNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4614
		    (classes := h classes) size > 0 ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4615
			(classes includes:self) ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4616
			    f := h pathName.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4617
			    f := f asFilename directory.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4618
			    f := f construct:source.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4619
			    f exists ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4620
				aStream := f readStreamOrNil.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4621
			    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4622
			].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4623
		    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4624
		]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4625
	    ].
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4626
	].
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4627
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4628
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4629
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4630
    "/ try along sourcePath
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4631
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4632
    aStream isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4633
	aStream := self localSourceStreamFor:source.
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4634
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4635
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4636
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4637
    "/ final chance: try current directory
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4638
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4639
    aStream isNil ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4640
	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
  4641
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4642
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4643
    (aStream notNil and:[validated not]) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4644
	(self validateSourceStream:aStream) ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4645
	    (Smalltalk releaseIdentification = 'ST/X_free_demo_vsn') ifTrue:[
3401
da5821d3e57e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
  4646
"/                ('Class [info]: source for ''' , self name , ''' is not available in the demo version.') infoPrintCR
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4647
	    ] ifFalse:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4648
		('Class [warning]: source for ''' , self name , ''' is invalid or stripped. Take care.') errorPrintCR
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4649
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4650
	].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4651
    ].
4744
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4652
    (aStream notNil and:[aStream isFileStream]) ifTrue:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4653
	guessedFileName notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4654
	    self setClassFilename:(aStream pathName asFilename baseName).
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4655
	]
4744
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4656
    ].
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
  4657
    ^ 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
  4658
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4659
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4660
     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
  4661
     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
  4662
     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
  4663
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4664
3391
e012d2965887 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3390
diff changeset
  4665
    "Created: / 10.11.1995 / 21:05:13 / cg"
e012d2965887 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3390
diff changeset
  4666
    "Modified: / 22.4.1998 / 19:20:50 / ca"
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4667
    "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
  4668
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4669
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4670
updateVersionMethodFor:newRevisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4671
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4672
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
  4673
    "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
  4674
     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
  4675
4667
2b51bafd8243 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4647
diff changeset
  4676
    |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
  4677
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4678
    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
  4679
    self isMeta ifFalse:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4680
	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
  4681
    ].
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4682
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4683
"/    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
  4684
"/    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
  4685
"/    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
  4686
"/    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
  4687
"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4688
"/    (mgr := self sourceCodeManager) isNil ifTrue:[^ false].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4689
"/    newString := mgr updatedRevisionStringOf:cls forRevision:newRevision with:vs. 
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4690
"/    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
  4691
4606
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4692
    Class methodRedefinitionSignal answer:#keep do:[
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4693
	Class withoutUpdatingChangesDo:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4694
	    mthd := Compiler compile:(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
  4695
    ^ ''' , 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
  4696
'
7368
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4697
		     forClass:cls 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4698
		     inCategory:#documentation 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4699
		     notifying:nil 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4700
		     install:true 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4701
		     skipIfSame:false 
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4702
		     silent:true.
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4703
	    mthd notNil ifTrue:[
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4704
		mthd setPackage:self package
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4705
	    ]
b513331e4e5a hook renamed to attributes
Claus Gittinger <cg@exept.de>
parents: 7367
diff changeset
  4706
	]
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
  4707
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4708
"/ ('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
  4709
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4710
    ^ 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
  4711
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4712
    "Created: 7.12.1995 / 20:42:22 / cg"
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4713
    "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
  4714
!
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4715
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4716
validateSourceStream:aStream
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4717
    "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
  4718
     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
  4719
     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
  4720
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4721
    |cls meta cannotCheckReason versionMethod info
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4722
     versionFromCode versionFromSource oldPos pos src rev
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4723
     versionMethodsName|
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4724
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4725
    meta := self theMetaclass. 
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4726
    cls := self theNonMetaclass.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4727
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4728
    cannotCheckReason := nil.
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4729
    versionMethodsName := self nameOfVersionMethod.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4730
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4731
    versionMethod := meta compiledMethodAt:versionMethodsName.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4732
    (versionMethod isNil 
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4733
    or:[versionMethod isExecutable not]) ifTrue:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4734
        versionMethod := cls compiledMethodAt:versionMethodsName.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4735
        (versionMethod isNil
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4736
        or:[versionMethod isExecutable not]) ifTrue:[
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4737
            cannotCheckReason := 'no valid version method'.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4738
        ]
2544
c3a2791de289 care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
  4739
    ] ifFalse:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4740
        "/
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4741
        "/ if its a method returning the string,
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4742
        "/ thats the returned value
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4743
        "/
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4744
        versionFromCode := cls perform:versionMethodsName.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4745
        versionFromCode isString ifFalse:[
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4746
            cannotCheckReason := 'version method does not return a string'
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4747
        ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4748
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4749
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4750
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4751
    "/ 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
  4752
    "/ 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
  4753
    "/ 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
  4754
    "/ 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
  4755
    "/ for the source ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4756
    "/
1942
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4757
    versionMethod notNil ifTrue:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4758
        pos := versionMethod sourcePosition.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4759
        pos isInteger ifFalse:[
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4760
            "/ mhmh - either no version method,
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4761
            "/ or updated due to a checkin.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4762
            "/ in any case, this should be a good source.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4763
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4764
            ^ true.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4765
            "/ cannotCheckReason := 'no source position for version-method'
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4766
        ]
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4767
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4768
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4769
    cannotCheckReason notNil ifTrue:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4770
        ('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4771
        'Class [info]: cannot validate source; trusting source' infoPrintCR.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4772
        ^ true
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4773
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4774
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4775
    oldPos := aStream position.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4776
    Stream positionErrorSignal handle:[:ex |
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4777
        'Class [info]: position error when accessing source' infoPrintCR.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4778
        ^ false
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4779
    ] do:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4780
        aStream position1Based:pos.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4781
    ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4782
    src := aStream nextChunk.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4783
    aStream position:oldPos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4784
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4785
    (src isNil or:[src isEmpty]) ifTrue:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4786
        'Class [info]: empty source for version-method' infoPrintCR.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4787
        ^ false
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4788
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4789
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4790
    versionFromSource := Class revisionStringFromSource:src.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4791
    versionFromSource = versionFromCode ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4792
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4793
    versionFromSource isNil ifTrue:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4794
        'Class [info]: version-from source is nil' infoPrintCR.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4795
        ^ false
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4796
    ].
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  4797
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4798
    "/ mhmh - check my binary version ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4799
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4800
    info := Class revisionInfoFromString:versionFromSource.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4801
    info notNil ifTrue:[
7748
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4802
        rev := info at:#revision.
ddbe8a0cd8e5 generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 7693
diff changeset
  4803
        rev = self binaryRevision ifTrue:[^ true].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4804
    ].
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4805
    '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
  4806
    ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4807
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4808
    "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
  4809
! !
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4810
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4811
!Class methodsFor:'special accessing'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4812
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4813
setName:aString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4814
    "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
  4815
     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
  4816
     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
  4817
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4818
    environment := nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4819
    name := aString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4820
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4821
    "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
  4822
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4823
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4824
!Class::ClassAttributes methodsFor:'accessing'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4825
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4826
primitiveDefinitions
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4827
    ^ primitiveDefinitions
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4828
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4829
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4830
primitiveDefinitions:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4831
    primitiveDefinitions := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4832
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4833
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4834
primitiveFunctions
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4835
    ^ primitiveFunctions
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4836
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4837
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4838
primitiveFunctions:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4839
    primitiveFunctions := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4840
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4841
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4842
primitiveVariables
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4843
    ^ primitiveVariables
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4844
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4845
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4846
primitiveVariables:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4847
    primitiveVariables := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4848
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4849
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4850
!Class::ClassAttributes methodsFor:'conversion'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4851
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4852
fromSTCPrimitiveArray:anArray
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4853
    "for now, the stc compiler generates a 3-element primitive spec array
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4854
     (it does not know anything about me).
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4855
     This method is invoked to convert."
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4856
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4857
    primitiveDefinitions := anArray at:1.
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4858
    primitiveVariables := anArray at:2.
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  4859
    primitiveFunctions := anArray at:3.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4860
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  4861
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4862
!Class class methodsFor:'documentation'!
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4863
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4864
version
8075
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  4865
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.457 2004-03-04 20:01:41 cg Exp $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  4866
! !