Class.st
author Claus Gittinger <cg@exept.de>
Wed, 23 May 2001 01:07:54 +0200
changeset 5875 5ccb39187705
parent 5863 cd29b95b3c72
child 5938 3217017b7ff4
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
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
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
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
    17
		revision primitiveSpec environment signature hook'
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
    18
	classVariableNames:''
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
    19
	poolDictionaries:''
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
    20
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    21
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    23
!Class class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    24
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    25
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    26
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    27
 COPYRIGHT (c) 1989 by Claus Gittinger
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
    28
               All Rights Reserved
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    29
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    30
 This software is furnished under a license and may be used
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    31
 only in accordance with the terms of that license and with the
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    33
 be provided or otherwise made available to, or used by, any
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    34
 other person.  No title to or ownership of the software is
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    35
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    36
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    37
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    38
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    39
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    40
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    41
    Class adds more functionality to classes; minimum stuff has already
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    42
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    43
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    44
    [Instance variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    45
4346
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    46
        name            <Symbol>        the classes name
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    47
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    48
        category        <Symbol>        the classes category
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    49
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    50
        classvars       <String>        the names of the class variables
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    51
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    52
        comment         <String>        the classes comment; either a string,
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    53
                                        a number specifying the offset in classFilename, or nil
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    54
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    55
        subclasses      <Collection>    cached collection of subclasses
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    56
                                        (currently unused - but will be soon)
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    57
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    58
        classFilename   <String>        the file (or nil) where the classes
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    59
                                        sources are found 
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    60
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    61
        package         <Symbol>        the package, in which the class was defined
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    62
                                        (inserted by compilers)
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    63
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    64
        revision        <String>        revision string - inserted by stc
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    65
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    66
        primitiveSpec   <Array | nil>   describes primitiveIncludes, primitiveFunctions etc.
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    67
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    68
        environment     <Symbol | nil>  cached environment (i.e. Smalltalk or a namespace)
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    69
                                        of class
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    70
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    71
        signature       <SmallInteger>  the classes signature (used to detect obsolete
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    72
                                        or changed classes with binaryStorage)
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    73
                                        This is filled in lazy - i.e. upon the first signature query.
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    74
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    75
        hook            <any>           reserved: a place to add additional attributes,
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    76
                                        without a need to recompile all classes.
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    77
                                        Currently unused.
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    78
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    79
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    80
    WARNING: layout known by compiler and runtime system
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    81
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    82
    [author:]
4346
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    83
        Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
    84
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
    85
    [see also:]
4346
d7f7dd10d107 renamed OldMethods to MethodHistory.
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
    86
        Behavior ClassDescription Metaclass
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    87
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
    88
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    89
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
    90
!Class class methodsFor:'accessing-flags'!
362
claus
parents: 360
diff changeset
    91
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    92
tryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    93
    ^ TryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    94
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    95
    "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
    96
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    97
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    98
tryLocalSourceFirst:aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
    99
    TryLocalSourceFirst := aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   100
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   101
    "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
   102
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   103
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   104
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   105
    "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
   106
     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
   107
     decide to return something else."
362
claus
parents: 360
diff changeset
   108
claus
parents: 360
diff changeset
   109
    |prev|
claus
parents: 360
diff changeset
   110
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   111
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   112
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   113
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   114
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   115
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   116
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   117
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   118
     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
   119
     decide to return something else."
557
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
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   122
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   123
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   124
!Class class methodsFor:'helpers'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   125
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   126
revisionInfoFromString:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   127
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   128
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   129
    "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
   130
     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
   131
     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
   132
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   133
    "
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   134
     For now, this is a bad design - since the sourceCodeManager
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   135
     is not always delivered, here, a fallBack is provided.
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   136
     (should probably deliver some RCS-header extractor in any case,
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   137
      even if no AbstractSourceCodeManager is present)
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   138
     (knowing about the details of RCS headers here is a bad design ...)
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   139
    "
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   140
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   141
    |words info nm mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   142
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   143
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   144
    "/ 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
   145
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   146
    (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   147
        info := mgr revisionInfoFromString:aString.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   148
        info notNil ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   149
            ^ info
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   150
        ]
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   151
    ].
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   152
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   153
    "/
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   154
    "/ fallBack - handles some RCS headers only
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   155
    "/ is this really needed ?
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   156
    "/
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   157
    info := IdentityDictionary new.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   158
    words := aString asCollectionOfWords.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   159
744
db7b733455b9 dont crash with bad revision strings (again)
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   160
    words notEmpty ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   161
        "/
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   162
        "/ supported formats:
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   163
        "/
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   164
        "/ $-Header: pathName rev date time user state $
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   165
        "/ $-Revision: rev $
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   166
        "/ $-Id: fileName rev date time user state $
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   167
        "/
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   168
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   169
        ((words at:1) = '$Header:') ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   170
            nm := words at:2.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   171
            info at:#repositoryPathName put:nm.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   172
            (nm endsWith:',v') ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   173
                nm := nm copyWithoutLast:2
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   174
            ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   175
            info at:#fileName put:nm asFilename baseName.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   176
            words size > 2 ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   177
                (words at:3) = '$' ifFalse:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   178
                    info at:#revision put:(words at:3).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   179
                    (words at:4) = '$' ifFalse:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   180
                        info at:#date put:(words at:4).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   181
                        info at:#time put:(words at:5).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   182
                        info at:#user put:(words at:6).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   183
                        info at:#state put:(words at:7).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   184
                    ]
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   185
                ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   186
            ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   187
            ^ info
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   188
        ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   189
        ((words at:1) = '$Revision:') ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   190
            info at:#revision put:(words at:2).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   191
            ^ info
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   192
        ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   193
        ((words at:1) = '$Id:') ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   194
            info at:#fileName put:(words at:2).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   195
            info at:#revision put:(words at:3).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   196
            info at:#date put:(words at:4).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   197
            info at:#time put:(words at:5).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   198
            info at:#user put:(words at:6).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   199
            info at:#state put:(words at:7).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   200
            ^ info
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   201
        ].
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   202
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   203
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   204
    ^ nil
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   205
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   206
    "Created: 15.11.1995 / 14:58:35 / cg"
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   207
    "Modified: 29.1.1997 / 19:36:31 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   208
!
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   209
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   210
revisionStringFromSource:aMethodSourceString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   211
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   212
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   213
    "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
   214
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   215
    |lines line|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   216
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   217
    lines := aMethodSourceString asCollectionOfLines.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   218
    lines do:[:l |
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   219
        |i|
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   220
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   221
        i := l indexOfSubCollection:'$Header: '.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   222
        i ~~ 0 ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   223
            line := l copyFrom:i.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   224
            i := line lastIndexOf:$$.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   225
            i > 1 ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   226
                line := line copyTo:i.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   227
            ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   228
            ^ line
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   229
        ]
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   230
    ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   231
    ^ nil
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   232
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   233
    "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
   234
    "Modified: 16.10.1996 / 16:54:40 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   235
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   236
3618
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   237
!Class class methodsFor:'misc'!
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   238
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   239
template:aCategoryString
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   240
    "return a class-definition template"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   241
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   242
    ^ 'NameOfSuperclass subclass:#NameOfClass
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   243
    instanceVariableNames:''instVarName1 instVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   244
    classVariableNames:''classVarName1 classVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   245
    poolDictionaries:''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   246
    category:''' , aCategoryString , ''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   247
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   248
    "Created: / 19.6.1998 / 02:09:06 / cg"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   249
! !
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   250
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   251
!Class class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   252
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   253
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   254
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   255
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   256
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   257
    ^ self == Class class or:[self == Class]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   258
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   259
    "Created: 15.4.1996 / 17:17:13 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   260
    "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
   261
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   262
5190
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   263
!Class methodsFor:'Compatibility - ST80'!
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   264
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   265
fileOutSourceOn:aStream
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   266
    self fileOutOn:aStream withTimeStamp:false
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   267
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   268
    "Created: 20.6.1997 / 17:18:14 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   269
    "Modified: 20.6.1997 / 17:18:26 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   270
!
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   271
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   272
isVisualStartable
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   273
    "return true, if this is an application class,
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   274
     which can be started via #open"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   275
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   276
    ^ false
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   277
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   278
    "Created: / 27.10.1997 / 16:42:05 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   279
!
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   280
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   281
rename:newName
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   282
    "same as renameTo: - for ST80 compatibility"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   283
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   284
    ^ self renameTo:newName
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   285
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   286
    "Created: / 18.6.1998 / 22:08:45 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   287
! !
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   288
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   289
!Class methodsFor:'ST/V subclass creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   290
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   291
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   292
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   293
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   294
    "this method allows fileIn of ST/V and V'Age classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   295
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   296
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   297
    |cat app|
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   298
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   299
    DefaultApplicationQuerySignal isHandled ifTrue:[
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   300
        app := DefaultApplicationQuerySignal query.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   301
        app notNil ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   302
            cat := 'Applications-' , app name.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   303
        ] ifFalse:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   304
            cat := 'V''Age classes'.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   305
        ].
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   306
    ] ifFalse:[
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   307
        cat := 'ST/V classes'.
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   308
    ].
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   309
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   310
    ^ self subclass:t 
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   311
           instanceVariableNames:f
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   312
           classVariableNames:d
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   313
           poolDictionaries:s
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   314
           category:cat
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   315
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   316
    "Modified: / 15.6.1998 / 21:31:34 / cg"
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   317
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   318
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   319
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   320
variableByteSubclass:t classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   321
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   322
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   323
    "this method allows fileIn of ST/V and V'Age variable byte classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   324
     (which seem to have no category and no instvars)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   325
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   326
    |cat app|
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   327
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   328
    DefaultApplicationQuerySignal isHandled ifTrue:[
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   329
        app := DefaultApplicationQuerySignal query.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   330
        app notNil ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   331
            cat := 'Applications-' , app name.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   332
        ] ifFalse:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   333
            cat := 'V''Age classes'.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   334
        ]
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   335
    ] ifFalse:[
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   336
        cat := 'ST/V classes'.
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   337
    ].
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   338
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   339
    ^ self variableByteSubclass:t 
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   340
           instanceVariableNames:''
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   341
           classVariableNames:d
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   342
           poolDictionaries:s
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   343
           category:cat
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   344
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   345
    "Modified: / 15.6.1998 / 21:31:38 / cg"
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   346
    "Modified: / 18.3.1999 / 18:16:21 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   347
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   348
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   349
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
2071
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   350
    "{ Pragma: +optSpace }"
47a1f5d7e8a5 added #recompileForSpeed: - for convenience
Claus Gittinger <cg@exept.de>
parents: 2070
diff changeset
   351
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   352
    "this method allows fileIn of ST/V and V'Age variable pointer classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   353
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   354
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   355
    |cat app|
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   356
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   357
    DefaultApplicationQuerySignal isHandled ifTrue:[
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   358
        app := DefaultApplicationQuerySignal query.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   359
        app notNil ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   360
            cat := 'Applications-' , app name.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   361
        ] ifFalse:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   362
            cat := 'V''Age classes'.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   363
        ]
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   364
    ] ifFalse:[
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   365
        cat := 'ST/V classes'.
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   366
    ].
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   367
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   368
    ^ self variableSubclass:t 
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   369
           instanceVariableNames:f
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   370
           classVariableNames:d
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   371
           poolDictionaries:s
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   372
           category:cat
3585
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   373
96a7143a8ef9 support for V'Age fileIn (application stuff)
Claus Gittinger <cg@exept.de>
parents: 3495
diff changeset
   374
    "Modified: / 15.6.1998 / 21:31:41 / cg"
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
   375
    "Modified: / 18.3.1999 / 18:16:33 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   376
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   377
a27a279701f8 Initial revision
claus
parents:
diff changeset
   378
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   379
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   380
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   381
    "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
   382
     Also writes a change record and notifies dependents."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   383
5635
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   384
    |namespace|
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   385
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   386
    (self classVarNames includes:aString) ifFalse:[
5635
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   387
        self classVariableString:(self classVariableString , ' ' , aString).
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   388
        Class withoutUpdatingChangesDo:[
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   389
            self withAllSubclasses do:[:cls|
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   390
                cls recompileMethodsAccessingAnyClassvarOrGlobal:
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   391
                                        (Array with:aString asSymbol)
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   392
            ].
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   393
        ].
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   394
        self addChangeRecordForClass:self.
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   395
5635
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   396
        self changed:#definition.
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   397
        (namespace := self nameSpace) changed:#classDefinition with:self.
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   398
        namespace ~~ Smalltalk ifTrue:[
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   399
            Smalltalk changed:#classDefinition with:self.
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   400
        ].
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   401
        (namespace := self nameSpace) changed:#classVariables with:self.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   402
        namespace ~~ Smalltalk ifTrue:[
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   403
            Smalltalk changed:#classVariables with:self.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   404
        ].
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   405
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   406
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
   407
    "Created: / 29.10.1995 / 19:40:51 / cg"
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
   408
    "Modified: / 23.1.1998 / 15:46:23 / stefan"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   409
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   410
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   411
allPrivateClasses
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   412
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   413
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   414
    "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
   415
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   416
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   417
    ^ self privateClassesOrAll:true
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   418
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   419
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   420
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   421
category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   422
    "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
   423
     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
   424
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   425
    |owner|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   426
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   427
    (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
   428
    ^ category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   429
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   430
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   431
     Point category                
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   432
     Dictionary category           
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   433
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   434
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   435
    "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
   436
    "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
   437
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   438
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   439
category:aStringOrSymbol
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   440
    "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
   441
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
   442
    self setCategory:aStringOrSymbol.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   443
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   444
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   445
classFilename
4744
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
   446
    "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
   447
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   448
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   449
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   450
    (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
   451
    ^ classFilename
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   452
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   453
    "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
   454
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   455
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   456
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   457
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   458
     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
   459
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   460
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   461
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   462
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   463
     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
   464
     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
   465
     no classPools yet.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   466
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   467
    ^ Smalltalk at:(self name , ':' , aSymbol) asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   468
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   469
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   470
classVarAt:aSymbol ifAbsent:exceptionBlock
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   471
    "return the value of a class variable.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   472
     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
   473
     this may change."
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   474
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   475
    "
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   476
     this hides the (current) implementation of classVariables
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   477
     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
   478
     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
   479
     no classPools yet.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   480
    "
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   481
    ^ Smalltalk at:(self name , ':' , aSymbol) asSymbol ifAbsent:exceptionBlock
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   482
!
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   483
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   484
classVarAt:aSymbol put:something
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   485
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   486
     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
   487
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   488
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   489
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   490
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   491
     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
   492
     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
   493
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   494
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   495
    Smalltalk at:(self name , ':' , aSymbol) asSymbol put:something.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   496
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   497
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   498
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   499
    "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
   500
     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
   501
     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
   502
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   503
    classvars isNil ifTrue:[
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   504
        ^ OrderedCollection new
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   505
    ].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   506
    classvars isString ifTrue:[
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   507
        classvars := classvars asCollectionOfWords asArray.
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   508
        ^ classvars
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   509
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   510
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   511
    ^ classvars
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   512
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   513
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   514
     Object classVarNames 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   515
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   516
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   517
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   518
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   519
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   520
    "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
   521
     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
   522
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   523
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   524
    classvars isNil ifTrue:[^ ''].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   525
    classvars isString ifTrue:[
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   526
        ^ classvars
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   527
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   528
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   529
    ^ classvars asStringWith:(Character space)
557
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
     Object classVariableString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   533
     Float classVariableString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   534
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   535
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   536
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   537
classVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   538
    "set the classes classvarnames string; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   539
     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
   540
     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
   541
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   542
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   543
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   544
    (aString = self classVariableString) ifFalse:[
5614
3ff5ba088249 dont remove from an array
Claus Gittinger <cg@exept.de>
parents: 5612
diff changeset
   545
        prevVarNames := self classVarNames asOrderedCollection.
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   546
        classvars := aString.
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   547
        varNames := self classVarNames.
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   548
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   549
        "new ones get initialized to nil;
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   550
         - old ones are nilled and removed from Smalltalk"
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   551
        any := false.
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   552
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   553
        varNames do:[:aName |
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   554
            (prevVarNames includes:aName) ifFalse:[
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   555
                "a new one"
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   556
                self classVarAt:aName put:nil.
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   557
                any := true.
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   558
            ] ifTrue:[
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   559
                prevVarNames remove:aName
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   560
            ]
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   561
        ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   562
        "left overs are gone"
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   563
        prevVarNames do:[:aName |
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   564
            self classVarAt:aName put:nil.
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   565
            Smalltalk removeKey:(self name , ':' , aName) asSymbol.
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   566
        ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   567
        any ifTrue:[
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   568
            Smalltalk changed:#classVariables with:self
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   569
        ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   570
    ]
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   571
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   572
    "Modified: 2.4.1997 / 00:16:05 / stefan"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   573
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   574
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   575
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   576
    "return the comment (aString) of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   577
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   578
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   579
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   580
    "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
   581
     position within the classes sourcefile ...
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
    comment isNumber ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   584
        classFilename notNil ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   585
            stream := self sourceStream. 
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   586
            stream notNil ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   587
                stream position:comment.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   588
                string := String readFrom:stream onError:''.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   589
                stream close.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   590
                ^ string
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   591
            ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   592
            ^ nil
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   593
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   594
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   595
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   596
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   597
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   598
     Object comment 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   599
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   600
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   601
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   602
comment:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   603
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   604
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   605
    "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
   606
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   607
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   608
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   609
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   610
    newComment := aString.
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   611
    (aString notNil and:[aString isEmpty]) ifTrue:[
5770
051955790a9b send a change notification, when the comment changes
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   612
        newComment := nil
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   613
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   614
    comment ~= newComment ifTrue:[
5770
051955790a9b send a change notification, when the comment changes
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   615
        oldComment := self comment.
051955790a9b send a change notification, when the comment changes
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   616
        comment := newComment.
051955790a9b send a change notification, when the comment changes
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   617
        self addChangeRecordForClassComment:self.
051955790a9b send a change notification, when the comment changes
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   618
        self changed:#comment with:oldComment.
051955790a9b send a change notification, when the comment changes
Claus Gittinger <cg@exept.de>
parents: 5738
diff changeset
   619
        Smalltalk changed:#classComment with:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   620
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   621
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   622
2444
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   623
environment
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   624
    "return the namespace I am contained in; ST-80 compatible name"
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   625
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   626
    ^ self nameSpace
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   627
!
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   628
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   629
name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   630
    "return the name of the class. In the current implementation,
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   631
     this returns a string, but will be changed to Symbol soon."
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   632
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   633
    ^ name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   634
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   635
    "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
   636
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   637
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   638
nameSpace
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   639
    "return the namespace I am contained in;
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   640
     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
   641
     for public classes, Smalltalk is returned."
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   642
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   643
    |idx nsName|
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   644
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   645
    environment notNil ifTrue:[^ environment].
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   646
3661
161322291871 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
   647
    environment := Smalltalk. "/ default
161322291871 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
   648
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   649
    "/ due to the implementation, extract this from my name
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
   650
    "/ (physically, all classes are found in Smalltalk)
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   651
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   652
    idx := name lastIndexOf:$:.
3661
161322291871 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
   653
    idx ~~ 0 ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   654
        (name at:idx-1) == $: ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   655
            nsName := name copyTo:(idx - 2).
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   656
            environment := Smalltalk at:nsName asSymbol.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   657
        ]
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   658
    ].
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   659
    ^ environment
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
   660
3661
161322291871 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
   661
    "Modified: / 20.7.1998 / 14:21:36 / cg"
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   662
!
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   663
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   664
package
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
   665
    "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
   666
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   667
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   668
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   669
    (owner := self owningClass) notNil ifTrue:[^ owner package].
5562
76675d5a0da9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5545
diff changeset
   670
    ^ package ? ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   671
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   672
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   673
     Object package  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   674
    "
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   675
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
   676
    "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
   677
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   678
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   679
package:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   680
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   681
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   682
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   683
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   684
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   685
packageInfo
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   686
    "return the package-info of the class - or nil.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   687
     The packageManager contains information relevant to the package,
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   688
     to which this class belongs - especially, things like pathes to
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   689
     resources, additional files etc. can be optioned this way.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   690
     A packageInfo loosely relates to ehat a classLoader is in Java.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   691
     Experimental."
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   692
4742
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   693
    |packageId prj handle t|
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   694
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   695
    packageId := self package.
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   696
    packageId notNil ifTrue:[
4742
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   697
        prj := Project projectWithId:packageId.
4743
11f9e45976cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4742
diff changeset
   698
        prj notNil ifTrue:[^ prj].
4742
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   699
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   700
        "/
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   701
        "/ intermediate kludge (will be removed)
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   702
        "/ search for a loaded class library and extract
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   703
        "/ information from it ...
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   704
        "/
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   705
        handle := ObjectFileLoader loadedObjectHandles 
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   706
                    detect:[:h | |cls|
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   707
                        cls := h classes firstIfEmpty:nil.
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   708
                        cls notNil and:[cls package = packageId]
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   709
                    ]
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   710
                    ifNone:nil.
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   711
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   712
        handle notNil ifTrue:[
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   713
            prj := Project new.
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   714
            prj name:packageId.
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   715
            prj directory:(handle pathName asFilename directory pathName).
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   716
            prj package:packageId.
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   717
            t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   718
            prj repositoryModule:(t first).
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   719
            prj repositoryDirectory:(packageId copyFrom:t first size + 2).
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   720
            prj isLoaded:true.
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   721
            ^ prj
59256069f8f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4740
diff changeset
   722
        ]
4740
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   723
    ].
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   724
    ^ nil
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   725
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   726
    "
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   727
     Object packageInfo 
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   728
     OSI::FTAMOperation packageInfo 
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   729
    "
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   730
!
fda50b1e4fa5 added packageInfo
Claus Gittinger <cg@exept.de>
parents: 4733
diff changeset
   731
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   732
primitiveDefinitions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   733
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   734
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   735
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   736
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
   737
    self setPrimitiveDefinitions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   738
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   739
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   740
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   741
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   742
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   743
primitiveDefinitionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   744
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   745
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   746
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   747
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   748
    ^ self getPrimitiveSpecsAt:1
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   749
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   750
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   751
     Object primitiveDefinitionsString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   752
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   753
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   754
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   755
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   756
primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   757
    "return the primitiveDefinition string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   758
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   759
    ^ self primitiveDefinitionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   760
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   761
/*
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   762
 * includes, defines, structure definitions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   763
 * and typedefs come here.
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   764
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   765
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   766
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   767
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   768
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   769
     Object primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   770
     String primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   771
     ExternalStream primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   772
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   773
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   774
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   775
primitiveFunctions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   776
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   777
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   778
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   779
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
   780
    self setPrimitiveFunctions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   781
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   782
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   783
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   784
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   785
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   786
primitiveFunctionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   787
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   788
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   789
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   790
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   791
    ^ self getPrimitiveSpecsAt:3 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   792
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   793
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   794
primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   795
    "return the primitiveFunction string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   796
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   797
    ^ self primitiveFunctionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   798
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   799
/* 
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   800
 * any local C (helper) functions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   801
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   802
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   803
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   804
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   805
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   806
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   807
     Object primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   808
     String primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   809
     ExternalStream primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   810
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   811
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   812
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   813
primitiveSpec
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   814
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   815
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   816
    "return the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   817
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   818
    ^  primitiveSpec
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   819
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   820
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   821
primitiveSpec:anArrayOf3ElementsOrNil
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   822
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   823
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   824
    "set the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   825
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   826
    primitiveSpec := anArrayOf3ElementsOrNil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   827
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   828
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   829
primitiveVariables:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   830
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   831
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   832
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   833
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
   834
    self setPrimitiveVariables:aString.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   835
    self addChangeRecordForPrimitiveVariables:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   836
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   837
    "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
   838
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   839
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   840
primitiveVariablesString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   841
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   842
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   843
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   844
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   845
    ^ self getPrimitiveSpecsAt:2 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   846
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   847
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   848
primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   849
    "return the primitiveVariable string or a default"
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
    ^ self primitiveVariablesString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   852
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   853
/* 
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   854
 * any local C variables
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   855
 * come here (please, define as static)
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
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   860
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   861
     Object primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   862
     String primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   863
     ExternalStream primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   864
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   865
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
   866
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   867
privateClasses
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   868
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   869
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   870
    "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
   871
     The classes are in any order."
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   872
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   873
    ^ self privateClassesOrAll:false
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   874
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   875
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   876
     Object privateClasses
2718
f7b5e3bffd78 sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
   877
     ObjectMemory privateClasses 
f7b5e3bffd78 sort privateClasses by name, to avoid undefined ordering
Claus Gittinger <cg@exept.de>
parents: 2712
diff changeset
   878
     UILayoutTool privateClasses 
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   879
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   880
3495
31ae10035c74 skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents: 3494
diff changeset
   881
    "Modified: / 29.5.1998 / 23:23:18 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   882
!
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   883
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   884
privateClassesAt:aClassNameStringOrSymbol
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   885
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   886
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   887
    "return a private class if present; nil otherwise"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   888
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   889
    |nmSym|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   890
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   891
    nmSym := (self name , '::' , aClassNameStringOrSymbol) asSymbolIfInterned.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   892
    nmSym isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   893
        "/ no such symbol - there cannot be a corresponding private class
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
   894
        ^ nil
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   895
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
   896
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   897
    ^ Smalltalk at:nmSym.
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   898
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   899
    "Modified: 26.6.1997 / 11:44:04 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   900
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   901
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   902
privateClassesAt:aClassNameStringOrSymbol put:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   903
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   904
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   905
    "add a private class"
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   906
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   907
    self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   908
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
   909
    "Modified: 26.6.1997 / 11:44:12 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   910
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
   911
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   912
privateClassesOrAll:allOfThem
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   913
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   914
4495
4804e3e33d76 tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents: 4400
diff changeset
   915
    "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
   916
     or direct plus indirect private classes (if allOfThem).
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   917
     An empty collection if there are none.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   918
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   919
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   920
    |classes myName myNamePrefix myNamePrefixLen|
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   921
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   922
    myName := self name.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   923
    myNamePrefix := myName , '::'.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   924
    myNamePrefixLen := myNamePrefix size.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   925
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   926
    Smalltalk keysDo:[:nm |
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   927
        |cls|
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   928
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   929
        (nm startsWith:myNamePrefix) ifTrue:[
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   930
            (allOfThem
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   931
            or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   932
                cls := Smalltalk at:nm.
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   933
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   934
                (cls isBehavior and:[cls isMeta not]) ifTrue:[
4578
705211312d94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
   935
                    classes isNil ifTrue:[
705211312d94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
   936
                        classes := IdentitySet new:10.
705211312d94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
   937
                    ].
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   938
                    classes add:cls.
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   939
                ]
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   940
            ]
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   941
        ]
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   942
    ].
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
   943
4578
705211312d94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
   944
    ^ classes ? #()
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   945
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   946
    "
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   947
     UILayoutTool privateClassesOrAll:true 
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   948
     UILayoutTool privateClassesOrAll:false 
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   949
    "
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   950
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   951
    "Modified: / 29.5.1998 / 23:23:18 / cg"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   952
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   953
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   954
privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   955
    "{ Pragma: +optSpace }"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   956
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   957
    "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
   958
     The classes are sorted by inheritance."
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   959
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   960
    |classes|
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   961
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   962
    classes := self privateClasses.
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   963
    (classes size > 0) ifTrue:[
5731
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
   964
        classes := classes asOrderedCollection.
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
   965
        classes sort:[:a :b | a name < b name].
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
   966
        classes topologicalSort:[:a :b | b isSubclassOf:a].
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   967
    ].
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   968
    ^ classes.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   969
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   970
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   971
     Object privateClassesSorted
5731
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
   972
     NewSystemBrowser privateClassesSorted
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
   973
     NewSystemBrowser privateClasses
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   974
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   975
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   976
    "Created: 22.3.1997 / 16:10:42 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   977
    "Modified: 22.3.1997 / 16:11:20 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   978
!
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
   979
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   980
removeClassVarName:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   981
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   982
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   983
    "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
   984
     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
   985
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   986
    |names newNames namespace|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   987
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   988
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   989
    (names includes:aString) ifTrue:[
5635
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   990
        newNames := ''.
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   991
        names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']].
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   992
        self classVariableString:newNames withoutSpaces.
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   993
        Class withoutUpdatingChangesDo:[
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   994
            self withAllSubclasses do:[:cls|
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   995
                cls recompileMethodsAccessingAnyClassvarOrGlobal:
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   996
                                        (Array with:aString asSymbol)
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   997
            ].
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   998
        ].
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
   999
        self addChangeRecordForClass:self.
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
  1000
5635
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1001
        self changed:#definition.
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1002
        (namespace := self nameSpace) changed:#classDefinition with:self.
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1003
        namespace ~~ Smalltalk ifTrue:[
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1004
            Smalltalk changed:#classDefinition with:self.
036069e1b8f7 change notifications when adding/removing class vars
Claus Gittinger <cg@exept.de>
parents: 5614
diff changeset
  1005
        ].
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
  1006
        (namespace := self nameSpace) changed:#classVariables with:self.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
  1007
        namespace ~~ Smalltalk ifTrue:[
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
  1008
            Smalltalk changed:#classVariables with:self.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
  1009
        ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1010
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1011
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1012
    "Created: / 29.10.1995 / 19:42:08 / cg"
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1013
    "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
  1014
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1015
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1016
setCategory:aStringOrSymbol
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1017
    "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
  1018
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1019
    aStringOrSymbol isNil ifTrue:[
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1020
        category := aStringOrSymbol
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1021
    ] ifFalse:[
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1022
        category := aStringOrSymbol asSymbol
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1023
    ]
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1024
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1025
    "Created: 1.4.1997 / 15:24:04 / stefan"
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1026
!
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1027
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1028
setClassFilename:aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1029
    "set the classes filename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1030
     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
  1031
     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
  1032
     is set here."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1033
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1034
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1035
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1036
    "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
  1037
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1038
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1039
setClassVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1040
    "set the classes classvarnames string. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1041
     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
  1042
     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
  1043
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1044
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1045
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1046
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1047
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1048
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1049
    "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
  1050
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1051
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1052
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1053
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1054
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1055
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1056
    "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
  1057
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1058
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1059
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1060
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1061
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1062
    categoryStringOrSymbol isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1063
        cat := ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1064
    ] ifFalse:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1065
        cat := categoryStringOrSymbol
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1066
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1067
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1068
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1069
5248
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1070
setEnvironment:aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1071
    "set the namespace I am contained in; ST-80 compatible name"
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1072
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1073
    environment := aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1074
!
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1075
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1076
setPackage:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1077
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1078
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1079
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1080
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1081
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1082
setPrimitiveDefinitions:aString
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1083
    "{ Pragma: +optSpace }"
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1084
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1085
    "set the primitiveDefinition string (no change notifications)"
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1086
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1087
    self setPrimitiveSpecsAt:1 to:aString.
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1088
!
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1089
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1090
setPrimitiveFunctions:aString
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1091
    "{ Pragma: +optSpace }"
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1092
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1093
    "set the primitiveFunction string (no change notifications)"
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1094
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1095
    self setPrimitiveSpecsAt:3 to:aString.
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1096
!
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1097
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1098
setPrimitiveVariables:aString
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1099
    "{ Pragma: +optSpace }"
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1100
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1101
    "set the primitiveVariable string (no change notifications)"
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1102
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1103
    self setPrimitiveSpecsAt:2 to:aString.
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1104
!
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1105
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1106
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1107
    "return the classes full source code"
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
    |code aStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1110
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1111
" this is too slow for big classes ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1112
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1113
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1114
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1115
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1116
    aStream := FileStream newFileNamed:'__temp'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1117
    aStream isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1118
        self notify:'cannot create temporary file.'.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1119
        ^ nil
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1120
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1121
    FileOutErrorSignal handle:[:ex |
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1122
        aStream nextPutAll:'"no source available"'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1123
    ] do:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1124
        self fileOutOn:aStream.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1125
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1126
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1127
    aStream := FileStream oldFileNamed:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1128
    aStream isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1129
        self notify:'oops - cannot reopen temp file'.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1130
        ^ nil
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1131
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1132
    code := aStream contents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1133
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1134
    OperatingSystem removeFile:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1135
    ^ code
385
claus
parents: 384
diff changeset
  1136
!
claus
parents: 384
diff changeset
  1137
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1138
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1139
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1140
     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
  1141
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1142
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1143
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1144
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1145
    (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
  1146
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1147
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1148
    "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
  1149
    "Modified: 15.10.1996 / 18:54:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1150
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1151
5257
a90fd9cb3c18 category rename
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
  1152
!Class methodsFor:'adding & removing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1153
2036
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1154
removeFromSystem
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1155
    "ST-80 compatibility
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1156
     remove myself from the system"
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1157
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1158
    ^ Smalltalk removeClass:self
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1159
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1160
    "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
  1161
!
bedc0bb03129 changeFile updates must use the classes full name.
Claus Gittinger <cg@exept.de>
parents: 2021
diff changeset
  1162
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1163
unload
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1164
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1165
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1166
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1167
     autoloaded. Can be used to get rid of no longer needed autoloaded
328
claus
parents: 326
diff changeset
  1168
     classes. 
claus
parents: 326
diff changeset
  1169
     (maybe, autoloaded classes should unload themselfes when no
claus
parents: 326
diff changeset
  1170
      longer needed - for example, after some delay when the last instance 
claus
parents: 326
diff changeset
  1171
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1172
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1173
    |nm newClass|
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1174
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1175
    self wasAutoloaded ifFalse:[
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1176
        "
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1177
         can it be done ?
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1178
         (all of my methods must have a source)
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1179
        "
5370
1fce1ecf8b53 use #allSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 5344
diff changeset
  1180
        self allSelectorsAndMethodsDo:[:sel :aMethod |
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1181
            aMethod source isNil ifTrue:[^false].
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1182
            aMethod hasPrimitiveCode ifTrue:[^ false].
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1183
        ].
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1184
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1185
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1186
    "/ cannot unload, if non-autoloaded subclasses exist ...
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1187
    self allSubclassesDo:[:aClass |
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1188
        aClass wasAutoloaded ifFalse:[
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1189
            aClass isPrivate ifFalse:[
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1190
                self warn:('cannot unload ' , self name , ' (' , aClass name , ' requires it').
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1191
                ^ self.
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1192
            ]
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1193
        ]
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1194
    ].
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1195
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1196
    self allSubclassesDo:[:aClass |
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1197
        aClass wasAutoloaded ifTrue:[
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1198
            aClass unload
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1199
        ] ifFalse:[
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1200
            aClass removeFromSystem.
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1201
        ]
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1202
    ].
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1203
    self privateClasses do:[:aClass |
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1204
        aClass removeFromSystem.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1205
    ].
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1206
    Transcript showCR:'unloading ' , name , ' ...'.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1207
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1208
    "/ reinstall as autoloaded
359
claus
parents: 357
diff changeset
  1209
    Autoload removeClass:self.    
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1210
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1211
    Smalltalk at:nm put:nil.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1212
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1213
    ObjectMemory flushMethodCache.
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1214
    newClass := Autoload addClass:nm inCategory:category.
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1215
    newClass notNil ifTrue:[
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1216
        newClass package:package
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1217
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1218
    Smalltalk flushCachedClasses.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1219
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1220
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1221
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1222
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1223
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1224
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1225
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1226
    "
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1227
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1228
    "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
  1229
    "Modified: 4.6.1997 / 14:48:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1230
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1231
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1232
!Class methodsFor:'binary storage'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1233
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1234
addGlobalsForBinaryStorageTo:globalDictionary
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1235
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1236
    classPool == nil ifFalse: [
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1237
        classPool associationsDo: [:assoc|
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1238
            globalDictionary at: assoc put: self
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1239
        ]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1240
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1241
"
2477
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1242
3fb0bf03bb5a renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2463
diff changeset
  1243
    "Created: 21.3.1997 / 15:40:45 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1244
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1245
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1246
binaryClassDefinitionFrom:stream manager:manager
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1247
    "retrieve a class as stored previously with
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1248
     #storeBinaryClassOn:manager:
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1249
     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
  1250
     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
  1251
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1252
    |superclassName name flags instvars classvars category classInstVars
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1253
     comment package superclassSig rev
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1254
     newClass superClass methods cmethods formatID environment
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1255
     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
  1256
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1257
    "/ 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
  1258
    "/ the storing in #storeBinaryClassOn:manager:
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1259
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1260
    "/ retrieve
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1261
    "/   formatID
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1262
    "/   superclasses name,
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1263
    "/   superclasses signature
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1264
    "/   name,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1265
    "/   typeSymbol,
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1266
    "/   instVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1267
    "/   classVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1268
    "/   category
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1269
    "/   classInstVarNames
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1270
    "/   comment
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1271
    "/   revision
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1272
    "/   package
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1273
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1274
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1275
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1276
    "/   number of private classes
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1277
    "/   private classes, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1278
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1279
    formatID := manager nextObject.
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1280
    formatID isInteger ifFalse:[       "/ backward compatibilty
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1281
        formatID := nil.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1282
        superclassName := formatID
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1283
    ] ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1284
        superclassName := manager nextObject.
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1285
    ].
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1286
    superclassSig := manager nextObject.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1287
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1288
    superclassName notNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1289
        superClass := Smalltalk at:superclassName ifAbsent:nil.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1290
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1291
        superClass isNil ifTrue:[
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1292
            BinaryIOManager nonexistingClassSignal
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1293
                raiseRequestWith:'non existent superclass (in binaryLoad)'.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1294
            ^ nil
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1295
        ].
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1296
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1297
        "/ ('loading superclass: ' ,  superclassName ) printNL.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1298
        superClass autoload.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1299
        superClass := Smalltalk at:superclassName.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1300
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1301
        superclassSig ~= superClass signature ifTrue:[
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1302
            BinaryIOManager changedInstLayoutSignal
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1303
                raiseRequestWith:'incompatible superclass (in binaryLoad)'.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1304
            ^ nil
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1305
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1306
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1307
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1308
    name := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1309
    flags := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1310
    instvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1311
    instvars isNil ifTrue:[instvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1312
    classvars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1313
    classvars isNil ifTrue:[classvars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1314
    category := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1315
    classInstVars := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1316
    classInstVars isNil ifTrue:[classInstVars := ''].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1317
    comment := manager nextObject.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1318
    package := manager nextObject.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1319
    formatID == 1 ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1320
        rev := manager nextObject.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1321
        ownerName := manager nextObject.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1322
        ownerName notNil ifTrue:[
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1323
            name := name copyFrom:(ownerName size + 2 + 1).
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1324
            owner := Smalltalk at:ownerName.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1325
        ]
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1326
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1327
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1328
"/    'got superName:' print. superclassName printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1329
"/    'got name:' print. name printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1330
"/    'got flags: ' print. flags printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1331
"/    'got instvars: ' print. instvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1332
"/    'got classvars: ' print. classvars printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1333
"/    'got category: ' print. category printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1334
"/    'got classInstvars: ' print. classInstVars printNL.
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
"/ ('create class: ' ,  name ) printNL.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1337
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1338
    owner notNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1339
        environment := owner
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1340
    ] ifFalse:[
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1341
        environment := Class nameSpaceQuerySignal query.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1342
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1343
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1344
    cls := superClass.
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1345
    superClass isNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1346
        cls := Object
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1347
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1348
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1349
    newClass := cls class
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1350
            name:name asSymbol
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1351
            in:environment
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1352
            subclassOf:cls
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1353
            instanceVariableNames:instvars
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1354
            variable:false
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1355
            words:false 
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1356
            pointers:true
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1357
            classVariableNames:classvars
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1358
            poolDictionaries:'' 
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1359
            category:category
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1360
            comment:comment 
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1361
            changed:false 
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1362
            classInstanceVariableNames:classInstVars.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1363
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1364
    newClass isNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1365
        ^ nil.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1366
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1367
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1368
    superClass isNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1369
        newClass setSuperclass:nil.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1370
        newClass class setSuperclass:Class.
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1371
    ].
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1372
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1373
"/ Transcript showCR:'loaded ' , name , ' in ' , environment name.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1374
1802
f9148cfae747 handle nil-subclasses in binaryLoad
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1375
    newClass flags:flags.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1376
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1377
    "/ retrieve class methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1378
    cmethods := MethodDictionary binaryFullDefinitionFrom:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1379
    "/ retrieve inst methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1380
    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
  1381
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1382
    formatID == 1 ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1383
        "/ privateClasses
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1384
        nPrivate := manager nextObject.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1385
        nPrivate timesRepeat:[
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1386
            Class nameSpaceQuerySignal
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1387
                answer:newClass
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1388
                do:[
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1389
                    privateClass := manager nextObject
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1390
                ]
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1391
        ]
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1392
    ].
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1393
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1394
    (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
  1395
    newClass isNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1396
        ^ nil
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1397
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1398
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1399
    owner notNil ifTrue:[
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1400
        newClass setCategory:nil.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1401
    ] ifFalse:[
5725
00c2d5e78792 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  1402
        newClass setPackage:package.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1403
    ].
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1404
    newClass allSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:package].
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1405
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1406
    newClass methodDictionary:methods.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1407
    newClass class methodDictionary:cmethods.
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1408
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1409
    newClass initializeWithAllPrivateClasses.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1410
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1411
    ^ newClass
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1412
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1413
    "Created: / 8.10.1996 / 17:57:02 / cg"
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1414
    "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
  1415
    "Modified: / 18.3.1999 / 18:15:58 / stefan"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1416
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1417
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1418
storeBinaryClassOn:stream manager:manager
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1419
    "store a classes complete description (i.e. including methods).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1420
     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
  1421
     be either present or autoloadable."
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1422
4022
173f99e823ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4021
diff changeset
  1423
    |s sig owner privateClasses nPrivate|
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1424
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1425
    stream nextPut: manager codeForClass.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1426
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1427
    "/ the following order must correlate to
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1428
    "/ the storing in #binaryDefinitionFrom:manager:
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1429
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1430
    "/ store
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1431
    "/   format ID
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1432
    "/   superclasses name
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1433
    "/   superclasses signature
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1434
    "/   name
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1435
    "/   typeSymbol,
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1436
    "/   instVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1437
    "/   classVarNames
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1438
    "/   category
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1439
    "/   classInstVarNames
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1440
    "/   comment
902
2e1c740a255f also store the package in binaryClassStore
Claus Gittinger <cg@exept.de>
parents: 900
diff changeset
  1441
    "/   package
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1442
    "/   revision
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1443
    "/   name of owner, or nil
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1444
    "/   classes methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1445
    "/   methodDictionary
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1446
    "/   # of privateClass names
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1447
    "/   privateClasses, if any
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1448
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1449
    1 storeBinaryOn:stream manager:manager.  "/ formatID
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1450
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1451
    owner := self owningClass.
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1452
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1453
    superclass isNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1454
        s := nil.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1455
        sig := 0.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1456
    ] ifFalse:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1457
        s := superclass name.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1458
        sig := superclass signature.
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1459
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1460
    s storeBinaryOn:stream manager:manager.
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1461
    sig storeBinaryOn:stream manager:manager.
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1462
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1463
    name storeBinaryOn:stream manager:manager.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1464
    flags storeBinaryOn:stream manager:manager.
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1465
    (instvars isNil or:[instvars isEmpty]) ifTrue:[
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1466
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1467
    ] ifFalse:[
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
  1468
        s := self instanceVariableString
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1469
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1470
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1471
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
  1472
    (classvars isNil or:[classvars isEmpty]) ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1473
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1474
    ] ifFalse:[
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
  1475
        s := self classVariableString
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1476
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1477
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1478
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1479
    "/ the category
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1480
    owner notNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1481
        nil storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1482
    ] ifFalse:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1483
        category storeBinaryOn:stream manager:manager.
1759
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1484
    ].
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1485
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1486
    "/ the classInstVarString
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1487
    s := self class instanceVariableString.
5b7c001edc06 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1756
diff changeset
  1488
    (s notNil and:[s isEmpty]) ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1489
        s := nil
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1490
    ].
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1491
    s storeBinaryOn:stream manager:manager.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1492
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1493
    "/ the comment
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1494
    s := comment.
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1495
    manager sourceMode == #discard ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1496
        s := nil
900
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1497
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1498
    s storeBinaryOn:stream manager:manager.
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1499
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1500
    "/ the revision, package & owner
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  1501
    owner notNil ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1502
        nil storeBinaryOn:stream manager:manager.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1503
        nil storeBinaryOn:stream manager:manager.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1504
        owner name storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1505
    ] ifFalse:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1506
        package storeBinaryOn:stream manager:manager.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1507
        revision storeBinaryOn:stream manager:manager.
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1508
        nil storeBinaryOn:stream manager:manager.
1748
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1509
    ].
5cb3ceffa216 more care for private classes in binaryStore
Claus Gittinger <cg@exept.de>
parents: 1747
diff changeset
  1510
944
841e99b1a73a check signature in binaryLoad of classes
Claus Gittinger <cg@exept.de>
parents: 942
diff changeset
  1511
    "/
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1512
    "/ store class method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1513
    "/ 
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1514
    self class methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1515
    "/ store inst method dictionary and methods
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1516
    self methodDictionary storeFullBinaryDefinitionOn:stream manager:manager.    
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1517
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1518
    "/
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1519
    "/ names of private classes
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1520
    "/
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1521
    privateClasses := self privateClassesSorted.
4022
173f99e823ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4021
diff changeset
  1522
    (nPrivate := privateClasses size) storeBinaryOn:stream manager:manager.
173f99e823ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4021
diff changeset
  1523
    nPrivate > 0 ifTrue:[
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1524
        privateClasses do:[:aClass |
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1525
            aClass storeBinaryClassOn:stream manager:manager
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1526
        ]
1747
e6323406510c added a nameSpace QuerySignal;
Claus Gittinger <cg@exept.de>
parents: 1746
diff changeset
  1527
    ].
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1528
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1529
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1530
     |bos|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1531
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1532
     bos := BinaryObjectStorage onNew: (Filename named: 'FBrowser.cls') writeStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1533
     bos nextPutClasses:(Array with:FileBrowser).
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1534
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1535
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1536
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1537
     |bos cls|
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1538
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1539
     bos := BinaryObjectStorage onOld: (Filename named: 'FBrowser.cls') readStream.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1540
     cls := bos next.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1541
     bos close.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1542
     cls open.
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1543
    "
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1544
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  1545
    "Modified: / 7.6.1996 / 13:39:02 / stefan"
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1546
    "Modified: / 16.2.1999 / 07:07:00 / cg"
872
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1547
!
af04035b443d binary class storage support
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
  1548
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1549
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
  1550
    "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
  1551
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1552
    | string |
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1553
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1554
    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
  1555
    stream nextNumber: 2 put: string size.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1556
    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
  1557
"/    string do: [:char| stream nextPut: char asciiValue]
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1558
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1559
    "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
  1560
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1561
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1562
storeBinaryDefinitionOn: stream manager: manager
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1563
    "store the receiver in a binary format on stream.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1564
     This is an internal interface for binary storage mechanism.
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1565
     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
  1566
     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
  1567
     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
  1568
     restore time.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1569
     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
  1570
     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
  1571
     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
  1572
     (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
  1573
    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
  1574
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1575
    |varnames n sz|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1576
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1577
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1578
     output the signature
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1579
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1580
    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
  1581
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1582
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1583
     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
  1584
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1585
    varnames := self allInstVarNames.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1586
    n := varnames size.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1587
    n == 0 ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1588
        sz := 0
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1589
    ] ifFalse:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1590
        sz := varnames inject:0 into:[:sum :nm | sum + nm size].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1591
        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
  1592
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1593
    stream nextNumber:2 put:sz.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1594
    varnames keysAndValuesDo:[:i :nm |
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1595
        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
  1596
"/        nm do:[:c |
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1597
"/            stream nextPut:c asciiValue
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1598
"/        ].
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  1599
        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
  1600
    ].
138ea0c188ee also store comment; handle nil-subclasses
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1601
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1602
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1603
     output my name
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1604
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1605
    stream nextNumber:2 put:name size.
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1606
    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
  1607
"/    name do:[:c| 
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1608
"/        stream nextPut:c asciiValue
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1609
"/    ]
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1610
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1611
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1612
     |s|
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1613
     s := WriteStream on:ByteArray new.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1614
     Rectangle storeBinaryOn:s.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1615
     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
  1616
    "
1259
8c62958114ad commentary
Claus Gittinger <cg@exept.de>
parents: 1237
diff changeset
  1617
2463
b0937b570306 save strings in one write (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
  1618
    "Modified: 19.3.1997 / 18:47:10 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1619
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1620
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1621
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1622
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1623
addChangeRecordForChangeCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1624
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1625
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1626
    "add a category change record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1627
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1628
    Class updateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1629
        self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1630
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1631
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1632
    "Modified: / 4.6.1997 / 14:56:13 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1633
    "Modified: / 18.3.1999 / 18:13:53 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1634
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1635
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1636
addChangeRecordForClass:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1637
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1638
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1639
    "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
  1640
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1641
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1642
        self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1643
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1644
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1645
    "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
  1646
    "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
  1647
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1648
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1649
addChangeRecordForClassCheckIn:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1650
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1651
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1652
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1653
1938
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1654
    |rv|
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1655
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1656
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1657
        rv := aClass revision.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1658
        rv isNil ifTrue:[rv := '???'].
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1659
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1660
        self 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1661
            writingChangeWithTimeStamp:false 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1662
            perform:#addInfoRecord:to: 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1663
            with:('checkin ' , aClass name , ' (' , rv , ')').
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1664
    ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1665
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1666
    "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
  1667
    "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
  1668
    "Modified: / 18.3.1999 / 18:14:14 / stefan"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1669
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1670
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1671
addChangeRecordForClassComment:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1672
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1673
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1674
    "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
  1675
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1676
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1677
        self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1678
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1679
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1680
    "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
  1681
    "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
  1682
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1683
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1684
addChangeRecordForClassContainerRemove:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1685
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1686
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1687
    "append a container-was-removed-record to the changes file"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1688
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1689
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1690
        self 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1691
            writingChangeWithTimeStamp:false 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1692
            perform:#addInfoRecord:to: 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1693
            with:('removed source container of ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1694
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1695
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1696
    "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
  1697
    "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
  1698
    "Modified: / 18.3.1999 / 18:14:31 / stefan"
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1699
!
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1700
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1701
addChangeRecordForClassFileOut:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1702
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1703
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1704
    "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
  1705
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1706
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1707
        self 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1708
            writingChangeWithTimeStamp:false 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1709
            perform:#addInfoRecord:to: 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1710
            with:('fileOut ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1711
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1712
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1713
    "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
  1714
    "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
  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
addChangeRecordForClassInstvars: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-instvars-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:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1723
        self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1724
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1725
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1726
    "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
  1727
    "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
  1728
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1729
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1730
addChangeRecordForClassRemove:oldName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1731
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1732
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1733
    "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
  1734
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1735
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1736
        self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1737
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1738
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1739
    "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
  1740
    "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
  1741
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1742
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1743
addChangeRecordForClassRename:oldName to:newName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1744
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1745
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1746
    "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
  1747
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1748
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1749
        self writingChangeDo:[:aStream |
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1750
            self addChangeRecordForClassRename:oldName to:newName to:aStream
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1751
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1752
    ]
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  1753
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1754
    "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
  1755
    "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
  1756
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1757
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1758
addChangeRecordForPrimitiveDefinitions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1759
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1760
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1761
    "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
  1762
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1763
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1764
        self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1765
        Project notNil ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1766
            Project addPrimitiveDefinitionsChangeFor:aClass
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1767
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1768
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1769
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1770
    "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
  1771
    "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
  1772
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1773
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1774
addChangeRecordForPrimitiveFunctions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1775
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1776
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1777
    "add a primitiveFunctions-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1778
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1779
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1780
        self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1781
        Project notNil ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1782
            Project addPrimitiveFunctionsChangeFor:aClass
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1783
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1784
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1785
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1786
    "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
  1787
    "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
  1788
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1789
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1790
addChangeRecordForPrimitiveVariables:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1791
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1792
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1793
    "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
  1794
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1795
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1796
        self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1797
        Project notNil ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1798
            Project addPrimitiveVariablesChangeFor:aClass
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1799
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1800
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1801
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1802
    "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
  1803
    "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
  1804
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1805
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1806
addChangeRecordForSnapshot:aFileName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1807
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1808
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1809
    "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
  1810
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1811
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1812
        self 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1813
            writingChangeWithTimeStamp:false 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1814
            perform:#addInfoRecord:to: 
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1815
            with:('snapshot ' , aFileName).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1816
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1817
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1818
    "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
  1819
    "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
  1820
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1821
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1822
addChangeRecordForSnapshot:aFileName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1823
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1824
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1825
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1826
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1827
    UpdateChangeFileQuerySignal query ifTrue:[
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1828
        self addInfoRecord:('snapshot ' , aFileName) to:aStream
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1829
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1830
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1831
    "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
  1832
    "Modified: / 18.3.1999 / 18:15:30 / stefan"
2917
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  1833
! !
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  1834
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1835
!Class methodsFor:'enumerating'!
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1836
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1837
allPrivateClassesDo:aBlock
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1838
    "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
  1839
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1840
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1841
    self allPrivateClasses do:aBlock 
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1842
!
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  1843
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1844
privateClassesDo:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1845
    "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
  1846
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1847
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1848
    self privateClasses do:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1849
!
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1850
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1851
withAllPrivateClassesDo:aBlock
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1852
    "evaluate aBlock on myself and all of my private classes (if any).
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1853
     This recurses into private classes of private classes.
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1854
     Evaluation is in no particular order."
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1855
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1856
    aBlock value:self.
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  1857
    self allPrivateClasses do:aBlock 
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1858
! !
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  1859
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1860
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1861
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1862
primitiveDefinitions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1863
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1864
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1865
     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
  1866
     unprocessed contents in the classes primitiveDefinitions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1867
     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
  1868
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1869
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1870
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1871
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1872
    "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
  1873
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1874
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1875
primitiveFunctions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1876
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1877
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1878
     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
  1879
     unprocessed contents in the classes primitiveFunctions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1880
     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
  1881
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1882
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1883
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1884
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1885
    "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
  1886
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1887
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1888
primitiveVariables
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1889
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1890
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1891
     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
  1892
     unprocessed contents in the classes primitiveVariables section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1893
     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
  1894
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1895
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1896
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1897
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1898
    "Modified: 10.2.1996 / 12:47:28 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1899
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1900
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1901
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1902
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1903
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1904
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  1905
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1906
    self
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1907
        basicFileOutDefinitionOn:aStream 
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1908
        withNameSpace:forceNameSpace 
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1909
        withPackage:true
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1910
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1911
!
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1912
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1913
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1914
    "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
  1915
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1916
    |s owner ns nsName fullName superName cls topOwner
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1917
     syntaxHilighting|
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1918
4629
0442afdeac29 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1919
    UserPreferences isNil ifTrue:[
0442afdeac29 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1920
        syntaxHilighting := false
0442afdeac29 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1921
    ] ifFalse:[
0442afdeac29 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1922
        syntaxHilighting := UserPreferences current syntaxColoring.
0442afdeac29 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4606
diff changeset
  1923
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1924
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  1925
    owner := self owningClass.
2038
7c0943b1ab81 care for full class names in changeLog
Claus Gittinger <cg@exept.de>
parents: 2036
diff changeset
  1926
1932
4d4c4563486b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
  1927
    owner isNil ifTrue:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1928
        ns := self nameSpace.
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1929
    ] ifFalse:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1930
        ns := self topOwningClass nameSpace
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1931
    ].
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1932
    fullName := FileOutNameSpaceQuerySignal query == true.
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1933
        
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  1934
    (showPackage and:[owner isNil]) ifTrue:[
5340
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
  1935
        aStream nextPutAll:'"{ Package: '''.
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
  1936
        aStream nextPutAll:self package asString.
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
  1937
        aStream nextPutAll:''' }"'; cr; cr.
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
  1938
    ].
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
  1939
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1940
    ((owner isNil and:[fullName not])
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  1941
    or:[owner notNil and:[forceNameSpace and:[fullName not]]]) ifTrue:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1942
        (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1943
            nsName := ns name.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1944
            (nsName includes:$:) ifTrue:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1945
                nsName := '''' , nsName , ''''
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1946
            ].
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  1947
"/            aStream nextPutLine:'"{ NameSpace: ' , nsName , ' }"'; cr.
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1948
            aStream nextPutAll:'"{ NameSpace: '.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1949
            syntaxHilighting ifTrue:[aStream bold].
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1950
            aStream nextPutAll:nsName.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1951
            syntaxHilighting ifTrue:[aStream normal].
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1952
            aStream nextPutAll:' }"'; cr; cr.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1953
        ]
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  1954
    ].
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  1955
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
  1956
    "take care of nil-superclass"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1957
    superclass isNil ifTrue:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1958
        s := 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1959
    ] ifFalse:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1960
        fullName ifTrue:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  1961
            superclass == owner ifTrue:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  1962
                s := superclass nameWithoutNameSpacePrefix
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  1963
            ] ifFalse:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  1964
                s := superclass name
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  1965
            ]
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1966
        ] ifFalse:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1967
            (ns == superclass nameSpace 
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1968
            and:[superclass owningClass isNil]) ifTrue:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  1969
                "/ superclass is in the same namespace;
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  1970
                "/ still prepend namespace prefix, to avoid
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  1971
                "/ confusing stc, which needs that information ...
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1972
                s := superclass nameWithoutPrefix
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1973
            ] ifFalse:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1974
                "/ a very special (rare) situation:
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1975
                "/ my superclass resides in another nameSpace,
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1976
                "/ but there is something else named like this
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1977
                "/ to be found in my nameSpace (or a private class)
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1978
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1979
                superName := superclass nameWithoutNameSpacePrefix asSymbol.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1980
                cls := self privateClassesAt:superName.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1981
                cls isNil ifTrue:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1982
                    (topOwner := self topOwningClass) isNil ifTrue:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1983
                        ns := self nameSpace.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1984
                        ns notNil ifTrue:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1985
                            cls := ns privateClassesAt:superName
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1986
                        ] ifFalse:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1987
                            "/ self error:'unexpected nil namespace'
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1988
                        ]
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1989
                    ] ifFalse:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1990
                        cls := topOwner nameSpace at:superName.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1991
                    ]
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1992
                ].
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1993
                (cls notNil and:[cls ~~ superclass]) ifTrue:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1994
                    s := superclass nameSpace name , '::' , superName
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1995
                ] ifFalse:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1996
                    "/ no class with that name found in my namespace ...
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1997
                    "/ if the superclass resides in Smalltalk,
4041
b39d4ccd98d4 oops - last change did generate wrong definition.
Claus Gittinger <cg@exept.de>
parents: 4038
diff changeset
  1998
                    "/ suppress prefix; otherwise, use full prefix.
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  1999
                    (superclass nameSpace notNil 
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2000
                    and:[superclass nameSpace ~~ Smalltalk]) ifTrue:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2001
                        (owner notNil 
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2002
                        and:[owner nameSpace == superclass owningClass nameSpace])
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2003
                        ifTrue:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2004
                            s := superclass nameWithoutNameSpacePrefix
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2005
                        ] ifFalse:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2006
                            s := superclass name
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2007
                        ]
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2008
                    ] ifFalse:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2009
                        s := superName
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2010
                    ]
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2011
                ]
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2012
            ]
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2013
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2014
    ].
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  2015
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  2016
    syntaxHilighting ifTrue:[aStream bold].
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  2017
    aStream nextPutAll:s.   "/ superclass
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  2018
    syntaxHilighting ifTrue:[aStream normal].
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2019
    aStream space.
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2020
    self basicFileOutInstvarTypeKeywordOn:aStream.
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2021
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  2022
    (fullName and:[owner isNil]) ifTrue:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2023
        aStream nextPutAll:'#'''.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2024
        syntaxHilighting ifTrue:[aStream bold].
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2025
        aStream nextPutAll:(self name).
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2026
        syntaxHilighting ifTrue:[aStream normal].
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2027
        aStream nextPutAll:''''.
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2028
    ] ifFalse:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2029
        aStream nextPut:$#.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2030
        syntaxHilighting ifTrue:[aStream bold].
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2031
        aStream nextPutAll:(self nameWithoutPrefix).
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2032
        syntaxHilighting ifTrue:[aStream normal].
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2033
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2034
345
claus
parents: 333
diff changeset
  2035
    aStream crtab. 
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2036
    aStream nextPutAll:'instanceVariableNames:'''.
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  2037
    syntaxHilighting ifTrue:[aStream bold].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2038
    self printInstVarNamesOn:aStream indent:16.
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  2039
    syntaxHilighting ifTrue:[aStream normal].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2040
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2041
345
claus
parents: 333
diff changeset
  2042
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2043
    aStream nextPutAll:'classVariableNames:'''.
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  2044
    syntaxHilighting ifTrue:[aStream bold].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2045
    self printClassVarNamesOn:aStream indent:16.
2843
ccf00b7b1c8f preparations for syntaxhilighting
Claus Gittinger <cg@exept.de>
parents: 2835
diff changeset
  2046
    syntaxHilighting ifTrue:[aStream normal].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2047
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2048
345
claus
parents: 333
diff changeset
  2049
    aStream crtab.
738
576a41a6ab28 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  2050
    aStream nextPutAll:'poolDictionaries:'''''.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2051
345
claus
parents: 333
diff changeset
  2052
    aStream crtab.
1741
0d16c862d652 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1739
diff changeset
  2053
    owner isNil ifTrue:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2054
        "/ a public class
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2055
        aStream nextPutAll:'category:'.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2056
        category isNil ifTrue:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2057
            s := ''''''
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2058
        ] ifFalse:[
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2059
            s := category asString storeString
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2060
        ].
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2061
        aStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2062
    ] ifFalse:[
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2063
        "/ a private class
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2064
        aStream nextPutAll:'privateIn:'.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2065
        syntaxHilighting ifTrue:[aStream bold].
5849
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
  2066
        fullName ifTrue:[
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
  2067
            s := owner name.
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
  2068
        ] ifFalse:[
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
  2069
            s := owner nameWithoutNameSpacePrefix.
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
  2070
        ].
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
  2071
"/        s := owner nameWithoutNameSpacePrefix.
4038
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2072
        aStream nextPutAll:s.
bbf575d41f34 oops - care for the case, where the superclasses namespace
tm
parents: 4022
diff changeset
  2073
        syntaxHilighting ifTrue:[aStream normal].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2074
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2075
    aStream cr
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2076
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2077
    "Created: / 4.1.1997 / 20:38:16 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2078
    "Modified: / 8.8.1997 / 10:59:50 / cg"
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2079
    "Modified: / 18.3.1999 / 18:15:46 / stefan"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2080
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2081
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2082
basicFileOutInstvarTypeKeywordOn:aStream
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2083
    "a helper for fileOutDefinition"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2084
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2085
    |isVar s|
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2086
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2087
    superclass isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2088
        isVar := self isVariable
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2089
    ] ifFalse:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2090
        "I cant remember what this is for ?"
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2091
        isVar := (self isVariable and:[superclass isVariable not])
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2092
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2093
3920
0c1b9b2fa23b added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents: 3788
diff changeset
  2094
    aStream nextPutAll:(self firstDefinitionSelectorPart).
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2095
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2096
    "Created: 11.10.1996 / 18:57:29 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2097
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2098
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2099
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2100
    "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
  2101
     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
  2102
     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
  2103
     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
  2104
     case of errors (for example: disk full). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2105
     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
  2106
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2107
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2108
    |baseName dirName nm fileName|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2109
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2110
    baseName := (Smalltalk fileNameForClass:self name).
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2111
    nm := baseName asFilename withSuffix:'st'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2112
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2113
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2114
     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
  2115
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2116
    Project notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2117
        dirName := Project currentProjectDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2118
    ] ifFalse:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2119
        dirName := Filename currentDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2120
    ].
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2121
    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
  2122
    fileName makeLegalFilename.
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2123
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2124
    self fileOutAs:fileName name.
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2125
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2126
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2127
"/     add a change record; that way, administration is much easier,
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2128
"/     since we can see in that changeBrowser, which changes have 
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2129
"/     already found their way into a sourceFile and which must be
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2130
"/     applied again
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2131
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2132
"/    self addChangeRecordForClassFileOut:self
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2133
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2134
    "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
  2135
    "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
  2136
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2137
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2138
fileOutAllDefinitionsOn:aStream
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2139
    "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
  2140
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2141
    self fileOutDefinitionOn:aStream.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2142
    aStream nextPutChunkSeparator. 
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2143
    aStream cr; cr.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2144
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2145
    "/
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2146
    "/ optional classInstanceVariables
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2147
    "/
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2148
    self class instanceVariableString isBlank ifFalse:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2149
        self fileOutClassInstVarDefinitionOn:aStream.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2150
        aStream nextPutChunkSeparator. 
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2151
        aStream cr; cr
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2152
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2153
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2154
    "/ 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
  2155
    "/ to avoid confusing stc 
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2156
    "/ (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
  2157
    "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2158
    FileOutNameSpaceQuerySignal answer:true do:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2159
        self privateClassesSorted do:[:aClass |
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2160
            aClass fileOutAllDefinitionsOn:aStream
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2161
        ]
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2162
    ].
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2163
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2164
    "Created: 15.10.1996 / 11:15:19 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2165
    "Modified: 22.3.1997 / 16:11:56 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2166
!
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
fileOutAllMethodsOn:aStream
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2169
    self fileOutAllMethodsOn:aStream methodFilter:nil
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2170
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2171
    "Created: 15.10.1996 / 11:13:00 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2172
    "Modified: 22.3.1997 / 16:12:17 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2173
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2174
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2175
fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2176
    |collectionOfCategories|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2177
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2178
    collectionOfCategories := self class categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2179
    collectionOfCategories notNil ifTrue:[
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2180
        collectionOfCategories do:[:aCategory |
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2181
            self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2182
            aStream cr
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2183
        ]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2184
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2185
    collectionOfCategories := self categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2186
    collectionOfCategories notNil ifTrue:[
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2187
        collectionOfCategories do:[:aCategory |
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2188
            self fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2189
            aStream cr
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2190
        ]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2191
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2192
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2193
    self privateClassesSorted do:[:aClass |
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2194
        aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2195
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2196
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2197
    "Created: 15.10.1996 / 11:13:00 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2198
    "Modified: 22.3.1997 / 16:12:17 / cg"
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
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2201
fileOutAs:fileNameString
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2202
    "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
  2203
     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
  2204
     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
  2205
     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
  2206
     case of errors (for example: disk full). 
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2207
     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
  2208
     sourceFile may not be rewritten."
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2209
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2210
    |aStream fileName newFileName savFilename needRename
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2211
     mySourceFileName sameFile s mySourceFileID anySourceRef|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2212
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2213
    self isLoaded ifFalse:[
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2214
        ^ FileOutErrorSignal 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2215
            raiseRequestWith:self
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2216
                 errorString:'will not fileOut unloaded classes'
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2217
    ].
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2218
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2219
    fileName := fileNameString asFilename.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2220
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2221
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2222
     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
  2223
     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
  2224
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2225
    "
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2226
    (fileName exists) ifTrue:[
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2227
        sameFile := false.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2228
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2229
        "/ check carefully - maybe, my source does not really come from that
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2230
        "/ file (i.e. all of my methods have their source as string)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2231
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2232
        anySourceRef := false.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2233
        self methodDictionary do:[:m|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2234
            m sourcePosition notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2235
                anySourceRef := true
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2236
            ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2237
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2238
        self class methodDictionary do:[:m|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2239
            m sourcePosition notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2240
                anySourceRef := true
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2241
            ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2242
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2243
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2244
        anySourceRef ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2245
            s := self sourceStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2246
            s notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2247
                mySourceFileID := s pathName asFilename info id.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2248
                sameFile := (fileName info id) == mySourceFileID.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2249
                s close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2250
            ] ifFalse:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2251
                classFilename notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2252
                    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2253
                     check for overwriting my current source file
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2254
                     this is not allowed, since it would clobber my methods source
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2255
                     file ... you have to save it to some other place.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2256
                     This happens if you ask for a fileOut into the source-directory
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2257
                     (from which my methods get their source)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2258
                    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2259
                    mySourceFileName := Smalltalk getSourceFileName:classFilename. 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2260
                    sameFile := (fileNameString = mySourceFileName).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2261
                    sameFile ifFalse:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2262
                        mySourceFileName notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2263
                            sameFile := (fileName info id) == (mySourceFileName asFilename info id)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2264
                        ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2265
                    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2266
                ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2267
            ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2268
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2269
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2270
        sameFile ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2271
            ^ FileOutErrorSignal 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2272
                raiseRequestWith:fileNameString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2273
                errorString:('may not overwrite sourcefile:', fileNameString)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2274
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2275
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2276
        savFilename := Filename newTemporary.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2277
        fileName copyTo:savFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2278
        newFileName := fileName withSuffix:'new'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2279
        needRename := true
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2280
    ] ifFalse:[
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2281
        "/ another possible trap: if my sourceFileName is
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2282
        "/ the same as the written one AND the new files directory
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2283
        "/ is along the sourcePath, we also need a temporary file
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2284
        "/ first, to avoid accessing the newly written file.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2285
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2286
        anySourceRef := false.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2287
        self methodDictionary do:[:m|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2288
            |mSrc|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2289
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2290
            (mSrc := m sourceFilename) notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2291
                mSrc asFilename baseName = fileName baseName ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2292
                    anySourceRef := true
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2293
                ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2294
            ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2295
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2296
        self class methodDictionary do:[:m|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2297
            |mSrc|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2298
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2299
            (mSrc := m sourceFilename) notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2300
                mSrc asFilename baseName = fileName baseName ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2301
                    anySourceRef := true
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2302
                ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2303
            ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2304
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2305
        anySourceRef ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2306
            newFileName := fileName withSuffix:'new'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2307
            needRename := true
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2308
        ] ifFalse:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2309
            newFileName := fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2310
            needRename := false
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2311
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2312
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2313
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2314
    aStream := newFileName writeStream.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2315
    aStream isNil ifTrue:[
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2316
        savFilename notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2317
            savFilename delete
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2318
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2319
        ^ FileOutErrorSignal 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2320
                raiseRequestWith:newFileName
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2321
                errorString:('cannot create file:', newFileName name)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2322
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2323
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2324
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2325
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2326
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2327
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2328
     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
  2329
     we have to do a copy ...
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
    needRename ifTrue:[
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2332
        newFileName copyTo:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2333
        newFileName delete
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2334
    ].
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2335
    savFilename notNil ifTrue:[
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2336
        savFilename delete
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2337
    ].
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
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2340
     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
  2341
     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
  2342
     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
  2343
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2344
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2345
    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
  2346
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
  2347
    "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
  2348
    "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
  2349
    "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
  2350
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2351
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2352
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2353
    "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
  2354
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2355
    self
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2356
        fileOutClassInstVarDefinitionOn:aStream 
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2357
        withNameSpace:false
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2358
!
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2359
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2360
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2361
    "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
  2362
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2363
    |anySuperClassInstVar|
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2364
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2365
    self isLoaded ifFalse:[
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2366
        ^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2367
    ].
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2368
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2369
    withNameSpace ifTrue:[
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2370
        self name printOn:aStream.
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2371
    ] ifFalse:[
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2372
        self printClassNameOn:aStream.
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2373
    ].
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2374
    aStream nextPutAll:' class instanceVariableNames:'''.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2375
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2376
    aStream nextPutAll:''''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2377
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2378
    "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
  2379
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2380
    anySuperClassInstVar := false.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2381
    self allSuperclassesDo:[:aSuperClass |
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2382
        aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true].
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2383
    ].
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2384
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2385
    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
  2386
    anySuperClassInstVar ifFalse:[
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2387
        aStream  
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2388
            nextPutLine:'No other class instance variables are inherited by this class.'.
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2389
    ] ifTrue:[
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2390
        aStream  
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2391
            nextPutLine:'The following class instance variables are inherited by this class:'.
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2392
        aStream cr.
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2393
        self allSuperclassesDo:[:aSuperClass |
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2394
            aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2395
            aStream nextPutLine:(aSuperClass class instanceVariableString).
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2396
        ].
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2397
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2398
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2399
    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
  2400
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2401
    "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
  2402
    "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
  2403
    "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
  2404
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2405
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2406
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2407
    "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
  2408
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2409
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2410
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2411
    self printClassNameOn:aStream.
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2412
    aStream nextPutAll:' comment:'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2413
    (comment := self comment) isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2414
        s := ''''''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2415
    ] ifFalse:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2416
        s := comment storeString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2417
    ].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2418
    aStream nextPutAllAsChunk:s.
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  2419
    aStream nextPutChunkSeparator.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2420
    aStream cr
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2421
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2422
    "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
  2423
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2424
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2425
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2426
    "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
  2427
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2428
    ^ 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
  2429
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2430
    "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
  2431
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2432
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2433
fileOutIn:aDirectoryName
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2434
    "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
  2435
     directory aDirectoryName (ignoring any directory setting in
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2436
     the current project). 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2437
     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
  2438
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2439
    |aStream fileName|
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
    fileName := (Smalltalk fileNameForClass:self name), '.st'.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2442
    aStream := (aDirectoryName asFilename construct:fileName) writeStream.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2443
    aStream isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2444
        ^ FileOutErrorSignal 
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2445
                raiseRequestWith:fileName
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2446
                errorString:('cannot create file:', fileName)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2447
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2448
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2449
    aStream close
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2450
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2451
    "
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2452
        self fileOutIn:'/tmp'
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2453
        self fileOutIn:'/tmp' asFilename
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2454
    "
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2455
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2456
    "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
  2457
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2458
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2459
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2460
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2461
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2462
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2463
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2464
    "Created: 15.11.1995 / 12:53:32 / cg"
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2465
    "Modified: 3.1.1997 / 17:50:28 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2466
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2467
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2468
fileOutOn:aStream withTimeStamp:stampIt
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2469
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2470
     If stampIt is true, a timeStamp comment is prepended."
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2471
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2472
    self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2473
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2474
    "Modified: / 13.3.1998 / 12:23:02 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2475
!
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2476
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2477
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2478
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2479
     If stampIt is true, a timeStamp comment is prepended.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2480
     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
  2481
     append a corresponding doIt expression for initialization."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2482
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2483
    self 
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2484
        fileOutOn:aStream 
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2485
        withTimeStamp:stampIt 
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2486
        withInitialize:initIt 
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2487
        withDefinition:true
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2488
        methodFilter:nil
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2489
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2490
    "Created: / 15.11.1995 / 12:53:06 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2491
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2492
    "Modified: / 13.3.1998 / 12:23:59 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2493
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2494
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2495
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
  2496
    "file out my definition and all methods onto aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2497
     If stampIt is true, a timeStamp comment is prepended.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2498
     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
  2499
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2500
     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
  2501
     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
  2502
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2503
    |collectionOfCategories copyrightMethod copyrightText comment versionMethod skippedMethods
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2504
     meta|
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2505
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2506
    self isLoaded ifFalse:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2507
        ^ FileOutErrorSignal 
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2508
            raiseRequestWith:self
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2509
                 errorString:'will not fileOut unloaded classes'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2510
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2511
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2512
    meta := self class.
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2513
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2514
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2515
     if there is a copyright method, add a copyright comment
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2516
     at the beginning, taking the string from the copyright method.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2517
     We cannot do this unconditionally - that would lead to my copyrights
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2518
     being put on your code ;-).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2519
     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
  2520
     copyright string at the beginning be preserved .... even if the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2521
     code was edited in the browser and filedOut.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2522
    "
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2523
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2524
        "
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2525
         get the copyright methods source,
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2526
         and insert at beginning.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2527
        "
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2528
        copyrightText := copyrightMethod source.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2529
        copyrightText isNil ifTrue:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2530
            "
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2531
             no source available - trigger an error
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2532
            "
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2533
            FileOutErrorSignal
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2534
                raiseRequestWith:'no source for class ' , self name , ' available. Cannot fileOut'.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2535
            ^ self
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2536
        ].
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2537
        "
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2538
         strip off the selector-line
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2539
        "
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2540
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2541
        copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2542
"/        copyrightText do:[:line | aStream nextPutAll:line. aStream cr.].
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2543
        copyrightText := copyrightText asString.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2544
        aStream nextPutAllAsChunk:copyrightText.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2545
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2546
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2547
    stampIt ifTrue:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2548
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2549
        "/ first, a timestamp
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2550
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2551
        aStream nextPutAll:(Smalltalk timeStamp).
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2552
        aStream nextPutChunkSeparator. 
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2553
        aStream cr; cr.
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
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2556
    withDefinition ifTrue:[
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2557
        "/
5731
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  2558
        "/ then the definition(s)
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2559
        "/
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2560
        self fileOutAllDefinitionsOn:aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2561
        "/
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2562
        "/ a comment - if any
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2563
        "/
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2564
        (comment := self comment) notNil ifTrue:[
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2565
            self fileOutCommentOn:aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2566
            aStream cr.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2567
        ].
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2568
        "/
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2569
        "/ primitive definitions - if any
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2570
        "/
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2571
        self fileOutPrimitiveSpecsOn:aStream.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2572
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2573
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2574
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2575
    "/ 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
  2576
    "/ 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
  2577
    "/         avoid sourcePosition-shifts when checked out later.
1930
6a8b95d5f108 fileOutDefinition - suppress nameSpace in definition message;
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
  2578
    "/         (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
  2579
    "/
989
b8bf7496110c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 988
diff changeset
  2580
    collectionOfCategories := meta categories asSortedCollection.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2581
    collectionOfCategories notNil ifTrue:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2582
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2583
        "/ documentation first (if any), but not the version method
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2584
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2585
        (collectionOfCategories includes:'documentation') ifTrue:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2586
            versionMethod := meta compiledMethodAt:#version.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2587
            versionMethod notNil ifTrue:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2588
                skippedMethods := Array with:versionMethod
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2589
            ].
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2590
            meta fileOutCategory:'documentation' except:skippedMethods only:nil methodFilter:methodFilter on:aStream.
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2591
            aStream cr.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2592
        ].
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2593
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2594
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2595
        "/ initialization next (if any)
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2596
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2597
        (collectionOfCategories includes:'initialization') ifTrue:[
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2598
            meta fileOutCategory:'initialization' methodFilter:methodFilter on:aStream.
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2599
            aStream cr.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2600
        ].
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2601
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2602
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2603
        "/ instance creation next (if any)
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2604
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2605
        (collectionOfCategories includes:'instance creation') ifTrue:[
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2606
            meta fileOutCategory:'instance creation' methodFilter:methodFilter on:aStream.
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2607
            aStream cr.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2608
        ].
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2609
        collectionOfCategories do:[:aCategory |
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2610
            ((aCategory ~= 'documentation')
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2611
            and:[(aCategory ~= 'initialization')
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2612
            and:[aCategory ~= 'instance creation']]) ifTrue:[
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2613
                meta fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2614
                aStream cr
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2615
            ]
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2616
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2617
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2618
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2619
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2620
    "/ methods from all categories in myself
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2621
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2622
    collectionOfCategories := self categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2623
    collectionOfCategories notNil ifTrue:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2624
        collectionOfCategories do:[:aCategory |
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2625
            self fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2626
            aStream cr
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2627
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2628
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2629
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2630
    "/
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2631
    "/ any private classes' methods
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2632
    "/
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  2633
    self privateClassesSorted do:[:aClass |
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2634
        aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter
1743
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2635
    ].
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2636
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2637
18eed89fe918 fileout any private classes with it
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  2638
    "/
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2639
    "/ finally, the previously skipped version method
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2640
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2641
    versionMethod notNil ifTrue:[
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2642
        meta fileOutCategory:'documentation' except:nil only:skippedMethods methodFilter:methodFilter on:aStream.
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2643
    ].
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2644
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2645
    initIt ifTrue:[
4288
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2646
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2647
        "/ optionally an initialize message
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2648
        "/
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2649
        (meta implements:#initialize) ifTrue:[
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2650
            self printClassNameOn:aStream. aStream nextPutAll:' initialize'.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2651
            aStream nextPutChunkSeparator.
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2652
            aStream cr
51f416d3f15b care to prepend the nameSpace in filedOut classDefinitions;
Claus Gittinger <cg@exept.de>
parents: 4116
diff changeset
  2653
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2654
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2655
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2656
    "Created: / 15.11.1995 / 12:53:06 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2657
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2658
    "Modified: / 13.3.1998 / 12:23:59 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2659
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2660
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2661
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2662
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2663
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2664
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2665
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2666
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2667
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2668
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2669
    (s := self primitiveDefinitionsString) notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2670
        aStream nextPutChunkSeparator.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2671
        self printClassNameOn:aStream.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2672
        aStream nextPutAll:' primitiveDefinitions';
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2673
                nextPutChunkSeparator;
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2674
                cr.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2675
        aStream nextPutAll:s.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2676
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2677
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2678
    (s := self primitiveVariablesString) notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2679
        aStream nextPutChunkSeparator.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2680
        self printClassNameOn:aStream.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2681
        aStream nextPutAll:' primitiveVariables';
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2682
                nextPutChunkSeparator;
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2683
                cr.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2684
        aStream nextPutAll:s.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2685
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2686
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2687
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2688
    "Modified: 8.1.1997 / 17:45:40 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2689
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2690
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2691
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2692
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2693
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2694
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2695
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2696
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2697
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2698
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2699
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2700
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2701
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2702
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2703
    (s := self primitiveFunctionsString) notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2704
        aStream nextPutChunkSeparator.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2705
        self printClassNameOn:aStream.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2706
        aStream nextPutAll:' primitiveFunctions';
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2707
                nextPutChunkSeparator;
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2708
                cr.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2709
        aStream nextPutAll:s.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2710
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2711
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2712
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2713
    "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
  2714
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2715
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2716
!Class methodsFor:'fileOut-binary'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2717
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2718
binaryFileOut
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2719
    "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
  2720
     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
  2721
     The methods source is saved by reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2722
     to the classes sourceFile if there is any.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2723
     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
  2724
     browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2725
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2726
    self binaryFileOutWithSourceMode:#reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2727
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2728
    "Modified: 5.1.1997 / 15:40:05 / cg"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2729
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2730
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2731
binaryFileOutOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2732
    "append a binary representation of myself to aStream"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2733
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2734
    self binaryFileOutOn:aStream sourceMode:#reference 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2735
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2736
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2737
binaryFileOutOn:aStream sourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2738
    "append a binary representation of myself to aStream in
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2739
     a portable binary format. 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2740
     The argument controls how sources are to be saved:
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2741
        #keep - include the source
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2742
        #reference - include a reference to the sourceFile
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  2743
        #discard - dont save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2744
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2745
     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
  2746
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2747
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2748
    |bos|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2749
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2750
    bos := BinaryObjectStorage onNew:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2751
    bos sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2752
    bos nextPutClasses:(Array with:self).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2753
    bos close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2754
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2755
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2756
binaryFileOutWithSourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2757
    "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
  2758
     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
  2759
     The argument controls how sources are to be saved:
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2760
        #keep - include the source
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2761
        #reference - include a reference to the sourceFile
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2762
        #discard - dont save sources.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2763
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2764
     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
  2765
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2766
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2767
    |baseName fileName dirName|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2768
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2769
    baseName := (Smalltalk fileNameForClass:self name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2770
    fileName := baseName , '.cls'.
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
    Project notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2773
        dirName := Project currentProjectDirectory
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2774
    ] ifFalse:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2775
        dirName := '.'
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2776
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2777
    fileName := dirName asFilename construct:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2778
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2779
    fileName := fileName name.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2780
    self binaryFileOutWithSourceMode:sourceMode as:fileName.
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
!
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
binaryFileOutWithSourceMode:sourceMode as:fileNameString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2785
    "create a file fileNameString,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2786
     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
  2787
     The argument controls how sources are to be saved:
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2788
        #keep - include the source
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2789
        #reference - include a reference to the sourceFile
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2790
        #discard - dont save sources.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2791
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2792
     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
  2793
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2794
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2795
    |fileName aStream|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2796
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2797
    fileName := fileNameString asFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2798
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2799
    fileName := fileName name.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2800
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2801
    aStream := FileStream newFileNamed:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2802
    aStream isNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2803
        ^ FileOutErrorSignal 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2804
                raiseRequestWith:fileName
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2805
                errorString:('cannot create file:', fileName)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2806
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2807
        
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2808
    aStream binary.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2809
    self binaryFileOutOn:aStream sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2810
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2811
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2812
    "Created: / 29.12.1998 / 21:38:38 / cg"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2813
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2814
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2815
!Class methodsFor:'fileOut-xml'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2816
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2817
fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2818
    "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
  2819
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2820
     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
  2821
     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
  2822
     case of errors (for example: disk full)"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2823
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2824
    |baseName dirName nm fileName|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2825
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2826
    baseName := (Smalltalk fileNameForClass:self name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2827
    nm := baseName asFilename withSuffix:'xml'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2828
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
     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
  2831
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2832
    Project notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2833
        dirName := Project currentProjectDirectory
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2834
    ] ifFalse:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2835
        dirName := Filename currentDirectory
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2836
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2837
    fileName := (dirName asFilename construct:nm).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2838
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2839
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2840
    self fileOutXMLAs:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2841
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2842
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2843
     Class fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2844
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2845
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
!
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
fileOutXMLAllDefinitionsOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2850
    "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
  2851
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2852
    self fileOutXMLDefinitionOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2853
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2854
    "/ here, the full nameSpace prefixes are output,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2855
    "/ to avoid confusing stc 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2856
    "/ (which otherwise could not find the correct superclass)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2857
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2858
    FileOutNameSpaceQuerySignal answer:true do:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2859
        self privateClassesSorted do:[:aClass |
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2860
            aClass fileOutXMLAllDefinitionsOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2861
        ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2862
    ].
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
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
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2867
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2868
    |collectionOfCategories|
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2869
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2870
    collectionOfCategories := self class categories asSortedCollection.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2871
    collectionOfCategories notNil ifTrue:[
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2872
        collectionOfCategories do:[:aCategory |
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2873
            self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2874
            aStream cr
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2875
        ]
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2876
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2877
    collectionOfCategories := self categories asSortedCollection.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2878
    collectionOfCategories notNil ifTrue:[
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2879
        collectionOfCategories do:[:aCategory |
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2880
            self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2881
            aStream cr
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2882
        ]
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2883
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2884
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2885
    self privateClassesSorted do:[:aClass |
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2886
        aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2887
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2888
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2889
!
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2890
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2891
fileOutXMLAs:fileNameOrString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2892
    "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
  2893
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2894
     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
  2895
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2896
    |aStream fileName|
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
    self isLoaded ifFalse:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2899
        ^ FileOutErrorSignal 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2900
            raiseRequestWith:self
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2901
                 errorString:'will not fileOut unloaded classes'
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
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2904
    fileName := fileNameOrString asFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2905
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2906
    aStream := fileName writeStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2907
    aStream isNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2908
        ^ FileOutErrorSignal 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2909
                raiseRequestWith:fileName
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2910
                errorString:('cannot create file:', fileName name)
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
    self fileOutXMLOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2913
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2914
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2915
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2916
     Class fileOutXMLAs:'test.xml'
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2917
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2918
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2919
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2920
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2921
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2922
fileOutXMLDefinitionOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2923
    "append an xml expression on aStream, which defines myself."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2924
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2925
    |s owner ns nsName fullName superName cls topOwner varNames|
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2926
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2927
    aStream nextPutLine:'<class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2928
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2929
    aStream nextPutAll:'  <name>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2930
    aStream nextPutAll:(self nameWithoutPrefix).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2931
    aStream nextPutLine:'</name>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2932
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2933
    aStream nextPutAll:'  <environment>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2934
    aStream nextPutAll:(self nameSpace name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2935
    aStream nextPutLine:'</environment>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2936
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2937
    aStream nextPutAll:'  <super>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2938
    aStream nextPutAll:(self theNonMetaclass superclass name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2939
    aStream nextPutLine:'</super>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2940
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2941
    aStream nextPutAll:'  <private>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2942
    aStream nextPutAll:(self isPrivate printString).
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2943
    aStream nextPutLine:'</private>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2944
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2945
    aStream nextPutAll:'  <indexed-type>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2946
    aStream nextPutAll:'none'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2947
    aStream nextPutLine:'</indexed-type>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2948
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2949
    aStream nextPutAll:'  <inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2950
    varNames := self instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2951
    varNames size > 0 ifTrue:[
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2952
        aStream cr.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2953
        varNames do:[:nm |
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2954
            aStream nextPutAll:'    <name>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2955
            aStream nextPutAll:nm.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2956
            aStream nextPutLine:'</name>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2957
        ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2958
        aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2959
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2960
    aStream nextPutLine:'</inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2961
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2962
    aStream nextPutAll:'  <class-inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2963
    varNames := self class instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2964
    varNames size > 0 ifTrue:[
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2965
        aStream cr.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2966
        varNames do:[:nm |
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2967
            aStream nextPutAll:'    <name>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2968
            aStream nextPutAll:nm.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2969
            aStream nextPutLine:'</name>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2970
        ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2971
        aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2972
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2973
    aStream nextPutLine:'</class-inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2974
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2975
    aStream nextPutAll:'  <imports>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2976
    aStream nextPutAll:''.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2977
    aStream nextPutLine:'</imports>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2978
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2979
    aStream nextPutAll:'  <category>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2980
    aStream nextPutAll:self category.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2981
    aStream nextPutLine:'</category>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2982
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2983
    aStream nextPutLine:'</class>'.
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
    varNames := self classVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2986
    varNames size > 0 ifTrue:[
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2987
        varNames do:[:nm |
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2988
            aStream nextPutLine:'<static>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2989
            aStream nextPutAll:' <name>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2990
            aStream nextPutAll:nm.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2991
            aStream nextPutLine:'</name>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2992
            aStream nextPutAll:' <environment>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2993
            aStream nextPutAll:self name.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2994
            aStream nextPutLine:'</environment>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2995
            aStream nextPutLine:'</static>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2996
        ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2997
    ].
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2998
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2999
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3000
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3001
fileOutXMLOn:aStream 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3002
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3003
     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
  3004
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3005
    self
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3006
        fileOutXMLOn:aStream 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3007
        withTimeStamp:true 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3008
        withInitialize:true 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3009
        withDefinition:true 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3010
        methodFilter:nil
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3011
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3012
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3013
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3014
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
  3015
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3016
     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
  3017
     If stampIt is true, a timeStamp comment is prepended.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3018
     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
  3019
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3020
     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
  3021
     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
  3022
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3023
    |collectionOfCategories copyrightMethod copyrightText comment meta|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3024
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3025
    self isLoaded ifFalse:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3026
        ^ FileOutErrorSignal 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3027
            raiseRequestWith:self
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3028
                 errorString:'will not fileOut unloaded classes'
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3029
    ].
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
    meta := self class.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3032
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3033
    aStream nextPutLine:'<?xml version="1.0"?>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3034
    aStream nextPutLine:'<st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3035
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3036
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3037
     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
  3038
     taking the string from the copyright method.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3039
     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
  3040
     being put on your code ;-).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3041
     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
  3042
     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
  3043
     code was edited in the browser and filedOut.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3044
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3045
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
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
         get the copyright methods source,
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3048
         and insert at beginning.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3049
        "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3050
        copyrightText := copyrightMethod source.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3051
        copyrightText isNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3052
            "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3053
             no source available - trigger an error
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3054
            "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3055
            FileOutErrorSignal
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3056
                raiseRequestWith:'no source for class ' , self name , ' available. Cannot fileOut'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3057
            ^ self
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
         strip off the selector-line
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3061
        "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3062
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3063
        copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3064
        [copyrightText last isEmpty] whileTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3065
            copyrightText := copyrightText copyWithoutLast:1.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3066
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3067
        (copyrightText first = '"') ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3068
            (copyrightText last = '"') ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3069
                copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3070
            ]
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
        copyrightText := copyrightText asString.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3073
        
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3074
        aStream nextPutAll:'<copyright>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3075
        self fileOutXMLString:copyrightText on:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3076
        aStream nextPutLine:'</copyright>'.
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
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3079
    stampIt ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3080
        "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3081
        "/ first, a timestamp
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
        aStream nextPutAll:'<time-stamp>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3084
        self fileOutXMLString:(Smalltalk timeStampString) on:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3085
        aStream nextPutLine:'</time-stamp>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3086
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3087
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3088
    withDefinition ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3089
        "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3090
        "/ then the definition
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
        self fileOutXMLAllDefinitionsOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3093
        "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3094
        "/ a comment - if any
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3095
        "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3096
        (comment := self comment) notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3097
            aStream nextPutLine:'<comment>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3098
            aStream nextPutAll:'<class-id>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3099
            aStream nextPutAll:(self name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3100
            aStream nextPutLine:'</class-id>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3101
            aStream nextPutLine:'</comment>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3102
        ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3103
        "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3104
        "/ primitive definitions - if any
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3105
        "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3106
"/        self fileOutPrimitiveSpecsOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3107
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3108
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3109
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3110
    "/ 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
  3111
    "/ 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
  3112
    "/         avoid sourcePosition-shifts when checked out later.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3113
    "/         (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
  3114
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3115
    collectionOfCategories := meta categories asSortedCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3116
    collectionOfCategories notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3117
        collectionOfCategories do:[:aCategory |
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3118
            meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3119
        ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3120
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3121
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3122
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3123
    "/ methods from all categories in myself
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
    collectionOfCategories := self categories asSortedCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3126
    collectionOfCategories notNil ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3127
        collectionOfCategories do:[:aCategory |
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3128
            self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3129
        ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3130
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3131
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3132
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3133
    "/ any private classes' methods
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
    self privateClassesSorted do:[:aClass |
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3136
        aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3137
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3138
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3139
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3140
    initIt ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3141
        "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3142
        "/ optionally an initialize message
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3143
        "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3144
        (meta implements:#initialize) ifTrue:[
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3145
            aStream nextPutLine:'<initialize>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3146
            aStream nextPutAll:'<class-id>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3147
            aStream nextPutAll:(self name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3148
            aStream nextPutLine:'</class-id>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3149
            aStream nextPutLine:'</initialize>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3150
        ]
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3151
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3152
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3153
    aStream nextPutLine:'</st-source>'.
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
     Class 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3157
        fileOutXMLOn:'test.xml' asFilename writeStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3158
        withTimeStamp:true
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3159
        withInitialize:true 
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3160
        withDefinition:true
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3161
        methodFilter:nil
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3162
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3163
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3164
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3165
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3166
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3167
htmlDocumentation
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3168
    ^ HTMLDocGenerator htmlDocOf:self
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3169
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3170
    "Created: 22.3.1997 / 14:18:23 / cg"
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3171
!
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3172
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3173
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3174
    "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
  3175
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3176
    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
  3177
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3178
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3179
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3180
    "print myself and all subclasses on aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3181
     recursively calls itself to print subclasses. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3182
     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
  3183
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3184
    |nm|
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3185
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3186
    nm := self name.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3187
    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
  3188
    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
  3189
    aStream nextPutLine:')'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3190
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3191
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3192
        aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3193
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3194
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3195
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3196
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3197
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3198
     printStream close"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3199
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3200
    "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
  3201
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3202
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3203
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3204
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3205
333
claus
parents: 328
diff changeset
  3206
    |comment s|
claus
parents: 328
diff changeset
  3207
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3208
    aPrintStream nextPutAll:'class                '; bold; nextPutLine:self name; normal. 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3209
    aPrintStream nextPutAll:'superclass           '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3210
    superclass isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3211
        s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3212
    ] ifFalse:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3213
        s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3214
    ].
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3215
    aPrintStream nextPutLine:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3216
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3217
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3218
    self printInstVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3219
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3220
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3221
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3222
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3223
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3224
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3225
    category notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3226
        aPrintStream nextPutAll:'category             '; 
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3227
                     nextPutLine:(category printString).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3228
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3229
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  3230
    (comment := self comment) notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3231
        aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3232
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3233
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3234
    "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
  3235
    "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
  3236
    "Modified: 1.4.1997 / 16:01:26 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3237
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3238
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3239
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3240
    "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
  3241
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3242
    |collectionOfCategories|
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
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3245
    aPrintStream cr.
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3246
    collectionOfCategories := self class categories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3247
    collectionOfCategories notNil ifTrue:[
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3248
        aPrintStream nextPutLine:'class protocol'.
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3249
        aPrintStream cr.
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3250
        collectionOfCategories do:[:aCategory |
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3251
            self class printOutCategory:aCategory on:aPrintStream
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3252
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3253
    ].
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3254
    collectionOfCategories := self categories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3255
    collectionOfCategories notNil ifTrue:[
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3256
        aPrintStream nextPutLine:'instance protocol'.
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3257
        aPrintStream cr.
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3258
        collectionOfCategories do:[:aCategory |
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3259
            self printOutCategory:aCategory on:aPrintStream
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3260
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3261
    ]
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3262
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3263
    "Modified: / 25.11.1998 / 12:40:31 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3264
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3265
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3266
!Class methodsFor:'private changes management'!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3267
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3268
addChangeRecordForChangeCategory:category to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3269
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3270
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3271
    "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
  3272
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3273
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3274
    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
  3275
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3276
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3277
    "this test allows a smalltalk without Projects/ChangeSets"
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3278
    Project notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3279
        Project addClassDefinitionChangeFor:self
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3280
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3281
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3282
    "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
  3283
    "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
  3284
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3285
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3286
addChangeRecordForClass:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3287
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3288
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3289
    "append a 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
  3290
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3291
    aClass isLoaded ifTrue:[
5849
4cc89ecfbbda prepend nameSpace to class-owner in changes file.
Claus Gittinger <cg@exept.de>
parents: 5801
diff changeset
  3292
        aClass basicFileOutDefinitionOn:aStream withNameSpace:true.
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3293
        aStream nextPutChunkSeparator.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3294
        Project notNil ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3295
            Project addClassDefinitionChangeFor:aClass 
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3296
        ]
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3297
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3298
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3299
    "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
  3300
    "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
  3301
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3302
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3303
addChangeRecordForClassComment:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3304
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3305
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3306
    "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
  3307
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3308
    aClass fileOutCommentOn:aStream.
5225
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3309
    Project notNil ifTrue:[
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3310
        Project addClassCommentChangeFor:aClass
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3311
    ]
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3312
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3313
    "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
  3314
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3315
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3316
addChangeRecordForClassInstvars:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3317
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3318
5225
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3319
    "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
  3320
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  3321
    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
  3322
    aStream nextPutChunkSeparator.
5225
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3323
    Project notNil ifTrue:[
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3324
        Project addInstVarDefinitionChangeFor:aClass class
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3325
    ]
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3326
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3327
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3328
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3329
addChangeRecordForClassRemove:oldName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3330
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3331
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3332
    "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
  3333
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3334
    aStream nextPutAll:('Smalltalk removeClass:' , oldName).
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3335
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3336
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3337
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3338
addChangeRecordForClassRename:oldName to:newName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3339
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3340
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3341
    "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
  3342
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3343
    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
  3344
    aStream nextPutChunkSeparator.
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3345
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3346
    "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
  3347
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3348
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3349
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3350
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3351
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3352
    "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
  3353
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3354
    aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:'''; 
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3355
            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
  3356
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3357
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3358
    "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
  3359
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3360
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3361
addChangeRecordForPrimitiveFunctions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3362
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3363
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3364
    "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
  3365
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3366
    aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:'''; 
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3367
            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
  3368
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3369
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3370
    "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
  3371
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3372
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3373
addChangeRecordForPrimitiveVariables:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3374
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3375
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3376
    "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
  3377
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3378
    aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:'''; 
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3379
            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
  3380
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3381
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3382
    "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
  3383
! !
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3384
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3385
!Class methodsFor:'private helpers'!
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3386
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3387
getPrimitiveSpecsAt:index
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3388
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3389
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3390
    "return a primitiveSpecification component as string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3391
2172
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  3392
    |owner pos stream string|
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  3393
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  3394
    (owner := self owningClass) notNil ifTrue:[^ owner getPrimitiveSpecsAt:index].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3395
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3396
    primitiveSpec isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3397
    pos := primitiveSpec at:index.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3398
    pos isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3399
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3400
    "the primitiveSpec is either a string, or an integer specifying the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3401
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3402
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3403
    pos isNumber ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3404
        classFilename notNil ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3405
            stream := self sourceStream. 
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3406
            stream notNil ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3407
                stream position:pos+1.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3408
                string := stream nextChunk.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3409
                stream close.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3410
                ^ string
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3411
            ]
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3412
        ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3413
        ^ nil
544
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  3414
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3415
    ^ pos
2172
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  3416
151dc4a34898 Private classes get their primitiveSpecs from their owner.
Stefan Vogel <sv@exept.de>
parents: 2124
diff changeset
  3417
    "Modified: 15.1.1997 / 15:29:30 / stefan"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3418
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3419
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3420
setPrimitiveSpecsAt:index to:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3421
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3422
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3423
    "set a primitiveSpecification component to aString"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3424
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3425
    primitiveSpec isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3426
        primitiveSpec := Array new:3
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3427
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3428
    primitiveSpec at:index put:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3429
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3430
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3431
!Class methodsFor:'protocol printOut'!
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3432
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3433
printOutProtocolOn:aPrintStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3434
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3435
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3436
    |collectionOfCategories|
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3437
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3438
    self printOutDefinitionOn:aPrintStream.
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3439
    aPrintStream cr.
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3440
    collectionOfCategories := self class categories asSortedCollection.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3441
    collectionOfCategories notNil ifTrue:[
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3442
        aPrintStream nextPutLine:'class protocol'.
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3443
        aPrintStream cr.
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3444
        collectionOfCategories do:[:aCategory |
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3445
            self class printOutCategoryProtocol:aCategory on:aPrintStream
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3446
        ]
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3447
    ].
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3448
    collectionOfCategories := self categories asSortedCollection.
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3449
    collectionOfCategories notNil ifTrue:[
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3450
        aPrintStream nextPutLine:'instance protocol'.
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3451
        aPrintStream cr.
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3452
        collectionOfCategories do:[:aCategory |
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3453
            self printOutCategoryProtocol:aCategory on:aPrintStream
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3454
        ]
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3455
    ]
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3456
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3457
    "Modified: / 25.11.1998 / 12:40:38 / cg"
1237
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3458
! !
9a6877a3b2b2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  3459
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3460
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3461
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3462
hasExtensions
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3463
    "return true, if there are methods in the receiver, which belong to
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3464
     a different package (i.e. package of class ~= package of method).
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3465
     Those are class extensions, which must be treated specially when checking classes
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3466
     into the sourceCode repository. (extensions are stored separate)" 
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3467
5738
b48b564600bd fixed hasExtensions query for private classes
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
  3468
    |pkg|
b48b564600bd fixed hasExtensions query for private classes
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
  3469
b48b564600bd fixed hasExtensions query for private classes
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
  3470
    pkg := self package.
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3471
    self allSelectorsAndMethodsDo:[:sel :mthd |
5738
b48b564600bd fixed hasExtensions query for private classes
Claus Gittinger <cg@exept.de>
parents: 5731
diff changeset
  3472
        mthd package ~= pkg ifTrue:[^ true].
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3473
    ].
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3474
    ^ false
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3475
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3476
    "
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3477
     Smalltalk allClasses select:[:each | each hasExtensions] 
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3478
    "
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3479
!
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3480
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3481
hasExtensionsFrom:aPackageID
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3482
    "return true, if there are methods in the receiver, which belong to
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3483
     the package with aPackageID (i.e. package of class ~= package of method).
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3484
     Those are class extensions, which must be treated specially when checking classes
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3485
     into the sourceCode repository. (extensions are stored separate)" 
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3486
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3487
    self allSelectorsAndMethodsDo:[:sel :mthd |
5660
c7cb5040a2f0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  3488
        mthd package = aPackageID ifTrue:[^ true].
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3489
    ].
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3490
    ^ false
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3491
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3492
    "
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3493
     Smalltalk allClasses select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser'] 
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3494
    "
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3495
!
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3496
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3497
isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3498
    "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
  3499
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3500
     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
  3501
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3502
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3503
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3504
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3505
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3506
     Point isClass  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3507
     1 isClass      
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3508
     Behavior new isBehavior  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3509
     Behavior new isClass       
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3510
     Class new isBehavior    
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3511
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3512
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3513
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3514
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3515
rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3516
    "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
  3517
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3518
    |set|
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3519
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3520
    set := IdentitySet new.
5581
7bef1c75fb06 allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
  3521
    Smalltalk allClassesDo:[:aClass | 
7bef1c75fb06 allBehaviors vs. allClasses
Claus Gittinger <cg@exept.de>
parents: 5562
diff changeset
  3522
        aClass superclass isNil ifTrue:[set add:aClass]
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3523
    ].
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3524
    ^ set asOrderedCollection
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3525
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3526
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3527
     Class rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3528
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3529
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3530
    "Modified: 18.4.1997 / 20:55:34 / cg"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3531
!
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3532
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3533
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3534
    "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
  3535
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3536
     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
  3537
     Autoload. The interface here is for your convenience."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3538
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3539
    ^ 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
  3540
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3541
    "Modified: 21.3.1996 / 16:27:09 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3542
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3543
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3544
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3545
    "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
  3546
     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
  3547
     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
  3548
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3549
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3550
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3551
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3552
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3553
    [cls notNil] whileTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3554
        (cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3555
        cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3556
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3557
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3558
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3559
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3560
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3561
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3562
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3563
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3564
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3565
!Class methodsFor:'renaming'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3566
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3567
makePrivateIn:newOwner
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3568
    "make a private class of newOwner from the receiver;
5612
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3569
     the receiver must be a public class.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3570
     Returns the new private class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3571
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3572
    |sel newClass|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3573
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3574
    self owningClass notNil ifTrue:[
5612
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3575
        ^ self
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3576
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3577
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3578
    sel := self definitionSelectorPrivate.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3579
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3580
    newClass := self superclass
5612
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3581
        perform:sel
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3582
        withArguments:(Array 
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3583
                        with:(self nameWithoutPrefix asSymbol)
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3584
                        with:(self instanceVariableString)
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3585
                        with:(self classVariableString)
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3586
                        with:''
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3587
                        with:newOwner).
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3588
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3589
    "/ copy over methods ...
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3590
    self class copyInvalidatedMethodsFrom:self class for:newClass class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3591
    self class copyInvalidatedMethodsFrom:self for:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3592
    newClass class recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3593
    newClass recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3594
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3595
    newOwner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3596
    Smalltalk changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3597
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3598
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3599
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3600
3494
23a6cf28b3a6 fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents: 3407
diff changeset
  3601
    "Modified: / 29.5.1998 / 19:03:49 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3602
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3603
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3604
makePublic
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3605
    "make a public class from the receiver.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3606
     The receiver must be a private class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3607
     Returns the new public class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3608
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3609
    ^ self makePublicIn:Smalltalk
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3610
!
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3611
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3612
makePublicIn:aNameSpace
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3613
    "make a public class from the receiver.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3614
     The receiver must be a private class.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3615
     Returns the new public class."
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3616
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3617
    |sel owner newName newClass|
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3618
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3619
    owner := self topOwningClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3620
    owner isNil ifTrue:[^ self].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3621
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3622
    "/ first, create the public class ...
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3623
    sel := self definitionSelector.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3624
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3625
    Class nameSpaceQuerySignal answer:aNameSpace
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3626
    do:[
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3627
        (aNameSpace isNil or:[aNameSpace == Smalltalk]) ifTrue:[
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3628
            newName := self nameWithoutPrefix
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3629
        ] ifFalse:[
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3630
            newName := aNameSpace name , '::' , self nameWithoutPrefix
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3631
        ].
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3632
        newClass := self superclass
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3633
            perform:sel
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3634
            withArguments:(Array 
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3635
                            with:(newName asSymbol)
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3636
                            with:(self instanceVariableString)
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3637
                            with:(self classVariableString)
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3638
                            with:''
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3639
                            with:(owner category)).
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3640
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3641
        "/ copy over methods ...
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3642
        self class copyInvalidatedMethodsFrom:self class for:newClass class.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3643
        self class copyInvalidatedMethodsFrom:self for:newClass.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3644
        newClass class recompileInvalidatedMethods.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3645
        newClass recompileInvalidatedMethods.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3646
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3647
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3648
    owner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3649
    Smalltalk changed:#newClass with:newClass.
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3650
    (aNameSpace notNil and:[aNameSpace ~~ Smalltalk]) ifTrue:[
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3651
        aNameSpace changed:#newClass with:newClass.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3652
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3653
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3654
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3655
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3656
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3657
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3658
    "Created: 23.6.1997 / 13:28:52 / cg"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3659
    "Modified: 20.10.1997 / 21:43:38 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3660
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3661
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3662
renameTo:newName
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3663
    "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
  3664
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3665
    <resource:#obsolete>
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3666
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3667
    |oldSym newSym|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3668
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3669
    "/ the code below is obsolete - it does not deal with
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3670
    "/ classVariables, private classes and does not
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3671
    "/ recompile other classes in order to care for namespace
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3672
    "/ changes.
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3673
    "/ Please use Smalltalk>>renameClass:to:,
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3674
    "/ which deals with all of that.
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3675
    self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'.
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3676
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3677
    oldSym := name asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3678
    newSym := newName asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3679
    self setName:newSym.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3680
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3681
    Smalltalk at:oldSym put:nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3682
    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
  3683
    Smalltalk at:newSym put:self.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3684
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3685
    "Created: / 1.4.1997 / 15:27:53 / stefan"
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3686
    "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
  3687
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3688
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3689
!Class methodsFor:'signature checking'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3690
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3691
classinstSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3692
    "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
  3693
     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
  3694
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3695
    ^ (aSignature bitShift:-7) bitAnd:7
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3696
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3697
    "Created: 1.4.1997 / 15:23:01 / stefan"
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3698
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3699
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3700
instNameKeyFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3701
    "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
  3702
     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
  3703
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3704
    ^ (aSignature bitShift:-14) bitAnd:16rFFFF
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3705
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3706
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3707
     Point instNameKeyFromSignature:Point signature.             
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3708
     Association instNameKeyFromSignature:Association signature.  
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3709
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3710
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3711
    "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
  3712
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3713
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3714
instSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3715
    "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
  3716
     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
  3717
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3718
    ^ aSignature bitAnd:16r7F
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3719
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3720
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3721
     Class instSizeFromSignature:Point signature.     
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3722
     Class instSizeFromSignature:Association signature.   
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3723
     Class instSizeFromSignature:Dictionary signature.    
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3724
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3725
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3726
    "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
  3727
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3728
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3729
instTypeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3730
    "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
  3731
     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
  3732
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3733
    ^ (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
  3734
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3735
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3736
     Class instTypeFromSignature:Object signature.               
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3737
     Class instTypeFromSignature:Array signature.                
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3738
     Class instTypeFromSignature:String signature.               
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3739
     Class instTypeFromSignature:OrderedCollection signature.    
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3740
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3741
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3742
    "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
  3743
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3744
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3745
signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3746
    "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
  3747
     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
  3748
     and the dynamic class loader.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3749
     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
  3750
     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
  3751
     (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
  3752
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3753
    |value   "{ Class: SmallInteger }"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3754
     nameKey "{ Class: SmallInteger }" |
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3755
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3756
    signature notNil ifTrue:[^ signature].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3757
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3758
    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
  3759
    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
  3760
    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
  3761
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3762
    nameKey := 0.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3763
    self allInstVarNames do:[:name |
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3764
        nameKey := nameKey bitShift:1.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3765
        (nameKey bitAnd:16r10000) ~~ 0 ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3766
            nameKey := nameKey bitXor:1.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3767
            nameKey := nameKey bitAnd:16rFFFF.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3768
        ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3769
        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
  3770
    ].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3771
    value := value + (nameKey bitShift:14).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3772
    signature := value.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3773
    ^ value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3774
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3775
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3776
     Array signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3777
     ByteArray signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3778
     View signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3779
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3780
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3781
    "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
  3782
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3783
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
  3784
!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
  3785
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3786
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
  3787
    "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
  3788
     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
  3789
     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
  3790
     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
  3791
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3792
    |owner info c|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3793
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  3794
    (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
  3795
    revision notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3796
        c := revision first.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3797
        c == $$ ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3798
            info := Class revisionInfoFromString:revision.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3799
            info isNil ifTrue:[^ '0'].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3800
            ^ info at:#revision ifAbsent:'0'.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3801
        ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3802
        c isDigit ifFalse:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3803
            ^ '0'
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3804
        ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3805
    ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  3806
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
  3807
    ^ 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
  3808
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3809
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3810
     Object binaryRevision
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  3811
     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
  3812
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3813
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3814
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3815
     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
  3816
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3817
     |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
  3818
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3819
     classes := Smalltalk allClasses 
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  3820
                    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
  3821
     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
  3822
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3823
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3824
    "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
  3825
    "Modified: 1.4.1997 / 23:33:01 / stefan"
2909
b4df6be2ed52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2906
diff changeset
  3826
    "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
  3827
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3828
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3829
currentSourceStream
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3830
    "return an open stream on the current source of the receiver"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3831
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3832
    |theWriteStream theCurrentSource|
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3833
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3834
    theWriteStream := String new writeStream.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3835
    Method flushSourceStreamCache.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3836
    self fileOutOn:theWriteStream withTimeStamp:false.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3837
    theCurrentSource := theWriteStream contents asString.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3838
    theWriteStream close.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3839
    ^ theCurrentSource
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3840
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3841
    "Modified: 15.10.1996 / 18:59:40 / cg"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3842
    "Modified: 1.4.1997 / 14:33:12 / stefan"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3843
!
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  3844
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3845
localSourceStreamFor:sourceFile
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3846
    "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
  3847
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3848
    |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
  3849
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3850
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3851
    "/ old: look in 'source/<filename>'
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3852
    "/ 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
  3853
    "/ classes in her currentDirectory.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3854
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3855
    fileName := Smalltalk getSourceFileName:sourceFile.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3856
    fileName notNil ifTrue:[
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3857
        ^ fileName asFilename readStream.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3858
    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3859
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3860
    (package := self package) notNil ifTrue:[
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3861
        "/ newest sceme ...
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3862
        packageDir := package copyReplaceAll:$: with:$/.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3863
        packageDir := Smalltalk getPackageFileName:packageDir.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3864
        packageDir notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3865
            "/ present there ?
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3866
            packageDir := packageDir asFilename.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3867
            (fn := packageDir construct:sourceFile) exists ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3868
                ^ fn readStream.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3869
            ].
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3870
            
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3871
            "/ a source subdirectory ?
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3872
            fn := (packageDir construct:'source') construct:sourceFile.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3873
            fn exists ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3874
                ^ fn readStream.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3875
            ].
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3876
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3877
            "/ a zip-file ?
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3878
            fn := (packageDir construct:'source.zip').
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3879
            fn exists ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3880
                zar := ZipArchive oldFileNamed:fn.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3881
                zar notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3882
                    entry := zar extract:sourceFile.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3883
                    entry notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3884
                        ^ entry asString readStream
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3885
                    ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3886
                ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3887
            ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3888
        ].
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3889
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3890
        "/ will vanish ...
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3891
        (package includes:$:) ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3892
            package := package asString copyReplaceAll:$: with:$/
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3893
        ] ifFalse:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3894
            package := 'stx/' , package
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3895
        ].
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3896
        fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile).
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3897
        fileName notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3898
            ^ fileName asFilename readStream.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3899
        ].
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3900
        (package startsWith:'stx/') ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3901
            fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile).
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3902
            fileName notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3903
                ^ fileName asFilename readStream.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3904
            ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3905
        ]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3906
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3907
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3908
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3909
    "/ new: look in 'source/<module>/<package>/<filename>
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3910
    "/ 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
  3911
    "/ obsolete.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3912
    info := self packageSourceCodeInfo.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3913
    info notNil ifTrue:[
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3914
        module := info at:#module ifAbsent:nil.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3915
        module notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3916
            dir := info at:#directory ifAbsent:nil.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3917
            dir notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3918
                fn := (module asFilename construct:dir) construct:sourceFile.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3919
                fileName := Smalltalk getSourceFileName:(fn name).
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3920
                fileName notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3921
                    ^ fileName asFilename readStream.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3922
                ].
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3923
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3924
                "/ brand new: look for source/<module>/package.zip
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3925
                "/ containing an entry for <filename>
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3926
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3927
                fn := (module asFilename construct:dir) withSuffix:'zip'.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3928
                fileName := Smalltalk getSourceFileName:(fn name).
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3929
                fileName notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3930
                    zar := ZipArchive oldFileNamed:fileName.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3931
                    zar notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3932
                        entry := zar extract:sourceFile.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3933
                        entry notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3934
                            ^ entry asString readStream
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3935
                        ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3936
                    ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3937
                ].
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3938
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3939
                "/ and also in source/source.zip ...
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3940
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3941
                fileName := Smalltalk getSourceFileName:'source.zip'.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3942
                fileName notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3943
                    zar := ZipArchive oldFileNamed:fileName.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3944
                    zar notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3945
                        entry := zar extract:sourceFile.
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3946
                        entry notNil ifTrue:[
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3947
                            ^ entry asString readStream
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3948
                        ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3949
                    ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3950
                ].
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3951
            ]
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  3952
        ]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3953
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3954
    ^ nil
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  3955
3657
9e9fe2dd4c30 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  3956
    "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
  3957
!
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  3958
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
  3959
packageSourceCodeInfo
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3960
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
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
    "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
  3963
     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
  3964
     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
  3965
     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
  3966
     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
  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
     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
  3969
     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
  3970
     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
  3971
     (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
  3972
     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
  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
     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
  3975
     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
  3976
     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
  3977
     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
  3978
     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
  3979
     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
  3980
     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
  3981
     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
  3982
     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
  3983
     (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
  3984
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3985
     For example: 
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  3986
        '....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  3987
        '....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  3988
        '....(stx:foo:libbfoo)'                  -> module: stx directory: foo library: libfoo
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  3989
        '....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  3990
        '....(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
  3991
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3992
     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
  3993
     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
  3994
     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
  3995
     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
  3996
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  3997
     Caveat:
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  3998
        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
  3999
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4000
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4001
    |owner sourceInfo packageString idx1 idx2 
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4002
     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
  4003
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4004
    (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4005
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4006
    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
  4007
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4008
    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
  4009
    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
  4010
    idx1 ~~ 0 ifTrue:[
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4011
        idx2 := packageString indexOf:$) startingAt:idx1+1.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4012
        idx2 ~~ 0 ifTrue:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4013
            sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4014
        ]
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4015
    ] ifFalse:[
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4016
        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
  4017
    ].
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4018
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4019
    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
  4020
    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
  4021
    components size == 0 ifTrue:[
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4022
"/        moduleString := 'stx'.
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4023
"/        directoryString := libraryString := ''.
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4024
        ^ nil
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4025
    ].
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4026
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4027
    component1 := components at:1.
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4028
    components size == 1 ifTrue:[
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4029
        "/ a single name given - the module becomes 'stx' or
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4030
        "/ the very first directory component (if such a module exists).
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4031
        "/ If the component includes slashes, its the directory
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4032
        "/ otherwise the library.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4033
        "/ 
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4034
        dirComponents := Filename concreteClass components:component1.     
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4035
        (dirComponents size > 1
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4036
        and:[(mgr := self sourceCodeManager) notNil
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4037
        and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4038
            moduleString := dirComponents first.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4039
            directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4040
        ] ifFalse:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4041
            "/ non-existing; assume directory under the stx package.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4042
            moduleString := 'stx'.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4043
            (component1 startsWith:'stx/') ifTrue:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4044
                component1 := component1 copyFrom:5
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4045
            ].
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4046
            directoryString := libraryString := component1.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4047
        ].
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4048
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4049
        (libraryString includes:$/) ifTrue:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4050
            libraryString := libraryString asFilename baseName
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4051
        ]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4052
    ] ifFalse:[
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4053
        component2 := components at:2.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4054
        components size == 2 ifTrue:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4055
            "/ two components - assume its the module and the directory; 
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4056
            "/ the library is assumed to be named after the directory
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4057
            "/ except, if slashes are in the name; then the libraryname
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4058
            "/ is the last component.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4059
            "/
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4060
            moduleString := component1.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4061
            directoryString := libraryString := component2.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4062
            (libraryString includes:$/) ifTrue:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4063
                libraryString := libraryString asFilename baseName
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4064
            ]
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4065
        ] ifFalse:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4066
            "/ all components given
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4067
            moduleString := component1.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4068
            directoryString := component2.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4069
            libraryString := components at:3.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4070
        ]
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
  4071
    ].
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4072
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
  4073
    libraryString isEmpty ifTrue:[
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4074
        directoryString notEmpty ifTrue:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4075
            libraryString := directoryString asFilename baseName
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4076
        ].
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4077
        libraryString isEmpty ifTrue:[
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4078
            "/ lets extract the library from the liblist file ...
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4079
            libraryString := Smalltalk libraryFileNameOfClass:self.
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4080
            libraryString isNil ifTrue:[^ nil].
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4081
        ]
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
  4082
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4083
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4084
    moduleString isEmpty ifTrue:[
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4085
        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
  4086
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4087
    directoryString isEmpty ifTrue:[
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4088
        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
  4089
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4090
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4091
    ^ IdentityDictionary
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4092
        with:(#module->moduleString)
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4093
        with:(#directory->directoryString)
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4094
        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
  4095
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4096
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4097
     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
  4098
     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
  4099
     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
  4100
     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
  4101
     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
  4102
     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
  4103
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4104
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4105
    "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
  4106
    "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
  4107
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4108
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4109
resourcePackName
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4110
    "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
  4111
     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
  4112
     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
  4113
     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
  4114
     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
  4115
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4116
    ^ self name
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4117
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4118
    "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
  4119
!
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
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
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
  4122
    "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
  4123
     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
  4124
     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
  4125
     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
  4126
     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
  4127
     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
  4128
     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
  4129
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4130
    |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
  4131
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4132
    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
  4133
    info notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4134
        ^ 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
  4135
    ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4136
    ^ 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
  4137
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
    "
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
     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
  4140
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4141
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
    "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
  4143
    "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
  4144
    "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
  4145
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4146
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4147
revisionDateString
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4148
    "return the revision-Date of the class as a string.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4149
     This is extracted from the version string."
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4150
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4151
    |info|
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4152
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4153
    info := self revisionInfo.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4154
    info notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4155
        ^ info at:#date ifAbsent:'??/??/??'
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4156
    ].
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4157
    ^ '??/??/??'
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4158
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4159
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4160
     Object revisionDateString 
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4161
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4162
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4163
    "Created: 23.4.1997 / 12:29:21 / cg"
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4164
!
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4165
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
  4166
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
  4167
    "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
  4168
     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
  4169
     The revisionInfo contains all or a subset of:
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4170
        #binaryRevision - the revision upon which the binary of this class is based
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4171
        #revision       - the revision upon which the class is based logically
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4172
                          (different, if a changed class was checked in, but not yet recompiled)
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4173
        #user           - the user who checked in the logical revision
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4174
        #date           - the date when the logical revision was checked in
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4175
        #time           - the time when the logical revision was checked in
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4176
        #fileName       - the classes source file name
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4177
        #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
  4178
    "
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
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
  4180
    |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
  4181
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4182
    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
  4183
    vsnString notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4184
        mgr := self sourceCodeManager.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4185
        mgr notNil ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4186
            info := mgr revisionInfoFromString:vsnString
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4187
        ] ifFalse:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4188
            info := Class revisionInfoFromString:vsnString.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4189
        ].
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4190
        info notNil ifTrue:[
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4191
            info at:#binaryRevision put:self binaryRevision.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4192
        ]
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
  4193
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4194
    ^ 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
  4195
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4196
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4197
     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
  4198
     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
  4199
     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
  4200
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4201
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4202
    "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
  4203
    "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
  4204
    "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
  4205
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4206
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4207
revisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4208
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4209
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
  4210
    "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
  4211
     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
  4212
     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
  4213
     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
  4214
     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
  4215
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4216
    |owner cls meta m src val|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4217
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4218
    (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
  4219
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4220
    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
  4221
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4222
    self isMeta ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4223
        meta := self. cls := self soleInstance
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4224
    ] ifFalse:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4225
        cls := self. meta := self class
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4226
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4227
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4228
    m := meta compiledMethodAt:#version.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4229
    m isNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4230
        "/ no - do NEVER care for a version method on the instance side
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4231
        "/ m := cls compiledMethodAt:#version.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4232
        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
  4233
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4234
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4235
    m isExecutable ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4236
        "/
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4237
        "/ if its a method returning the string,
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4238
        "/ thats the returned value
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4239
        "/
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4240
        val := cls version.
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4241
        val isString ifTrue:[^ val].
1102
6ed4f93420c6 dont call #version if the method has been unloaded
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  4242
    ].
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
  4243
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4244
    "/
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
    "/ 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
  4246
    "/ 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
  4247
    "/ 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
  4248
    "/ 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
  4249
    "/ 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
  4250
    "/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4251
    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
  4252
    src isNil ifTrue:[^ nil].
1811
8afb43250471 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1807
diff changeset
  4253
    ^ 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
  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
     Smalltalk allClassesDo:[:cls |
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4257
        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
  4258
     ].
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
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
     Number revisionString  
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4261
     FileDirectory revisionString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4262
     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
  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
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4265
    "Created: / 29.10.1995 / 19:28:03 / cg"
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4266
    "Modified: / 23.10.1996 / 18:23:56 / cg"
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4267
    "Modified: / 1.4.1997 / 23:37:25 / stefan"
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4268
    "Modified: / 7.2.2001 / 18:03:39 / ps"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4269
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4270
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4271
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
  4272
    "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
  4273
     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
  4274
     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
  4275
     (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
  4276
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4277
    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
  4278
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4279
    "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
  4280
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4281
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4282
setPackageFromRevision
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4283
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4284
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4285
    "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
  4286
     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
  4287
     (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
  4288
      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
  4289
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4290
    |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
  4291
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4292
    self owningClass notNil ifTrue:[^ self].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4293
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4294
    mgr := self sourceCodeManager.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4295
    mgr notNil ifTrue:[
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4296
        info := mgr sourceInfoOfClass:self
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4297
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4298
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4299
    info notNil ifTrue:[
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4300
        mod := info at:#module ifAbsent:nil.    "/ stx, aeg, <your-organization>
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4301
        dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ...
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4302
        lib := info at:#library ifAbsent:dir.
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4303
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4304
        p := ''.
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4305
        mod notNil ifTrue:[
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4306
"/            mod ~= 'stx' ifTrue:[
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4307
                p := p , mod
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4308
"/            ]
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4309
        ].
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4310
        dir notNil ifTrue:[
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4311
            p notEmpty ifTrue:[p := p , ':'].
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4312
            p := p , dir.
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4313
        ] ifFalse:[
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4314
            lib notNil ifTrue:[
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4315
                p notEmpty ifTrue:[p := p , ':'].
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4316
                p := p , lib.
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4317
            ].
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4318
        ].
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4319
        (p notEmpty and:[p ~= package]) ifTrue:[
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4320
"/            package notNil ifTrue:[
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4321
"/                (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR.
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4322
"/            ].
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4323
            package := p.
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4324
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4325
            self methodDictionary do:[:aMethod |
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4326
                aMethod package isNil ifTrue:[
5725
00c2d5e78792 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  4327
                    aMethod setPackage:p
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4328
                ]
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4329
            ]
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4330
        ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4331
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4332
    ^ self
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4333
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4334
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4335
     MemoryMonitor autoload.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4336
     MemoryMonitor setPackageFromRevision
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4337
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4338
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  4339
    "Modified: 12.6.1996 / 11:49:31 / stefan"
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4340
    "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
  4341
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4342
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4343
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
  4344
    "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
  4345
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4346
    |owner source|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4347
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4348
    (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
  4349
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4350
    classFilename notNil ifTrue:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4351
        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
  4352
    ] ifFalse:[
5801
3ae2f700ed6e *** empty log message ***
ps
parents: 5800
diff changeset
  4353
        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
  4354
    ].
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4355
    ^ self sourceStreamFor:source
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4356
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4357
    "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
  4358
    "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
  4359
!
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4360
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4361
sourceStreamFor:source
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4362
    "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
  4363
4752
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4364
    |owner fileName aStream mgr validated guessedFileName sep mod dir|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4365
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4366
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4367
    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
  4368
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4369
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4370
    "/ if there is no SourceCodeManager, 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4371
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4372
    "/ 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
  4373
    "/
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4374
    ((mgr := self sourceCodeManager) isNil 
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4375
    or:[TryLocalSourceFirst == true]) ifTrue:[
4641
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4376
        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
  4377
    ].
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
    aStream isNil ifTrue:[
4641
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4380
        "/ mhmh - still no source file.
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4381
        "/ If there is a SourceCodeManager, ask it to aquire the
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4382
        "/ the source for my class, and return an open stream on it. 
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4383
        "/ if that one does not know about the source, look in
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4384
        "/ standard places
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4385
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4386
        mgr notNil ifTrue:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4387
            classFilename ~= source ifTrue:[
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4388
                sep := self package indexOfAny:'/\:'.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4389
                sep ~~ 0 ifTrue:[
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4390
                    mod := package copyTo:sep - 1.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4391
                    dir := package copyFrom:sep + 1.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4392
                    aStream := mgr streamForClass:nil fileName:source revision:nil directory:dir module:mod cache:true.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4393
                ].
4647
9524fc8eb7ab care for nil classFilename
Claus Gittinger <cg@exept.de>
parents: 4641
diff changeset
  4394
            ].
4752
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4395
            aStream isNil ifTrue:[
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4396
                classFilename isNil ifTrue:[
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4397
                    classFilename := guessedFileName := (Smalltalk fileNameForClass:self) , '.st'.
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4398
                ].
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4399
                source asFilename baseName = classFilename asFilename baseName ifTrue:[
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4400
                    aStream := mgr getSourceStreamFor:self.
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4401
                ]
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4402
            ].
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4403
            aStream notNil ifTrue:[
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4404
                (self validateSourceStream:aStream) ifFalse:[
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4405
                    ('Class [info]: repositories source for `' 
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4406
                     , (self isMeta ifTrue:[self soleInstance name]
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4407
                                    ifFalse:[name])
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4408
                     , ''' is invalid.') infoPrintCR.
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4409
                    aStream close.
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4410
                    aStream := nil
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4411
                ] ifTrue:[
84c4de5b3f64 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4744
diff changeset
  4412
                    validated := true.
4641
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4413
                ].
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4414
            ].
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4415
        ]
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4416
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4417
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4418
    aStream isNil ifTrue:[
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4419
        "/      
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4420
        "/ hard case - there is no source file for this class
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4421
        "/ (in the source-dir-path).
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4422
        "/      
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4423
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4424
        "/      
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4425
        "/ look if my binary is from a dynamically loaded module,
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4426
        "/ and, if so, look in the modules directory for the
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4427
        "/ source file.
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4428
        "/      
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4429
        ObjectFileLoader notNil ifTrue:[
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4430
            ObjectFileLoader loadedObjectHandlesDo:[:h |
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4431
                |f classes|
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4432
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4433
                aStream isNil ifTrue:[
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4434
                    (classes := h classes) size > 0 ifTrue:[
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4435
                        (classes includes:self) ifTrue:[
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4436
                            f := h pathName.
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4437
                            f := f asFilename directory.
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4438
                            f := f construct:source.
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4439
                            f exists ifTrue:[
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4440
                                aStream := f readStream.
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4441
                            ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4442
                        ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4443
                    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4444
                ]
4641
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4445
            ].
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4446
        ].
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4447
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4448
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4449
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4450
    "/ try along sourcePath
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4451
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4452
    aStream isNil ifTrue:[
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4453
        aStream := self localSourceStreamFor:source.
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4454
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4455
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4456
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4457
    "/ final chance: try current directory
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4458
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4459
    aStream isNil ifTrue:[
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4460
        aStream := source asFilename readStream.
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
  4461
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4462
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4463
    (aStream notNil and:[validated not]) ifTrue:[
4641
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4464
        (self validateSourceStream:aStream) ifFalse:[
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4465
            (Smalltalk releaseIdentification = 'ST/X_free_demo_vsn') ifTrue:[
3401
da5821d3e57e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
  4466
"/                ('Class [info]: source for ''' , self name , ''' is not available in the demo version.') infoPrintCR
4641
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4467
            ] ifFalse:[
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4468
                ('Class [warning]: source for ''' , self name , ''' is invalid or stripped. Take care.') errorPrintCR
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4469
            ]
af9b8122eb10 dont ask sourceCode manager, if the requested source-filename
Claus Gittinger <cg@exept.de>
parents: 4629
diff changeset
  4470
        ].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4471
    ].
4744
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4472
    (aStream notNil and:[aStream isFileStream]) ifTrue:[
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4473
        guessedFileName notNil ifTrue:[
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4474
            classFilename := aStream pathName asFilename baseName.
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4475
        ]
c0a8ab60c9a3 fix classFileName setting
Claus Gittinger <cg@exept.de>
parents: 4743
diff changeset
  4476
    ].
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
  4477
    ^ 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
  4478
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4479
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4480
     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
  4481
     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
  4482
     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
  4483
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4484
3391
e012d2965887 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3390
diff changeset
  4485
    "Created: / 10.11.1995 / 21:05:13 / cg"
e012d2965887 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3390
diff changeset
  4486
    "Modified: / 22.4.1998 / 19:20:50 / ca"
3401
da5821d3e57e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3400
diff changeset
  4487
    "Modified: / 23.4.1998 / 15:53: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
  4488
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4489
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4490
updateVersionMethodFor:newRevisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4491
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4492
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
  4493
    "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
  4494
     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
  4495
4667
2b51bafd8243 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4647
diff changeset
  4496
    |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
  4497
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4498
    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
  4499
    self isMeta ifFalse:[
4606
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4500
        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
  4501
    ].
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4502
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
  4503
"/    m := cls compiledMethodAt:#version.
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4504
"/    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
  4505
"/    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
  4506
"/    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
  4507
"/
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4508
"/    (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
  4509
"/    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
  4510
"/    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
  4511
4606
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4512
    Class methodRedefinitionSignal answer:#keep do:[
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4513
        Class withoutUpdatingChangesDo:[
4667
2b51bafd8243 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4647
diff changeset
  4514
            mthd := Compiler compile:'version
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4515
    ^ ''' , 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
  4516
'
4606
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4517
                     forClass:cls 
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4518
                     inCategory:#documentation 
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4519
                     notifying:nil 
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4520
                     install:true 
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4521
                     skipIfSame:false 
4667
2b51bafd8243 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4647
diff changeset
  4522
                     silent:true.
2b51bafd8243 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4647
diff changeset
  4523
            mthd notNil ifTrue:[
5725
00c2d5e78792 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 5723
diff changeset
  4524
                mthd setPackage:self package
4667
2b51bafd8243 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4647
diff changeset
  4525
            ]
4606
21bf9124f4ac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4598
diff changeset
  4526
        ]
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
  4527
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4528
"/ ('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
  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
    ^ 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
  4531
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4532
    "Created: 7.12.1995 / 20:42:22 / cg"
1928
f0416304f29f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1927
diff changeset
  4533
    "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
  4534
!
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4535
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4536
validateSourceStream:aStream
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4537
    "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
  4538
     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
  4539
     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
  4540
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4541
    |cls meta cannotCheckReason versionMethod info
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4542
     versionFromCode versionFromSource oldPos pos src rev|
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4543
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4544
    self isMeta ifTrue:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4545
        meta := self. cls := self soleInstance
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4546
    ] ifFalse:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4547
        cls := self. meta := self class
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4548
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4549
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4550
    cannotCheckReason := nil.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4551
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4552
    versionMethod := meta compiledMethodAt:#version.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4553
    (versionMethod isNil 
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4554
    or:[versionMethod isExecutable not]) ifTrue:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4555
        versionMethod := cls compiledMethodAt:#version.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4556
        (versionMethod isNil
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4557
        or:[versionMethod isExecutable not]) ifTrue:[
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4558
            cannotCheckReason := 'no valid version method'.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4559
        ]
2544
c3a2791de289 care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
  4560
    ] ifFalse:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4561
        "/
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4562
        "/ if its a method returning the string,
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4563
        "/ thats the returned value
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4564
        "/
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4565
        versionFromCode := cls version.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4566
        versionFromCode isString ifFalse:[
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4567
            cannotCheckReason := 'version method does not return a string'
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4568
        ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4569
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4570
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4571
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4572
    "/ 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
  4573
    "/ 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
  4574
    "/ 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
  4575
    "/ 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
  4576
    "/ for the source ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4577
    "/
1942
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  4578
    versionMethod notNil ifTrue:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4579
        pos := versionMethod sourcePosition.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4580
        pos isInteger ifFalse:[
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4581
            "/ mhmh - either no version method,
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4582
            "/ or updated due to a checkin.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4583
            "/ in any case, this should be a good source.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4584
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4585
            ^ true.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4586
            "/ cannotCheckReason := 'no source position for version-method'
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4587
        ]
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4588
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4589
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4590
    cannotCheckReason notNil ifTrue:[
5182
8e4f1ced9319 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5116
diff changeset
  4591
        ('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR.
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4592
        'Class [info]: cannot validate source; trusting source' infoPrintCR.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4593
        ^ true
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4594
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4595
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4596
    oldPos := aStream position.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4597
    Stream positionErrorSignal handle:[:ex |
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4598
        'Class [info]: position error when accessing source' infoPrintCR.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4599
        ^ false
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4600
    ] do:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4601
        aStream position:pos.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4602
    ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4603
    src := aStream nextChunk.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4604
    aStream position:oldPos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4605
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4606
    (src isNil or:[src isEmpty]) ifTrue:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4607
        'Class [info]: empty source for version-method' infoPrintCR.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4608
        ^ false
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4609
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4610
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4611
    versionFromSource := Class revisionStringFromSource:src.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4612
    versionFromSource = versionFromCode ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4613
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4614
    versionFromSource isNil ifTrue:[
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4615
        'Class [info]: version-from source is nil' infoPrintCR.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4616
        ^ false
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4617
    ].
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  4618
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4619
    "/ mhmh - check my binary version ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4620
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4621
    info := Class revisionInfoFromString:versionFromSource.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4622
    info notNil ifTrue:[
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4623
        rev := info at:#revision.
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4624
        rev = self binaryRevision ifTrue:[^ true].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4625
    ].
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  4626
    '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
  4627
    ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4628
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  4629
    "Modified: / 9.4.1998 / 12:36:28 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4630
! !
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4631
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4632
!Class methodsFor:'special accessing'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4633
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4634
setName:aString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4635
    "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
  4636
     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
  4637
     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
  4638
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4639
    environment := nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4640
    name := aString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4641
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4642
    "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
  4643
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4644
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  4645
!Class class methodsFor:'documentation'!
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4646
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4647
version
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  4648
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.397 2001-05-22 23:07:54 cg Exp $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  4649
! !