Class.st
author vrany
Tue, 28 Jun 2011 15:16:04 +0200
changeset 13418 99d8ad133755
parent 13374 201a2a38899f
child 13461 ec9713586014
permissions -rw-r--r--
Jan's changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
     1
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
     3
               All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
5340
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
    12
"{ Package: 'stx:libbasic' }"
cdc42cba8f01 add a package definition-comment to filedOut source
Claus Gittinger <cg@exept.de>
parents: 5296
diff changeset
    13
719
c557a530f971 dont appending a chunk-separator to the initial copyright
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
    14
ClassDescription subclass:#Class
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    15
	instanceVariableNames:'name category classvars comment subclasses classFilename package
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    16
		revision environment signature attributes'
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    17
	classVariableNames:'DefaultCategoryForSTV DefaultCategoryForVAGE
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    18
		DefaultCategoryForDolphin'
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    19
	poolDictionaries:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    20
	category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    21
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    23
Object subclass:#ClassAttributes
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    24
	instanceVariableNames:'primitiveDefinitions primitiveVariables primitiveFunctions
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    25
		sharedPools traitComposition localSelectors'
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    26
	classVariableNames:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    27
	poolDictionaries:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    28
	privateIn:Class
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    29
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
    30
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    31
Object subclass:#SimulatedClassPool
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    32
	instanceVariableNames:'class'
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    33
	classVariableNames:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    34
	poolDictionaries:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    35
	privateIn:Class
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    36
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    37
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    38
Association subclass:#SimulatedVariableBinding
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    39
	instanceVariableNames:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    40
	classVariableNames:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    41
	poolDictionaries:''
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
    42
	privateIn:Class::SimulatedClassPool
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    43
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
    44
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
    45
!Class class methodsFor:'documentation'!
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    46
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    47
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    48
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    49
 COPYRIGHT (c) 1989 by Claus Gittinger
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
    50
               All Rights Reserved
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    51
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    52
 This software is furnished under a license and may be used
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    53
 only in accordance with the terms of that license and with the
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    54
 inclusion of the above copyright notice.   This software may not
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    55
 be provided or otherwise made available to, or used by, any
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    56
 other person.  No title to or ownership of the software is
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    57
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    58
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    59
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    60
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    61
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    62
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    63
    Class adds more functionality to classes; minimum stuff has already
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    64
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    65
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    66
    [Instance variables:]
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    67
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    68
        name            <Symbol>                    the classes name
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    69
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    70
        category        <Symbol>                    the classes category
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    71
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    72
        classvars       <String>                    the names of the class variables;
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    73
                        | <Collection of words>     initially, stc generates a string; this is converted on the fly
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    74
                                                    to an array of names. In the future, stc may be changed.
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    75
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    76
        comment         <String>                    the classes comment; either a string,
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    77
                                                    a number specifying the offset in classFilename, or nil
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    78
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    79
        subclasses      <Collection>                cached collection of subclasses
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    80
                                                    (not used for execution, but for the IDE to speed up certain operations)
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    81
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    82
        classFilename   <String>                    the file (or nil) where the classes' sources are found
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    83
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    84
        package         <Symbol>                    the package, in which the class was defined (inserted by compilers)
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    85
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    86
        revision        <String>                    revision string - inserted by stc
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    87
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    88
        environment     <Symbol | nil>              cached environment (i.e. Smalltalk or a namespace)
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    89
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    90
        signature       <SmallInteger>              the classes signature (used to detect obsolete or changed classes with binaryStorage)
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    91
                                                    This is filled in lazy - i.e. upon the first signature query.
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    92
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    93
        attributes   <Array | nil>                  describes primitiveIncludes, primitiveFunctions etc.
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
    94
                                                    also a place to add additional attributes, without a need to recompile all classes.
1923
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    95
97b099fef985 optionally keep a history of changed methods
Claus Gittinger <cg@exept.de>
parents: 1919
diff changeset
    96
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    97
    WARNING: layout known by compiler and runtime system
1287
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    98
c1e544b02e91 documentation
Claus Gittinger <cg@exept.de>
parents: 1266
diff changeset
    99
    [author:]
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   100
        Claus Gittinger
1669
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   101
4951596746f7 comments & code cleanup
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
   102
    [see also:]
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   103
        Behavior ClassDescription Metaclass
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   104
"
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   105
!
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   106
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   107
versionManagement
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   108
"
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   109
    old scheme (up to 5.4.x):
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   110
        the #version method is supposed to return a CVS (or RCS) version string.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   111
        this string contains (among other info) the revision number of the CVS container
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   112
        from which the class was compiled. 
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   113
        To access the source code of a class, this file is reconstructed (either cached or
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   114
        checked out), and the source-chunk is fetched from that file at the position which
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   115
        is stored in the method object.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   116
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   117
    new scheme (starting with 5.5.0):
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   118
        a classes sourcecode might be present in multiple source code management systems;
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   119
        for example, a site might decide to use CVS, where another might wonna use SVN
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   120
        (or other in the future).
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   121
        Therefore, a single version method is no longer sufficient; each sourceCodeManager
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   122
        will store its version info in its own format in a separate version method.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   123
        The sourceCodeManager can be asked via #nameOfVersionMethodInClasses for the selector
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   124
        of this version.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   125
        Currently these are #version_CVS and #version_SVN. More might be added in the future.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   126
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   127
        Two additional identifiers are added to support a unique id, which can be used to
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   128
        compare classes and methods coming from different source containers:
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   129
            version_VID and version_FID
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   130
        Both are UUID's. The VID is updated with every change, whereas the FID is assigned only once.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   131
        The FID can be interpreted as a functional-ID, and the VID as an identity id.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
   132
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   133
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   134
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
   135
!Class class methodsFor:'accessing-flags'!
362
claus
parents: 360
diff changeset
   136
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   137
tryLocalSourceFirst
11952
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   138
    "if true, local source files are tried first, before a sourceCodemanager is
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   139
     consulted. This may speed up the source access, but adds some insecurity, because
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   140
     the sourceCodemanager is always getting the source for the classes correct version.
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   141
     In contrast, the local file might be different from (edited in an external tool) in
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   142
     the meantime. You have been warned - better leave it false (the sourceCodemanager will
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   143
     fill its cache and eventually be just as fast...)"
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   144
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   145
    ^ TryLocalSourceFirst
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   146
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   147
    "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
   148
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   149
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   150
tryLocalSourceFirst:aBoolean
11952
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   151
    "if true, local source files are tried first, before a sourceCodemanager is
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   152
     consulted. This may speed up the source access, but adds some insecurity, because
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   153
     the sourceCodemanager is always getting the source for the classes correct version.
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   154
     In contrast, the local file might be different from (edited in an external tool) in
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   155
     the meantime. You have been warned - better leave it false (the sourceCodemanager will
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   156
     fill its cache and eventually be just as fast...)"
f698403a284c comment added
Claus Gittinger <cg@exept.de>
parents: 11873
diff changeset
   157
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   158
    TryLocalSourceFirst := aBoolean
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   159
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   160
    "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
   161
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
   162
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   163
updateChanges:aBoolean
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   164
    "turn on/off changes management. Return the prior value of the flag.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   165
     This value is used as a default fallback - a querySignal handler may still
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   166
     decide to return something else."
362
claus
parents: 360
diff changeset
   167
claus
parents: 360
diff changeset
   168
    |prev|
claus
parents: 360
diff changeset
   169
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   170
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   171
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   172
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   173
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   174
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   175
updatingChanges
858
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   176
    "return true if changes are recorded.
2c291d680784 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
   177
     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
   178
     decide to return something else."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   179
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   180
    ^ UpdatingChanges
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   181
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   182
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   183
!Class class methodsFor:'creating new classes'!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   184
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   185
name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   186
         subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   187
         instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   188
         category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   189
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   190
    "this new instance creation protocol will replace the traditional inst-creation messages"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   191
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   192
    ^ self
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   193
        name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   194
        subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   195
        instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   196
        classVariableNames:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   197
        poolDictionaries:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   198
        category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   199
!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   200
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   201
name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   202
         subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   203
         instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   204
         classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   205
         category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   206
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   207
    "this new instance creation protocol will replace the traditional inst-creation messages"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   208
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   209
    ^ self
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   210
        name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   211
        subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   212
        instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   213
        classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   214
        poolDictionaries:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   215
        category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   216
!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   217
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   218
name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   219
         subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   220
         instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   221
         classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   222
         classInstanceVariableNames:stringOfClassInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   223
         poolDictionaries:stringOfPoolNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   224
         category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   225
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   226
    "this new instance creation protocol will replace the traditional inst-creation messages"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   227
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   228
    ^ self class
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   229
        name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   230
        inEnvironment:Smalltalk
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   231
        subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   232
        instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   233
        variable:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   234
        words:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   235
        pointers:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   236
        classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   237
        poolDictionaries:stringOfPoolNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   238
        category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   239
        comment:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   240
        changed:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   241
        classInstanceVariableNames:stringOfClassInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   242
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   243
    "Modified: 16.6.1997 / 11:53:58 / cg"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   244
!
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   245
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   246
name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   247
         subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   248
         instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   249
         classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   250
         poolDictionaries:stringOfPoolNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   251
         category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   252
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   253
    "this new instance creation protocol will replace the traditional inst-creation messages"
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   254
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   255
    ^ self class
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   256
        name:newName 
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   257
        inEnvironment:Smalltalk
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   258
        subclassOf:aClass
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   259
        instanceVariableNames:stringOfInstVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   260
        variable:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   261
        words:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   262
        pointers:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   263
        classVariableNames:stringOfClassVarNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   264
        poolDictionaries:stringOfPoolNames
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   265
        category:categoryString
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   266
        comment:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   267
        changed:false
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   268
        classInstanceVariableNames:nil
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   269
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   270
    "Modified: 16.6.1997 / 11:53:58 / cg"
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   271
!
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   272
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   273
undeclared: name
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   274
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   275
    "
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   276
        Creates an 'undeclared' class, a placeholder for
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   277
        superclass when loading/filing-in a class whose 
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   278
        superclass does not exists.
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   279
    "
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   280
    Transcript showCR:'Smalltalk [info]: Declaring undeclared class: ', name.
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   281
    ^Object subclass: name asSymbol
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   282
            instanceVariableNames:''
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   283
            classVariableNames:''
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   284
            poolDictionaries:''
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   285
            category:'* undeclared classes!! *'
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   286
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   287
    "Created: / 08-11-2010 / 16:08:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10474
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   288
! !
7b4dd84fb0bf new class definition protocol started
Claus Gittinger <cg@exept.de>
parents: 10438
diff changeset
   289
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   290
!Class class methodsFor:'helpers'!
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   291
12004
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   292
nameWithoutPrefix:name
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   293
    "helper for fileOut and others - return a name's printString,
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   294
     without any owningClass or nameSpace prefix"
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   295
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   296
    |idx|
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   297
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   298
    idx := name lastIndexOf:$:.
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   299
    [idx > 1 and:[ (name at:(idx-1)) ~~ $: ]] whileTrue:[
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   300
        idx := name lastIndexOf:$: startingAt:idx-2.
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   301
    ].
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   302
    idx == 0 ifTrue:[
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   303
        ^ name
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   304
    ].
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   305
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   306
    ^ name copyFrom:idx+1.
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   307
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   308
    "a public class:
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   309
     Class nameWithoutPrefix:'Array'
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   310
     Class nameWithoutPrefix:'Tools::Array'
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   311
    "
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   312
!
3f1e0cdd7529 reusable nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 11952
diff changeset
   313
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   314
revisionInfoFromString:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   315
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   316
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   317
    "return a revision info, given a string.
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   318
     This extracts the relevant info from aString, asking
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   319
     the default sourceCode manager (if there is one).
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   320
     Notice, that this method is only invoked, if a class does not know
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   321
     its sourceCode manager."
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   322
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   323
    |mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   324
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   325
    "/
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   326
    "/ mhmh - ask the default manager.
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   327
    "/ if none has been defined, use the CVSSourceCodeManager
2312
2eb583fcbd56 always ask the classes sourceManager first, to extract the nr
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   328
    "/
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   329
    mgr := SourceCodeManager ? CVSSourceCodeManager.
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   330
    "/
7755
08b4e0bca2e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7754
diff changeset
   331
    "/ care for standAlone apps which have no CVS (libbasic3) included
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   332
    "/
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   333
    mgr isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   334
        AbstractSourceCodeManager notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   335
            ^ AbstractSourceCodeManager revisionInfoFromRCSString:aString
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   336
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   337
        ^ nil
7754
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   338
    ].
adc5c9bdbab5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7748
diff changeset
   339
    ^ mgr revisionInfoFromString:aString.
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   340
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   341
    "Modified: / 22-10-2008 / 20:27:21 / cg"
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   342
!
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   343
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   344
revisionStringFromSource:aMethodSourceString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   345
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   346
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   347
    "extract a revision string from a methods source string.
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   348
     Caveat: Assumes CVS."
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   349
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   350
    |lines line|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   351
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   352
    lines := aMethodSourceString asCollectionOfLines.
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   353
    lines do:[:l |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   354
        |i|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   355
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   356
        i := l indexOfSubCollection:'$Header: '.
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   357
	"JV @ 2009-12-13: Also search for '$Id: ' (because of SVN-only classes)"
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   358
	i == 0 ifTrue:[
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   359
	i := l indexOfSubCollection:'$Id: '].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   360
        i ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   361
            line := l copyFrom:i.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   362
            i := line lastIndexOf:$$.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   363
            i > 1 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   364
                line := line copyTo:i.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   365
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   366
            ^ line
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   367
        ]
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   368
    ].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   369
    ^ nil
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
   370
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   371
    "Created: / 15-10-1996 / 18:57:57 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
   372
    "Modified: / 22-10-2008 / 20:29:50 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   373
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   374
3618
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   375
!Class class methodsFor:'misc'!
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   376
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   377
template:aCategoryString
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   378
    "return a class-definition template"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   379
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   380
    ^ 'NameOfSuperclass subclass:#NameOfClass
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   381
    instanceVariableNames:''instVarName1 instVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   382
    classVariableNames:''classVarName1 classVarName2''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   383
    poolDictionaries:''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   384
    category:''' , aCategoryString , ''''
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   385
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   386
    "Created: / 19.6.1998 / 02:09:06 / cg"
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   387
! !
2ecf31e91023 added #template for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 3617
diff changeset
   388
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   389
!Class class methodsFor:'private'!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   390
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   391
flushSubclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   392
    "throw away (forget) the cached subclass information, as created
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   393
     by #subclassInfo.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   394
     This is private protocol"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   395
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   396
    SubclassInfo := nil.
12859
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   397
    self allSubInstancesDo:[:cls |
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   398
        cls flushSubclasses
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   399
    ].
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   400
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   401
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   402
     Class flushSubclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   403
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   404
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   405
    "Modified: 22.1.1997 / 18:39:36 / cg"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   406
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   407
12507
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   408
flushSubclassInfoFor:aClass
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   409
    "throw away (forget) the cached subclass information for aClass, as created
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   410
     by #subclassInfo.
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   411
     This is private protocol"
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   412
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   413
    aClass notNil ifTrue:[
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   414
        SubclassInfo notNil ifTrue:[
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   415
            SubclassInfo removeKey:aClass ifAbsent:[]
12859
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   416
        ].
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   417
        aClass flushSubclasses
12507
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   418
    ].
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   419
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   420
    "
12694
6a2c27a17e14 comment
Claus Gittinger <cg@exept.de>
parents: 12689
diff changeset
   421
     Class flushSubclassInfoFor:View
12507
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   422
    "
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   423
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   424
    "Modified: 22.1.1997 / 18:39:36 / cg"
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   425
!
41ac4792b598 added: #flushSubclassInfoFor:
Claus Gittinger <cg@exept.de>
parents: 12415
diff changeset
   426
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   427
subclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   428
    "build & return a dictionary, containing the set of subclass
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   429
     for each class. This information is kept until explicitely flushed
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   430
     by #flushSubclassInfo.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   431
     This cache is used internally, for enumerators like #allSubclasses
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   432
     or #allSubclassesDo:, to avoid repeated recursive walks over the class
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   433
     hierarchy.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   434
     This is private protocol."
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   436
    |d|
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   437
12859
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   438
"/    SubclassInfo notNil ifTrue:[^ SubclassInfo].
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   439
"/
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   440
"/    d := IdentityDictionary new.
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   441
"/    Smalltalk allClassesDo:[:aClass |
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   442
"/        |superCls setToAddSubclass|
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   443
"/
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   444
"/        superCls := aClass superclass.
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   445
"/        superCls notNil ifTrue:[
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   446
"/            setToAddSubclass := d at:superCls ifAbsent:nil.
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   447
"/            setToAddSubclass isNil ifTrue:[
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   448
"/                d at:superCls put:(Set with:aClass).
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   449
"/            ] ifFalse:[
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   450
"/                setToAddSubclass add:aClass
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   451
"/            ]
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   452
"/        ]
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
   453
"/    ].
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   454
    SubclassInfo := d.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   455
    ^ d
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   456
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   457
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   458
     Class subclassInfo
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   459
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   460
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   461
    "Modified: 22.1.1997 / 18:44:59 / cg"
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   462
! !
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
   463
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
   464
!Class class methodsFor:'queries'!
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   465
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   466
isBuiltInClass
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   467
    "return true if this class is known by the run-time-system.
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   468
     Here, true is returned for myself, false for subclasses."
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   469
1179
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   470
    ^ self == Class class or:[self == Class]
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   471
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   472
    "Created: 15.4.1996 / 17:17:13 / cg"
1266
cef9b3cd49df commentary
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   473
    "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
   474
! !
3e0f32177af4 allow subclasses of Class to be changed
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
   475
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   476
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   477
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   478
!Class methodsFor:'Compatibility-Dolphin'!
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   479
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   480
defaultCategoryForDolphinClasses
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   481
    ^ DefaultCategoryForDolphin ? 'Dolphin classes'.
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   482
!
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   483
11162
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   484
stb_version
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   485
    ^ 0
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   486
!
ec3593f9c86a changed #'stb_version'
Claus Gittinger <cg@exept.de>
parents: 11137
diff changeset
   487
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   488
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   489
    "{ Pragma: +optSpace }"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   490
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   491
    "this method allows fileIn of Dolphin classes "
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   492
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   493
    ^ self subclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   494
           instanceVariableNames:f
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   495
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   496
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   497
           category:(self defaultCategoryForDolphinClasses)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   498
           classInstanceVariableNames:classInstanceVariableNames
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   499
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   500
    "Modified: / 15.6.1998 / 21:31:34 / cg"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   501
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   502
!
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   503
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   504
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:classInstanceVariableNames
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   505
    "{ Pragma: +optSpace }"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   506
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   507
    "this method allows fileIn of Dolphin classes "
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   508
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   509
    ^ self variableSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   510
           instanceVariableNames:f
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   511
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   512
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   513
           category:(self defaultCategoryForDolphinClasses)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   514
           classInstanceVariableNames:classInstanceVariableNames
6823
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   515
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   516
    "Modified: / 15.6.1998 / 21:31:34 / cg"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   517
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   518
! !
3fc7d2f54d20 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6759
diff changeset
   519
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   520
!Class methodsFor:'Compatibility-ST/V and V''Age'!
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   521
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   522
defaultCategoryForSTVorVAGEClasses
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   523
    |cat app|
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   524
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   525
    DefaultApplicationQuerySignal isHandled ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   526
        app := DefaultApplicationQuerySignal query.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   527
        app notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   528
            cat := 'Applications-' , app name.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   529
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   530
            cat := DefaultCategoryForVAGE ? 'V''Age classes'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   531
        ].
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   532
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   533
        cat := DefaultCategoryForSTV ? 'ST/V classes'.
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   534
    ].
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   535
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   536
    ^ cat
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   537
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   538
9178
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   539
subclass:nm classInstanceVariableNames:cIV instanceVariableNames:iV classVariableNames:cV poolDictionaries:p
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   540
    "{ Pragma: +optSpace }"
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   541
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   542
    "this method allows fileIn of V'Age classes"
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   543
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   544
    ^ self 
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   545
           subclass:nm
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   546
           instanceVariableNames:iV
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   547
           classVariableNames:cV
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   548
           poolDictionaries:p
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   549
           category:(self defaultCategoryForSTVorVAGEClasses)
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   550
           classInstanceVariableNames:cIV
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   551
!
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   552
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   553
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   554
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   555
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   556
    "this method allows fileIn of ST/V and V'Age classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   557
     (which seem to have no category)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   558
9178
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   559
    ^ self 
f6ec6e771009 V'age subclass definition with class-inst-var
Claus Gittinger <cg@exept.de>
parents: 9063
diff changeset
   560
           subclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   561
           instanceVariableNames:f
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   562
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   563
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   564
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   565
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   566
    "Modified: / 15.6.1998 / 21:31:34 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   567
    "Modified: / 18.3.1999 / 18:16:11 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   568
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   569
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   570
variableByteSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   571
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   572
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   573
    "this method allows fileIn of ST/V and V'Age variable byte classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   574
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   575
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   576
    ^ self variableByteSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   577
           instanceVariableNames:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   578
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   579
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   580
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   581
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   582
    "Modified: / 15.6.1998 / 21:31:38 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   583
    "Modified: / 18.3.1999 / 18:16:21 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   584
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   585
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   586
variableLongSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   587
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   588
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   589
    "this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   590
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   591
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   592
    ^ self variableLongSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   593
           instanceVariableNames:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   594
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   595
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   596
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   597
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   598
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   599
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   600
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   601
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   602
    "this method allows fileIn of ST/V and V'Age variable pointer classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   603
     (which seem to have no category)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   604
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   605
    ^ self variableSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   606
           instanceVariableNames:f
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   607
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   608
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   609
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   610
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   611
    "Modified: / 15.6.1998 / 21:31:41 / cg"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   612
    "Modified: / 18.3.1999 / 18:16:33 / stefan"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   613
!
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   614
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   615
variableWordSubclass:t classVariableNames:d poolDictionaries:s
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   616
    "{ Pragma: +optSpace }"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   617
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   618
    "this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   619
     (which seem to have no category and no instvars)"
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   620
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   621
    ^ self variableWordSubclass:t
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   622
           instanceVariableNames:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   623
           classVariableNames:d
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   624
           poolDictionaries:s
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   625
           category:(self defaultCategoryForSTVorVAGEClasses)
6225
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   626
! !
798727eb3beb more V'Age filein support.
Claus Gittinger <cg@exept.de>
parents: 6166
diff changeset
   627
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   628
!Class methodsFor:'Compatibility-ST80'!
5190
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   629
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   630
fileOutSourceOn:aStream
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   631
    self fileOutOn:aStream withTimeStamp:false
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   632
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   633
    "Created: 20.6.1997 / 17:18:14 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   634
    "Modified: 20.6.1997 / 17:18:26 / cg"
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   635
!
9e551fac8864 category renamining
Claus Gittinger <cg@exept.de>
parents: 5183
diff changeset
   636
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   637
rename:newName
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   638
    "same as renameTo: - for ST80 compatibility"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   639
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   640
    ^ Smalltalk renameClass:self to:newName.
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   641
"/    ^ self renameTo:newName
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   642
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   643
    "Created: / 18.6.1998 / 22:08:45 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   644
! !
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
   645
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
   646
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   647
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   648
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   649
addChangeRecordForClass:aClass andNotifyChangeOf:aspect
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   650
    "writes a change record and notifies dependents."
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   651
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   652
    |namespace|
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   653
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   654
    self addChangeRecordForClass:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   655
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   656
    aClass changed:#definition.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   657
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   658
    namespace := aClass nameSpace.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   659
    namespace changed:#classDefinition with:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   660
    namespace ~~ Smalltalk ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   661
        Smalltalk changed:#classDefinition with:aClass.
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   662
    ].
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   663
    namespace changed:aspect with:aClass.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   664
    namespace ~~ Smalltalk ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   665
        Smalltalk changed:aspect with:aClass.
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   666
    ].
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   667
!
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   668
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   669
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   670
    "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
   671
     Also writes a change record and notifies dependents."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   672
13209
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   673
    self addClassVarNames:(Array with:aString).
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   674
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   675
    "Created: / 29-10-1995 / 19:40:51 / cg"
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   676
    "Modified: / 23-01-1998 / 15:46:23 / stefan"
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   677
    "Modified: / 15-01-2011 / 14:17:41 / cg"
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   678
!
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   679
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   680
addClassVarNames:aCollectionOfStrings
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   681
    "add a number of class variables if not already there and initialize them with nil.
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   682
     Also writes a change record and notifies dependents."
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   683
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   684
    |newVariables|
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   685
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   686
    newVariables := aCollectionOfStrings reject:[:each | self classVarNames includes:each].
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   687
    newVariables isEmpty ifTrue:[^ self].
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   688
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   689
    newVariables := newVariables collect:[:each | each asSymbol].
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   690
    self classVariableString:(self classVariableString , ' ' , (newVariables asStringWith:' ')).
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   691
    Class withoutUpdatingChangesDo:[
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   692
        self withAllSubclasses do:[:cls|
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   693
            cls recompileMethodsAccessingAnyClassvarOrGlobal:newVariables
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   694
        ].
13209
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   695
    ].
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   696
    self addChangeRecordForClass:self andNotifyChangeOf:#classVariables.
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   697
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   698
    "Modified: / 23-01-1998 / 15:46:23 / stefan"
fd401a236dd7 added: #addClassVarNames:
Claus Gittinger <cg@exept.de>
parents: 13188
diff changeset
   699
    "Created: / 15-01-2011 / 14:17:21 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   700
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   701
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   702
allPrivateClasses
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   703
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   704
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   705
    "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
   706
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   707
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   708
    ^ self privateClassesOrAll:true
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   709
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   710
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   711
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   712
category
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   713
    "return the category of the class.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   714
     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
   715
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   716
    |owner|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   717
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   718
    (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
   719
    ^ category
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   720
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   721
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   722
     Point category
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   723
     Dictionary category
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   724
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   725
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   726
    "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
   727
    "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
   728
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   729
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   730
category:aStringOrSymbol
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   731
    "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
   732
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   733
    |ns|
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   734
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
   735
    self setCategory:aStringOrSymbol.
10195
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   736
    self addChangeRecordForClass:self.
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   737
    ns := self nameSpace.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   738
    ns changed:#organization.
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   739
    ns ~~ Smalltalk ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   740
        Smalltalk changed:#organization.
7579
272f62f6e2a1 send a change notification from #category:
Claus Gittinger <cg@exept.de>
parents: 7517
diff changeset
   741
    ]
10195
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   742
2484228d4c95 the method does the change-file update when changing
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   743
    "Modified: / 23-11-2006 / 16:54:20 / cg"
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   744
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   745
10078
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   746
classBaseFilename
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   747
    "return the baseName of the file from which the class was compiled.
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   748
     In contrast to classFilename, this will always be a plain basename."
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   749
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   750
    ^ self classFilename asFilename baseName
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   751
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   752
    "
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   753
     Math::ClosedInterval classFilename
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   754
    "
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   755
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   756
    "Created: / 12-10-2006 / 15:49:32 / cg"
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   757
!
1be7d1df3829 +classBaseFilename
Claus Gittinger <cg@exept.de>
parents: 10053
diff changeset
   758
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   759
classFilename
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   760
    "return the name of the file from which the class was compiled.
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   761
     If the class was loaded via an explicit load (i.e. from the fileBrowser),
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   762
     this will be an absolute path. Oherwise, it will be a basename only.
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   763
     See classBaseFilename for a method which always returns the basename."
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   764
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   765
    |owner info fn|
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   766
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   767
    (owner := self owningClass) notNil ifTrue:[^ owner classFilename].
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
   768
12303
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   769
"/  This was added as an extension of libsvn - should be no longer needed
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   770
"/    compatQuery := Smalltalk classNamed: 'SVN::CompatModeQuery'.
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   771
"/    (compatQuery notNil 
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   772
"/    and:[compatQuery isLoaded 
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   773
"/    and:[(compatQuery query ? true) not]])
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   774
"/        ifTrue:[^SVN::Repository containerNameForClass: self].
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
   775
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   776
    classFilename notNil ifTrue:[ ^ classFilename ].
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   777
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   778
    (info := self revisionInfo) notNil ifTrue:[
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   779
        fn := info fileName.
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   780
        fn notNil ifTrue:[
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   781
            ^ fn
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   782
        ].
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   783
    ].
12303
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   784
    ^ (Smalltalk fileNameForClass:self), '.', self sourceFileSuffix
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   785
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   786
    "
12303
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   787
     SVN::Repository classFilename          
5e0473c32f83 changed: #classFilename
fm
parents: 12297
diff changeset
   788
     Array classFilename                    
12018
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   789
    "
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   790
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   791
    "Modified: / 22-10-2008 / 20:58:21 / cg"
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   792
!
a24a9968fdf4 oops: #classFilename was lost with fm's vrany merge
Claus Gittinger <cg@exept.de>
parents: 12015
diff changeset
   793
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   794
classPool
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   795
    "return something which allows access to my classVariables via
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   796
     #at: and #at:put: messages."
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   797
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   798
    ^ SimulatedClassPool new setClass:self
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   799
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   800
    "
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   801
     Button classPool
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   802
    "
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   803
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   804
    "Modified: 17.10.1997 / 12:12:14 / cg"
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   805
!
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
   806
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   807
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   808
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   809
     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
   810
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   811
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   812
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   813
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   814
     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
   815
     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
   816
     no classPools yet.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   817
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   818
    ^ Smalltalk at:(self globalKeyForClassVar:aSymbol)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   819
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   820
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   821
classVarAt:aSymbol ifAbsent:exceptionBlock
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   822
    "return the value of a class variable.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   823
     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
   824
     this may change."
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   825
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   826
    "
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   827
     this hides the (current) implementation of classVariables
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   828
     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
   829
     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
   830
     no classPools yet.
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   831
    "
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
   832
    ^ Smalltalk at:(self globalKeyForClassVar:aSymbol) ifAbsent:exceptionBlock
5707
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   833
!
0b7652a19caf change notifications when adding/removing classVars
Claus Gittinger <cg@exept.de>
parents: 5703
diff changeset
   834
13106
f2f4b6db778c comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 13093
diff changeset
   835
classVarAt:aSymbolOrString put:something
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   836
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   837
     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
   838
     classVar exists - this may change."
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
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   841
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   842
     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
   843
     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
   844
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   845
    "
13106
f2f4b6db778c comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 13093
diff changeset
   846
    Smalltalk at:(self globalKeyForClassVar:aSymbolOrString) put:something.
f2f4b6db778c comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 13093
diff changeset
   847
f2f4b6db778c comment/format in: #classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 13093
diff changeset
   848
    "Modified: / 27-10-2010 / 16:35:17 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   849
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   850
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   851
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   852
    "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
   853
     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
   854
     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
   855
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   856
    classvars isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   857
        ^ #()
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   858
    ].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   859
    classvars isString ifTrue:[
11873
cbc08817ae5d use collect:as:
Claus Gittinger <cg@exept.de>
parents: 11866
diff changeset
   860
        classvars := classvars asCollectionOfWords collect:[:varName| varName asSymbol] as:Array.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   861
        ^ classvars
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   862
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   863
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   864
    ^ classvars
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   865
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   866
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   867
     Object classVarNames
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   868
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   869
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   870
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   871
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   872
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   873
    "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
   874
     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
   875
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   876
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   877
    classvars isNil ifTrue:[^ ''].
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   878
    classvars isString ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   879
        ^ classvars
5514
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   880
    ].
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   881
0db3f902e1df keep classVarNames as array (much like instVars)
Claus Gittinger <cg@exept.de>
parents: 5474
diff changeset
   882
    ^ classvars asStringWith:(Character space)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   883
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   884
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   885
     Object classVariableString
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   886
     Float classVariableString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   887
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   888
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   889
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   890
classVariableString:aString
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   891
    "set the classes classvarnames string;
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   892
     Initialize new class variables with nil, clear and remove old ones.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   893
     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
   894
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   895
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   896
7517
6289abd4333d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7486
diff changeset
   897
    (aString ~= self classVariableString) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   898
        prevVarNames := self classVarNames asOrderedCollection.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   899
        classvars := aString.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   900
        varNames := self classVarNames.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   901
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   902
        "new ones get initialized to nil;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   903
         - old ones are nilled and removed from Smalltalk"
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   904
        any := false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   905
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   906
        varNames do:[:aName |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   907
            (prevVarNames includes:aName) ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   908
                "a new one"
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   909
                self classVarAt:aName put:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   910
                any := true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   911
            ] ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   912
                prevVarNames remove:aName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   913
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   914
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   915
        "left overs are gone"
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   916
        prevVarNames do:[:aName |
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   917
            any := true.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   918
            self classVarAt:aName put:nil.
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   919
            Smalltalk removeKey:(self globalKeyForClassVar:aName).
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   920
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   921
        any ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   922
            Smalltalk changed:#classVariables with:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   923
        ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   924
    ]
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
   925
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   926
    "Modified: / 02-04-1997 / 00:16:05 / stefan"
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
   927
    "Modified: / 18-11-2006 / 17:13:14 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   928
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   929
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   930
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   931
    "return the comment (aString) of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   932
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   933
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   934
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   935
    "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
   936
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   937
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   938
    comment isNumber ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   939
        classFilename notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   940
            stream := self sourceStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   941
            stream notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   942
                stream position1Based:comment.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   943
                string := String readFrom:stream onError:''.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   944
                stream close.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   945
                ^ string
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   946
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   947
            ^ nil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   948
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   949
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   950
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   951
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   952
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
   953
     Object comment
7054
685d359f9847 code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents: 7050
diff changeset
   954
     RunArray comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   955
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   956
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   957
7128
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   958
comment:aStringOrNil
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   959
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
   960
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   961
    "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
   962
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   963
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   964
    |oldComment newComment|
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   965
7128
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   966
    newComment := aStringOrNil.
1356f9e1371d empty comments are nil
Claus Gittinger <cg@exept.de>
parents: 7103
diff changeset
   967
    (aStringOrNil notNil and:[aStringOrNil withoutSeparators isEmpty]) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   968
        newComment := nil
865
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   969
    ].
0cfc2bd91232 clear empty comments back to nil
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   970
    comment ~= newComment ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   971
        oldComment := self comment.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   972
        comment := newComment.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   973
        self addChangeRecordForClassComment:self.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   974
        self changed:#comment with:oldComment.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
   975
        Smalltalk changed:#classComment with:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   976
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   977
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   978
2444
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   979
environment
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   980
    "return the namespace I am contained in; ST-80 compatible name"
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   981
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   982
    ^ self nameSpace
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   983
!
97306504d33c checkin from browser
ca
parents: 2439
diff changeset
   984
11866
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   985
generateClassFilename
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   986
    "generate the expected filename for this class - without suffix.
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   987
     This may be different from the actual classFilename"
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   988
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   989
    ^ self theNonMetaclass name copyReplaceAll:$: with:$_
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   990
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   991
    "
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   992
     Complex generateClassFilename
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   993
     HTML::AbstractElement generateClassFilename
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   994
    "
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   995
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   996
    "Modified: / 06-10-2006 / 16:16:01 / cg"
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   997
!
b2c6e6d23adc New: #generateClassFilename
Stefan Vogel <sv@exept.de>
parents: 11699
diff changeset
   998
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
   999
getClassFilename
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1000
    "return the name of the file from which the class was compiled.
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1001
     If the class was loaded via an explicit load (i.e. from the fileBrowser),
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1002
     this will be an absolute path. Oherwise, it will be a basename only."
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1003
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1004
    |owner|
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1005
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1006
    (owner := self owningClass) notNil ifTrue:[^ owner getClassFilename].
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1007
    ^ classFilename
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1008
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1009
    "Modified: / 06-10-2006 / 13:32:01 / cg"
9497
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1010
!
687d681324f5 *** empty log message ***
fm
parents: 9494
diff changeset
  1011
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1012
getPackage
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1013
    "get the package or nil."
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1014
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1015
    ^ package
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1016
!
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1017
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1018
globalKeyForClassVar:aStringOrSymbol
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1019
    "this helps to encapsulate the (current) implementation of classVariables
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1020
     from the outside world. Currently, classvars are stored in
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1021
     the Smalltalk dictionary with a funny name, since there are
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1022
     no classPools yet.
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1023
    "
10184
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
  1024
    ^ (self theNonMetaclass name , ':' , aStringOrSymbol) asSymbol
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
  1025
620a66cacd64 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10167
diff changeset
  1026
    "Modified: / 18-11-2006 / 17:13:39 / cg"
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1027
!
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1028
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1029
name
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1030
    "return the name of the class.
6657
a0fa5a821176 comment
Claus Gittinger <cg@exept.de>
parents: 6520
diff changeset
  1031
     This returns a symbol (but notice, that other smalltalks might return a string)."
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1032
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1033
    ^ name
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1034
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1035
    "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
  1036
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  1037
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
  1038
nameSpace
2070
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  1039
    "return the namespace I am contained in;
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  1040
     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
  1041
     for public classes, Smalltalk is returned."
ddaa32666cc1 avoid creating a temp string in nameWithoutPrefix
Claus Gittinger <cg@exept.de>
parents: 2068
diff changeset
  1042
7321
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
  1043
    |idx nsName e|
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
  1044
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
  1045
    "/ cached in environment
eeb750ef18aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7276
diff changeset
  1046
    environment isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1047
        e := Smalltalk. "/ default
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1048
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1049
        name notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1050
            "/ due to the implementation, extract this from my name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1051
            "/ (physically, all classes are found in Smalltalk)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1052
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1053
            idx := name lastIndexOf:$:.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1054
            idx ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1055
                (name at:idx-1) == $: ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1056
                    nsName := name copyTo:(idx - 2).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1057
                    e := Smalltalk at:nsName asSymbol.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1058
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1059
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1060
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1061
        environment := e.
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
  1062
    ].
2493
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1063
    ^ environment
ba34c6aac597 cache nameSpace info in environment instVar
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1064
3661
161322291871 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  1065
    "Modified: / 20.7.1998 / 14:21:36 / cg"
1919
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
  1066
!
cb189a5dcac8 added namespace query
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
  1067
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1068
package
12361
58f46d1d341b removed the obsolete #packageInfo
Claus Gittinger <cg@exept.de>
parents: 12308
diff changeset
  1069
    "return the package-ID-Symbol of the class."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1070
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1071
    |owner|
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1072
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1073
    (owner := self owningClass) notNil ifTrue:[^ owner package].
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  1074
    package isNil ifTrue:[^ PackageId noProjectID].
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1075
    ^ package
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1076
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1077
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1078
     Object package
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1079
    "
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1080
3951
7c6c0f0c4ac7 avoid nil package return
Claus Gittinger <cg@exept.de>
parents: 3937
diff changeset
  1081
    "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
  1082
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1083
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1084
package:aSymbol
12361
58f46d1d341b removed the obsolete #packageInfo
Claus Gittinger <cg@exept.de>
parents: 12308
diff changeset
  1085
    "set the package-ID.Symbol of the class."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1086
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1087
    |newPackage oldPackage|
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1088
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  1089
    aSymbol == PackageId noProjectID ifTrue:[
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1090
        newPackage := nil
9693
679da2cd8003 allow for and hide nil-packageID (== NoProject)
Claus Gittinger <cg@exept.de>
parents: 9653
diff changeset
  1091
    ] ifFalse:[
9724
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1092
        newPackage := aSymbol
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1093
    ].
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1094
    package ~= newPackage ifTrue:[
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1095
        oldPackage := package.
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1096
        package := newPackage.
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1097
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1098
        self changed:#package.
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1099
        Smalltalk changed:#projectOrganization with:(Array with:self with:oldPackage).
48fd8714ebae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9693
diff changeset
  1100
    ].
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1101
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1102
    "Modified: / 09-08-2006 / 17:58:53 / fm"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1103
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1104
13188
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1105
poolDictionaries
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1106
    "this returns the concatenated pool name string"
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1107
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1108
    ^ self sharedPoolNames asStringWith:' '
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1109
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1110
    "Modified: / 18-01-2011 / 17:56:12 / cg"
13188
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1111
!
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1112
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1113
primitiveDefinitions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1114
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1115
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1116
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1117
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1118
    (self isPrivate) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1119
        self error:'private classes cannot have their own primitiveDefinitions'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1120
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1121
    self setPrimitiveDefinitions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1122
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1123
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1124
    "Created: 29.10.1995 / 19:41:39 / cg"
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
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1127
primitiveDefinitionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1128
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1129
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1130
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1131
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1132
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1133
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1134
    (owner := self owningClass) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1135
        ^ owner primitiveDefinitionsString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1136
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1137
    ^ self getSourceChunkAttribute:#primitiveDefinitions
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1138
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1139
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1140
     Object primitiveDefinitionsString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1141
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1142
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1143
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1144
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1145
primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1146
    "return the primitiveDefinition string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1147
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1148
    ^ self primitiveDefinitionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1149
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1150
/*
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1151
 * includes, defines, structure definitions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1152
 * and typedefs come here.
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1153
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1154
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1155
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1156
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1157
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1158
     Object primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1159
     String primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1160
     ExternalStream primitiveDefinitionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1161
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1162
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1163
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1164
primitiveFunctions:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1165
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1166
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1167
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1168
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1169
    (self isPrivate) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1170
        self error:'private classes cannot have their own primitiveFunctions'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1171
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1172
    self setPrimitiveFunctions:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1173
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1174
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1175
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1176
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1177
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1178
primitiveFunctionsString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1179
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1180
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1181
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1182
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1183
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1184
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1185
    (owner := self owningClass) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1186
        ^ owner primitiveFunctionsString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1187
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1188
    ^ self getSourceChunkAttribute:#primitiveFunctions
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1189
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1190
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1191
primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1192
    "return the primitiveFunction string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1193
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1194
    ^ self primitiveFunctionsString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1195
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1196
/*
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1197
 * any local C (helper) functions
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1198
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1199
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1200
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1201
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1202
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1203
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1204
     Object primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1205
     String primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1206
     ExternalStream primitiveFunctionsStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1207
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1208
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1209
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1210
primitiveVariables:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1211
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1212
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1213
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1214
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1215
    (self isPrivate) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1216
        self error:'private classes cannot have their own primitiveVariables'.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1217
    ].
5800
a4386f928cf0 setPrimitive* accessors (without change notifications) added
Claus Gittinger <cg@exept.de>
parents: 5770
diff changeset
  1218
    self setPrimitiveVariables:aString.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1219
    self addChangeRecordForPrimitiveVariables:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1220
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1221
    "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
  1222
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1223
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1224
primitiveVariablesString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1225
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1226
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1227
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1228
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1229
    |owner|
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1230
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1231
    (owner := self owningClass) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1232
        ^ owner primitiveVariablesString
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1233
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  1234
    ^ self getSourceChunkAttribute:#primitiveVariables
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1235
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1236
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1237
primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1238
    "return the primitiveVariable string or a default"
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1239
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1240
    ^ self primitiveVariablesString ? '%{
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1241
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1242
/*
5875
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1243
 * any local C variables
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1244
 * come here (please, define as static)
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1245
 */
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1246
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1247
%}'
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1248
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1249
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1250
     Object primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1251
     String primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1252
     ExternalStream primitiveVariablesStringOrDefault
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1253
    "
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1254
!
5ccb39187705 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5863
diff changeset
  1255
11137
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1256
privateClassNamed:aClassNameStringOrSymbol
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1257
    ^ self privateClassesAt:aClassNameStringOrSymbol
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1258
!
0de3e736c091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10876
diff changeset
  1259
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1260
privateClasses
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1261
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1262
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1263
    "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
  1264
     The classes are in any order."
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1265
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1266
    ^ self privateClassesOrAll:false
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1267
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1268
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1269
     Object privateClasses
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1270
     ObjectMemory privateClasses
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1271
     UILayoutTool privateClasses
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1272
    "
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1273
3495
31ae10035c74 skip obsolete leftover private classes when enumerating.
Claus Gittinger <cg@exept.de>
parents: 3494
diff changeset
  1274
    "Modified: / 29.5.1998 / 23:23:18 / cg"
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1275
!
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  1276
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1277
privateClassesAt:aClassNameStringOrSymbol
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1278
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1279
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1280
    "return a private class if present; nil otherwise"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1281
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1282
    |myName nmSym|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1283
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1284
    myName := self name.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1285
    myName isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1286
        "/ no name - there cannot be a corresponding private class
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1287
        ^ nil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1288
    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1289
    nmSym := (myName , '::' , aClassNameStringOrSymbol) asSymbolIfInterned.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1290
    nmSym isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1291
        "/ no such symbol - there cannot be a corresponding private class
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1292
        ^ nil
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1293
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  1294
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1295
    ^ Smalltalk at:nmSym.
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1296
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1297
    "Modified: 26.6.1997 / 11:44:04 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1298
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1299
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1300
privateClassesAt:aClassNameStringOrSymbol put:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1301
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1302
2719
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1303
    "add a private class"
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1304
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1305
    self classVarAt:(':' , aClassNameStringOrSymbol) put:aClass
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1306
92fb0f7eac26 oops - bug introduced in #privateClassesAt:
Claus Gittinger <cg@exept.de>
parents: 2718
diff changeset
  1307
    "Modified: 26.6.1997 / 11:44:12 / cg"
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1308
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  1309
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1310
privateClassesOrAll:allOfThem
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1311
    "{ Pragma: +optSpace }"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1312
4495
4804e3e33d76 tuned #privateClasses access
Claus Gittinger <cg@exept.de>
parents: 4400
diff changeset
  1313
    "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
  1314
     or direct plus indirect private classes (if allOfThem).
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1315
     An empty collection if there are none.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1316
     The classes are in any order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1317
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1318
    |classes myName myNamePrefix myNamePrefixLen|
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1319
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1320
    myName := self name.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1321
    myNamePrefix := myName , '::'.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1322
    myNamePrefixLen := myNamePrefix size.
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1323
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
  1324
    Smalltalk keysDo:[:nm |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1325
        |cls|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1326
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1327
        (nm startsWith:myNamePrefix) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1328
            (allOfThem
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1329
            or:[(nm indexOf:$: startingAt:myNamePrefixLen + 1) == 0]) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1330
                cls := Smalltalk at:nm.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1331
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1332
                (cls isBehavior and:[cls isMeta not]) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1333
                    classes isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1334
                        classes := Set new:10.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1335
                    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1336
                    classes add:cls.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1337
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1338
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1339
        ]
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1340
    ].
4575
aa220bf73713 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4495
diff changeset
  1341
4578
705211312d94 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  1342
    ^ classes ? #()
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1343
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1344
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1345
     UILayoutTool privateClassesOrAll:true
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1346
     UILayoutTool privateClassesOrAll:false
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1347
    "
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1348
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1349
    "Modified: / 29.5.1998 / 23:23:18 / cg"
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1350
!
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1351
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1352
privateClassesSorted
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1353
    "{ Pragma: +optSpace }"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1354
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1355
    "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
  1356
     The classes are sorted by inheritance."
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1357
7894
b803fe91b1cb faster privateClassesSorted
Claus Gittinger <cg@exept.de>
parents: 7866
diff changeset
  1358
    |classes pivateClassesOf|
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1359
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1360
    classes := self privateClasses.
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  1361
    (classes size > 0) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1362
        classes := classes asOrderedCollection.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1363
        classes sort:[:a :b | a name < b name].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1364
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1365
        pivateClassesOf := IdentityDictionary new.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1366
        classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1367
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1368
        classes topologicalSort:[:a :b |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1369
            "/ a must come before b iff:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1370
            "/    b is a subclass of a
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1371
            "/    b has a private class which is a subclass of a
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1372
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1373
            |mustComeBefore pivateClassesOfB|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1374
            mustComeBefore := b isSubclassOf:a.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1375
            pivateClassesOfB := pivateClassesOf at:b.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1376
            pivateClassesOfB do:[:eachClassInB |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1377
                mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1378
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1379
            mustComeBefore
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1380
        ].
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1381
    ].
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1382
    ^ classes.
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1383
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1384
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1385
     Object privateClassesSorted
5731
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1386
     NewSystemBrowser privateClassesSorted
a223eb0cf0f9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5728
diff changeset
  1387
     NewSystemBrowser privateClasses
2484
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1388
    "
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1389
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1390
    "Created: 22.3.1997 / 16:10:42 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1391
    "Modified: 22.3.1997 / 16:11:20 / cg"
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1392
!
05bd2cc43192 #privateClasses now returns an unsorted set;
Claus Gittinger <cg@exept.de>
parents: 2482
diff changeset
  1393
9959
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1394
projectDefinition
12197
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1395
    <resource: #obsolete>
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1396
    "return the project definition of the classes package"
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1397
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1398
    self obsoleteMethodWarning.
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1399
    ^ self projectDefinitionClass
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1400
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1401
    "
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1402
     Object projectDefinition productVersion     
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1403
     DAPASX::DapasUI projectDefinition productVersion 
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1404
    "
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1405
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1406
    "Created: / 19-09-2006 / 22:02:06 / cg"
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1407
!
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1408
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1409
projectDefinitionClass
9959
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1410
    "return the project definition of the classes package"
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1411
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1412
    ^ ProjectDefinition definitionClassForPackage: self package
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1413
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1414
    "
12197
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1415
     Object projectDefinitionClass productVersion     
c48ecb09d4a0 projectDefinition -> projectDefinitionClass
Claus Gittinger <cg@exept.de>
parents: 12103
diff changeset
  1416
     DAPASX::DapasUI projectDefinitionClass productVersion 
9959
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1417
    "
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1418
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1419
    "Created: / 19-09-2006 / 22:02:06 / cg"
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1420
!
a01b70bfadcb +projectDefinition
Claus Gittinger <cg@exept.de>
parents: 9930
diff changeset
  1421
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1422
realSharedPoolNames
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1423
    "this returns the namespace aware pool names"
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1424
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1425
    |poolNames ns|
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1426
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1427
    poolNames := self sharedPoolNames.
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1428
    (ns := self topNameSpace) notNil ifTrue:[
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1429
        ^ poolNames 
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1430
                collect:[:nm | 
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1431
                    |p|
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1432
                    (p := ns at:nm) notNil ifTrue:[
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1433
                        p name
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1434
                    ] ifFalse:[
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1435
                        nm
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1436
                    ]].
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1437
    ].
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1438
    ^ poolNames 
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1439
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1440
    "
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1441
     Croquet::OpenGL sharedPools
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1442
     Croquet::OpenGL realSharedPools
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1443
    "
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1444
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1445
    "Created: / 18-01-2011 / 18:02:25 / cg"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1446
!
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1447
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1448
realSharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1449
    "this returns the namespace aware pools"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1450
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1451
    |ns|
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1452
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1453
    ns := self topNameSpace.
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1454
    ^ self sharedPoolNames collect:[:nm | ns at:nm]
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1455
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1456
    "
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1457
     Croquet::OpenGL sharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1458
     Croquet::OpenGL realSharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1459
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1460
     Win32OperatingSystem realSharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1461
     Win32OperatingSystem realSharedPoolNames
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1462
    "
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1463
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1464
    "Modified: / 18-01-2011 / 18:05:19 / cg"
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1465
!
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1466
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1467
removeClassVarName:aString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1468
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1469
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1470
    "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
  1471
     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
  1472
6731
630b8b5260cc refactored;
Claus Gittinger <cg@exept.de>
parents: 6723
diff changeset
  1473
    |names newNames|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1474
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1475
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1476
    (names includes:aString) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1477
        newNames := ''.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1478
        names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1479
        self classVariableString:newNames withoutSpaces.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1480
        Class withoutUpdatingChangesDo:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1481
            self withAllSubclasses do:[:cls|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1482
                cls recompileMethodsAccessingAnyClassvarOrGlobal:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1483
                                        (Array with:aString asSymbol)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1484
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1485
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1486
        self addChangeRecordForClass:self andNotifyChangeOf:#classVariables.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1487
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1488
3220
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1489
    "Created: / 29.10.1995 / 19:42:08 / cg"
923707e8d156 Recompile methods when changing classVars.
Stefan Vogel <sv@exept.de>
parents: 3180
diff changeset
  1490
    "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
  1491
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1492
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1493
setCategory:aStringOrSymbol
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1494
    "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
  1495
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1496
    aStringOrSymbol isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1497
        category := aStringOrSymbol
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1498
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1499
        category := aStringOrSymbol asSymbol
5723
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1500
    ]
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1501
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1502
    "Created: 1.4.1997 / 15:24:04 / stefan"
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1503
!
af77f8b753cb methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 5715
diff changeset
  1504
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1505
setClassFilename:aFilename
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1506
    "set the classes filename.
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1507
     This is a dangerous (low level) operation, 
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1508
     since the comment and primitiveSpecs may no longer be accessable, 
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1509
     if a wrong filename is set here."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1510
10141
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1511
"/ cg: somewhere, the filename is set from a temporary (checkout) files name.
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1512
"/ we MUST catch and FIX this.
10142
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1513
aFilename notNil ifTrue:[
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1514
    (aFilename asFilename baseName startsWith:'st') ifTrue:[
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1515
        (aFilename asFilename baseName at:3) isDigit ifTrue:[
11261
e8dcdce0b2ae changed #classMenuCompareTwoRepositoryVersions
Claus Gittinger <cg@exept.de>
parents: 11162
diff changeset
  1516
            self halt:'this should not be reached'
10142
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1517
        ].
10141
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1518
    ].
669ade985ad7 temporary hook/check for bad classFilename
Claus Gittinger <cg@exept.de>
parents: 10102
diff changeset
  1519
].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1520
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1521
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1522
    "Modified: / 08-09-1995 / 14:16:48 / claus"
10142
cd1ff466dcc9 changed #setClassFilename:
Claus Gittinger <cg@exept.de>
parents: 10141
diff changeset
  1523
    "Modified: / 25-10-2006 / 13:50:42 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1524
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1525
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1526
setClassVariableString:aString
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1527
    "set the classes classvarnames string.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1528
     This is a dangerous (low level) operation, since the
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1529
     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
  1530
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1531
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1532
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1533
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1534
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1535
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1536
    "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
  1537
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1538
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1539
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1540
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1541
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1542
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1543
    "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
  1544
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1545
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1546
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1547
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1548
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1549
    categoryStringOrSymbol isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1550
        cat := ''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1551
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1552
        cat := categoryStringOrSymbol
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1553
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1554
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1555
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1556
5248
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1557
setEnvironment:aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1558
    "set the namespace I am contained in; ST-80 compatible name"
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1559
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1560
    environment := aNamespace
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1561
!
1c577dbc3b1d accessor for environment
Claus Gittinger <cg@exept.de>
parents: 5235
diff changeset
  1562
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1563
setPackage:aSymbol
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1564
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1565
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1566
    package := aSymbol
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1567
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  1568
    "Modified: / 09-08-2006 / 17:59:13 / fm"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1569
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1570
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1571
sharedPoolNames
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1572
    "this returns a collection of the plain (non-namespace aware) pool names"
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1573
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1574
    |pools|
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1575
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1576
    pools := self getAttribute:#sharedPools.
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1577
    pools isNil ifTrue:[
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1578
        ^ #().
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1579
    ].
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1580
    pools isString ifTrue:[
11873
cbc08817ae5d use collect:as:
Claus Gittinger <cg@exept.de>
parents: 11866
diff changeset
  1581
        pools := pools asCollectionOfWords collect:[:varName| varName asSymbol] as:Array.
8561
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1582
        self setAttribute:#sharedPools to:pools.
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1583
    ].
6b9062af68c2 #sharedPools returns an empty collection if there are no pools.
Stefan Vogel <sv@exept.de>
parents: 8552
diff changeset
  1584
    ^ pools
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1585
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1586
    "
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1587
     Croquet::OpenGL sharedPools
10876
0c9be1a039aa comment
Claus Gittinger <cg@exept.de>
parents: 10843
diff changeset
  1588
     OpenGLRenderingContext sharedPools  
13188
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1589
     Character sharedPools    
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1590
     Win32OperatingSystem sharedPools    
10843
0ae979759230 pools of a class in a namespace
Claus Gittinger <cg@exept.de>
parents: 10474
diff changeset
  1591
    "
13188
8ec8b42f9aef added: #poolDictionaries
Claus Gittinger <cg@exept.de>
parents: 13106
diff changeset
  1592
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1593
    "Created: / 18-01-2011 / 17:55:42 / cg"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1594
!
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1595
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1596
sharedPoolNames:aStringOrCollection
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1597
    "{ Pragma: +optSpace }"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1598
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1599
    "set the sharedPools string (no change notifications)"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1600
13221
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  1601
    self setSharedPoolNames:aStringOrCollection.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1602
    self addChangeRecordForClass:self.
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1603
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1604
    "Created: / 18-01-2011 / 17:55:48 / cg"
13221
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  1605
    "Modified: / 18-01-2011 / 20:41:17 / cg"
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1606
!
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1607
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1608
sharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1609
    "this returns a collection of the plain (non-namespace aware) pool names.
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1610
     WARNING: this will soon cahnge to return the real pools (i.e. the PoolDictionaries)"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1611
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1612
    ^ self sharedPoolNames
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1613
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1614
    "
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1615
     Croquet::OpenGL sharedPools
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1616
     OpenGLRenderingContext sharedPools  
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1617
     Character sharedPools    
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1618
     Win32OperatingSystem sharedPools    
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1619
    "
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1620
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1621
    "Modified: / 18-01-2011 / 18:01:39 / cg"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1622
!
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1623
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1624
sharedPools:aStringOrCollection
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1625
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1626
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1627
    "set the sharedPools string (no change notifications).
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1628
     WARNING: this will soon cahnge to expect the real pools (i.e. the PoolDictionaries)"
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1629
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1630
    self sharedPoolNames:aStringOrCollection.
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1631
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  1632
    "Modified: / 18-01-2011 / 18:01:58 / cg"
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1633
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1634
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1635
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1636
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1637
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1638
    |code aStream tmpFilename|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1639
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1640
" this is too slow for big classes (due to the emphasis stored)...
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1641
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1642
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1643
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1644
"
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1645
    tmpFilename := Filename newTemporary.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  1646
    [
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1647
        aStream := tmpFilename newReadWriteStream.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1648
        aStream removeOnClose:true.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1649
    ] on:OpenError do:[:ex|
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1650
        self warn:'Class>>#source: cannot create temporary file: ', ex description.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1651
        ^ nil
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1652
    ].
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1653
    [
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1654
        FileOutErrorSignal handle:[:ex |
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1655
            aStream nextPut:$" ; nextPutAll:ex description; nextPut:$".
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1656
            FileOutErrorSignal isHandled ifTrue:[
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1657
                ex reject.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1658
            ].
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1659
        ] do:[
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1660
            self fileOutOn:aStream.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1661
        ].
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1662
        aStream reset.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1663
        code := aStream contents.
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1664
    ] ensure:[
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  1665
        aStream close.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1666
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1667
    ^ code
10050
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1668
ac9d34eeeaaa classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10042
diff changeset
  1669
    "Modified: / 06-10-2006 / 13:34:18 / cg"
385
claus
parents: 384
diff changeset
  1670
!
claus
parents: 384
diff changeset
  1671
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1672
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1673
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1674
     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
  1675
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1676
12308
3a782eca6cbc changed: #sourceCodeManager
fm
parents: 12303
diff changeset
  1677
    |owner|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1678
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  1679
    (owner := self owningClass) notNil ifTrue:[^ owner sourceCodeManager].
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1680
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1681
    "/ see if there is a package-specific manager
12308
3a782eca6cbc changed: #sourceCodeManager
fm
parents: 12303
diff changeset
  1682
    AbstractSourceCodeManager notNil ifTrue:[
3a782eca6cbc changed: #sourceCodeManager
fm
parents: 12303
diff changeset
  1683
        ^ AbstractSourceCodeManager sourceCodeManagerForPackage: package.
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1684
    ].
12308
3a782eca6cbc changed: #sourceCodeManager
fm
parents: 12303
diff changeset
  1685
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1686
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1687
10166
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1688
    "
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1689
     Array sourceCodeManager
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1690
     foo_p1 sourceCodeManager
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1691
    "
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1692
f21f2a190932 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10142
diff changeset
  1693
    "Created: / 07-12-1995 / 13:16:46 / cg"
10220
7332b36bc81e avoid need for libbasic3 (due to packageID reference)
Claus Gittinger <cg@exept.de>
parents: 10195
diff changeset
  1694
    "Modified: / 05-12-2006 / 22:04:26 / cg"
12857
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1695
!
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1696
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1697
subclasses
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1698
    "return a collection of the direct subclasses of the receiver"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1699
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1700
    "/ use cached information (avoid class hierarchy search), if possible
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1701
    subclasses isNil ifTrue:[
12906
0e9de9119933 changed: #subclasses
Stefan Vogel <sv@exept.de>
parents: 12904
diff changeset
  1702
        self updateAllCachedSubclasses.
0e9de9119933 changed: #subclasses
Stefan Vogel <sv@exept.de>
parents: 12904
diff changeset
  1703
        "subclasses may still be nil - obsolete classes may not be updated"
13374
201a2a38899f comment/format in: #subclasses
Claus Gittinger <cg@exept.de>
parents: 13369
diff changeset
  1704
        ^ subclasses ? #().
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1705
    ].
12906
0e9de9119933 changed: #subclasses
Stefan Vogel <sv@exept.de>
parents: 12904
diff changeset
  1706
    ^ subclasses.
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1707
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1708
    "
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1709
     Class flushSubclassInfo.
12906
0e9de9119933 changed: #subclasses
Stefan Vogel <sv@exept.de>
parents: 12904
diff changeset
  1710
     Class subclasses.
0e9de9119933 changed: #subclasses
Stefan Vogel <sv@exept.de>
parents: 12904
diff changeset
  1711
     SmallInteger subclasses
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1712
    "
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1713
13374
201a2a38899f comment/format in: #subclasses
Claus Gittinger <cg@exept.de>
parents: 13369
diff changeset
  1714
    "Modified: / 23-05-2011 / 17:33:43 / cg"
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1715
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1716
12857
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1717
superclass:aClass
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1718
    "set the superclass - this actually creates a new class,
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1719
     recompiling all methods for the new one. The receiving class stays
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1720
     around anonymously to allow existing instances some life.
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1721
     This may change in the future (adjusting existing instances)"
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1722
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1723
    |owner ns name|
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1724
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1725
    "must flush caches since lookup chain changes"
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1726
    ObjectMemory flushCaches.
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1727
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1728
    "/ for correct recompilation, just create a new class ...
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1729
    "/ but care to avoid a nameSpace change, by giving my
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1730
    "/ full name and answering with Smalltalk to a nameSpace query.
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1731
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1732
    (owner := self owningClass) notNil ifTrue:[
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1733
        ns := owner.
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1734
        name := self nameWithoutPrefix asSymbol
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1735
    ] ifFalse:[
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1736
        ns := Smalltalk.
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1737
        name := self name
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1738
    ].
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1739
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1740
    Class classRedefinitionNotification answer:#keep do:[
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1741
        Class nameSpaceQuerySignal 
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1742
            answer:ns
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1743
            do:[
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1744
                aClass
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1745
                    perform:(self definitionSelector)
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1746
                    withArguments:(Array with:name
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1747
                                   with:(self instanceVariableString)
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1748
                                   with:(self classVariableString)
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1749
                                   with:'' "/ pool
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1750
                                   with:(self category)).
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1751
            ]
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1752
    ]
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1753
2a99557cf850 moved: #superclass: from behavior.
Claus Gittinger <cg@exept.de>
parents: 12840
diff changeset
  1754
    "Modified: / 20.6.1998 / 18:17:37 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1755
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1756
5257
a90fd9cb3c18 category rename
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
  1757
!Class methodsFor:'adding & removing'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1758
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1759
removeFromSystem
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1760
    "ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1761
     remove myself from the system"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1762
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1763
    Smalltalk removeClass:self.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1764
    Smalltalk removeKey:name.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1765
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1766
    "Created: 6.2.1996 / 11:32:58 / stefan"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1767
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  1768
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1769
unload
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1770
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1771
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1772
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1773
     autoloaded. Can be used to get rid of no longer needed autoloaded
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1774
     classes.
328
claus
parents: 326
diff changeset
  1775
     (maybe, autoloaded classes should unload themselfes when no
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1776
      longer needed - for example, after some delay when the last instance
328
claus
parents: 326
diff changeset
  1777
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1778
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1779
    |nm newClass privateClasses|
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1780
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1781
    self wasAutoloaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1782
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1783
         can it be done ?
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1784
         (all of my methods must have a source)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1785
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1786
        self instAndClassSelectorsAndMethodsDo:[:sel :aMethod |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1787
            aMethod source isNil ifTrue:[^false].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1788
            aMethod hasPrimitiveCode ifTrue:[^ false].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1789
        ].
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1790
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1791
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1792
    "/ cannot unload, if non-autoloaded subclasses exist ...
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1793
    self allSubclassesDo:[:eachSubclass |
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1794
        eachSubclass wasAutoloaded ifFalse:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1795
            eachSubclass isPrivate ifFalse:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1796
                self warn:('cannot unload ' , self name , ' (' , eachSubclass name , ' requires it)').
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1797
                ^ false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1798
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1799
        ]
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1800
    ].
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1801
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1802
    self allSubclassesDo:[:eachSubclass |
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1803
        eachSubclass wasAutoloaded ifTrue:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1804
            eachSubclass unload
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1805
        ] ifFalse:[
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1806
            eachSubclass removeFromSystem.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1807
        ]
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1808
    ].
9371
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1809
    privateClasses := self privateClasses.
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1810
    privateClasses notEmpty ifTrue:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1811
        self withoutUpdatingChangesDo:[
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1812
            privateClasses do:[:eachPrivateClass |
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1813
                eachPrivateClass removeFromSystem.
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1814
            ].
ebe6d3c65ade Do not add change records for removed private classes
Stefan Vogel <sv@exept.de>
parents: 9178
diff changeset
  1815
        ].
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1816
    ].
1415
dba8d922811c showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  1817
    Transcript showCR:'unloading ' , name , ' ...'.
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1818
5474
c7c69123fd48 care for subclasses and private classes when unloading
Claus Gittinger <cg@exept.de>
parents: 5464
diff changeset
  1819
    "/ reinstall as autoloaded
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  1820
    Autoload removeClass:self.
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1821
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1822
    Smalltalk at:nm put:nil.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1823
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1824
    ObjectMemory flushMethodCache.
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1825
    newClass := Autoload addClass:nm inCategory:category.
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1826
    newClass notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1827
        newClass package:package
4052
7b126a2f20ee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4041
diff changeset
  1828
    ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1829
    Smalltalk flushCachedClasses.
12701
9ceabe94c8e1 changed: #unload
Claus Gittinger <cg@exept.de>
parents: 12694
diff changeset
  1830
    Class flushSubclassInfoFor:self.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1831
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1832
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1833
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1834
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1835
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1836
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1837
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1838
    "
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  1839
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1439
diff changeset
  1840
    "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
  1841
    "Modified: 4.6.1997 / 14:48:02 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1842
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1843
13369
62969d3810b9 changed: #localSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 13342
diff changeset
  1844
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1845
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1846
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1847
addChangeRecordForChangeCategory
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1848
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1849
6097
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1850
    "add a category change"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1851
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1852
    Class updateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1853
        self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
6097
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1854
    ].
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1855
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1856
    "this test allows a smalltalk without Projects/ChangeSets"
276766efb318 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6077
diff changeset
  1857
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1858
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1859
            Project addClassDefinitionChangeFor:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1860
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1861
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1862
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1863
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1864
addChangeRecordForClass:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1865
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1866
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1867
    "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
  1868
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1869
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1870
        self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1871
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1872
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1873
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1874
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1875
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1876
            Project addClassDefinitionChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1877
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1878
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1879
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1880
    "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
  1881
    "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
  1882
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1883
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1884
addChangeRecordForClassCheckIn:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1885
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1886
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1887
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1888
12052
7aabd3b316a6 changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents: 12044
diff changeset
  1889
    |rv pkg|
1938
e1a56370a833 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
  1890
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1891
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1892
        rv := aClass revision.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1893
        rv isNil ifTrue:[rv := '???'].
12052
7aabd3b316a6 changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents: 12044
diff changeset
  1894
        pkg := aClass package.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1895
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1896
        self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1897
            writingChangeWithTimeStamp:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1898
            perform:#addInfoRecord:to:
12052
7aabd3b316a6 changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents: 12044
diff changeset
  1899
            with:('checkin %1 into %2 (%3)' 
7aabd3b316a6 changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents: 12044
diff changeset
  1900
                    bindWith:aClass name 
7aabd3b316a6 changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents: 12044
diff changeset
  1901
                    with:pkg
7aabd3b316a6 changed: #addChangeRecordForClassCheckIn:
Claus Gittinger <cg@exept.de>
parents: 12044
diff changeset
  1902
                    with:rv).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1903
    ]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1904
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1905
    "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
  1906
    "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
  1907
    "Modified: / 18.3.1999 / 18:14:14 / stefan"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1908
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1909
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1910
addChangeRecordForClassComment:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1911
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1912
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1913
    "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
  1914
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1915
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1916
        self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1917
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1918
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1919
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1920
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1921
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1922
            Project addClassCommentChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1923
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1924
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1925
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1926
    "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
  1927
    "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
  1928
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1929
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1930
addChangeRecordForClassContainerRemove:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1931
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1932
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1933
    "append a container-was-removed-record to the changes file"
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1934
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1935
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1936
        self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1937
            writingChangeWithTimeStamp:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1938
            perform:#addInfoRecord:to:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1939
            with:('removed source container of ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1940
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1941
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1942
    "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
  1943
    "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
  1944
    "Modified: / 18.3.1999 / 18:14:31 / stefan"
1658
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1945
!
5b68e6cd567a added removeContainer changeLog entry.
Claus Gittinger <cg@exept.de>
parents: 1651
diff changeset
  1946
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1947
addChangeRecordForClassFileOut:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1948
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1949
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1950
    "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
  1951
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1952
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1953
        self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1954
            writingChangeWithTimeStamp:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1955
            perform:#addInfoRecord:to:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1956
            with:('fileOut ' , aClass name).
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1957
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1958
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1959
    "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
  1960
    "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
  1961
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1962
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1963
addChangeRecordForClassInstvars:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1964
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  1965
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1966
    "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
  1967
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1968
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1969
        self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1970
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1971
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1972
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  1973
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1974
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1975
            Project addInstVarDefinitionChangeFor:aClass class
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1976
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1977
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  1978
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  1979
    "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
  1980
    "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
  1981
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1982
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1983
addChangeRecordForClassRemove
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1984
    "{ Pragma: +optSpace }"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1985
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1986
    "add a class-remove-record to the changes file"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1987
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1988
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1989
        self writingChangePerform:#addChangeRecordForClassRemove:to: with:self.
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1990
    ].
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1991
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1992
    "this test allows a smalltalk without Projects/ChangeSets"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1993
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1994
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1995
            Project addClassRemoveChange:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  1996
        ]
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1997
    ]
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1998
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  1999
    "Modified: / 24.1.1997 / 19:10:25 / cg"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2000
    "Modified: / 18.3.1999 / 18:14:53 / stefan"
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2001
!
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  2002
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2003
addChangeRecordForClassRemove:oldClassName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2004
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2005
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2006
    "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
  2007
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2008
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2009
        self writingChangePerform:#addChangeRecordForClassRemove:to: with:self.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2010
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2011
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2012
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2013
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2014
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2015
            Project addClassRemoveChange:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2016
        ]
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2017
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2018
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2019
    "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
  2020
    "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
  2021
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2022
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2023
addChangeRecordForClassRename:oldName to:newName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2024
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2025
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2026
    "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
  2027
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2028
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2029
        self writingChangeDo:[:aStream |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2030
            self addChangeRecordForClassRename:oldName to:newName to:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2031
        ]
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2032
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2033
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2034
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2035
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2036
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2037
            Project addClassRenameChangeFrom:oldName to:newName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2038
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2039
    ]
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  2040
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2041
    "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
  2042
    "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
  2043
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2044
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2045
addChangeRecordForPrimitiveDefinitions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2046
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2047
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2048
    "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
  2049
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2050
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2051
        self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2052
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2053
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2054
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2055
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2056
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2057
            Project addPrimitiveDefinitionsChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2058
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  2059
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2060
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2061
    "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
  2062
    "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
  2063
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2064
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2065
addChangeRecordForPrimitiveFunctions:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2066
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2067
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2068
    "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
  2069
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2070
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2071
        self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2072
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2073
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2074
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2075
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2076
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2077
            Project addPrimitiveFunctionsChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2078
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  2079
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2080
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2081
    "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
  2082
    "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
  2083
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2084
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2085
addChangeRecordForPrimitiveVariables:aClass
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2086
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2087
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2088
    "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
  2089
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2090
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2091
        self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2092
    ].
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2093
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2094
    "this test allows a smalltalk without Projects/ChangeSets"
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2095
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2096
        UpdateChangeListQuerySignal query ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2097
            Project addPrimitiveVariablesChangeFor:aClass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2098
        ]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  2099
    ]
2206
6c8b4d9bf4b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2100
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2101
    "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
  2102
    "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
  2103
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2104
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2105
addChangeRecordForSnapshot:aFileName
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2106
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2107
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2108
    "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
  2109
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2110
    UpdateChangeFileQuerySignal query ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2111
        self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2112
            writingChangeWithTimeStamp:false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2113
            perform:#addChangeRecordForSnapshot:to:
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2114
            with:aFileName.
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2115
    ]
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2116
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2117
    "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
  2118
    "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
  2119
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2120
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2121
addChangeRecordForSnapshot:aFileName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2122
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  2123
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2124
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2125
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  2126
    self addInfoRecord:('snapshot ' , aFileName) to:aStream
2256
ffd565c6e084 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2245
diff changeset
  2127
4055
599e73eed11f Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 4052
diff changeset
  2128
    "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
  2129
    "Modified: / 18.3.1999 / 18:15:30 / stefan"
2917
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  2130
! !
bc0f5c056722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
  2131
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2132
!Class methodsFor:'enumerating'!
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2133
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  2134
allPrivateClassesDo:aBlock
4400
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2135
    "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
  2136
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2137
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2138
    self allPrivateClasses do:aBlock
3997
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  2139
!
2d127c83b65d +#allPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 3953
diff changeset
  2140
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2141
privateClassesDo:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2142
    "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
  2143
     Evaluation is in no particular order."
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2144
e6eda296bb31 common code for privateClasses and allPrivateClasses
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2145
    self privateClasses do:aBlock
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2146
!
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2147
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2148
subclassesDo:aBlock
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2149
    "evaluate the argument, aBlock for all immediate subclasses.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2150
     This will only enumerate globally known classes - for anonymous
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2151
     behaviors, you have to walk over all instances of Behavior."
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2152
12859
f973aadfb3d2 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 12857
diff changeset
  2153
    "/ use cached information (avoid class hierarchy search), if possible
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  2154
    subclasses isNil ifTrue:[
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
  2155
        self updateAllCachedSubclasses.
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
  2156
        subclasses isNil ifTrue:[subclasses := #()].
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2157
    ].
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  2158
    subclasses do:aBlock
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2159
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2160
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2161
     Collection subclassesDo:[:c | Transcript showCR:(c name)]
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2162
    "
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2163
13093
de4acf67900a changed: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12906
diff changeset
  2164
    "Modified: / 13-10-2010 / 12:39:13 / cg"
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2165
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  2166
5715
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2167
withAllPrivateClassesDo:aBlock
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2168
    "evaluate aBlock on myself and all of my private classes (if any).
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2169
     This recurses into private classes of private classes.
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2170
     Evaluation is in no particular order."
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2171
f69c58deb07e added #withAllPrivateClassesDo:
Claus Gittinger <cg@exept.de>
parents: 5707
diff changeset
  2172
    aBlock value:self.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2173
    self allPrivateClasses do:aBlock
1824
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2174
! !
71889773b28b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1817
diff changeset
  2175
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2176
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2177
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2178
primitiveDefinitions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2179
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2180
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2181
     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
  2182
     unprocessed contents in the classes primitiveDefinitions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2183
     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
  2184
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2185
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2186
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2187
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2188
    "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
  2189
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2190
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2191
primitiveFunctions
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2192
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2193
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2194
     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
  2195
     unprocessed contents in the classes primitiveFunctions section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2196
     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
  2197
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2198
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2199
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2200
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2201
    "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
  2202
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2203
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2204
primitiveVariables
958
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2205
    "this method allows fileIn of classes with primitive code.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2206
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2207
     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
  2208
     unprocessed contents in the classes primitiveVariables section.
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2209
     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
  2210
     editable and especially: not lost when filing out the class."
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2211
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2212
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables:
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2213
50ae31c8deca commentary & correctly handling ignoredMethods
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  2214
    "Modified: 10.2.1996 / 12:47:28 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2215
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2216
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2217
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2218
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2219
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2220
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  2221
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2222
    self
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2223
        basicFileOutDefinitionOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2224
        withNameSpace:forceNameSpace
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2225
        withPackage:true
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2226
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2227
!
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2228
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2229
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage
5344
90ff886b8085 separate interface to generate classDef with/without package info
Claus Gittinger <cg@exept.de>
parents: 5340
diff changeset
  2230
    "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
  2231
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2232
    self class
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2233
        basicFileOutDefinitionOf:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2234
        on:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2235
        withNameSpace:forceNameSpace withPackage:showPackage
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2236
!
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2237
8716
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2238
basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace withPackage:showPackage syntaxHilighting:syntaxHilighting
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2239
    "append an expression on aStream, which defines myself."
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2240
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2241
    self class
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2242
        basicFileOutDefinitionOf:self
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2243
        on:aStream
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2244
        withNameSpace:forceNameSpace 
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2245
        withPackage:showPackage
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2246
        syntaxHilighting:syntaxHilighting
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2247
!
9fe96eaed619 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  2248
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2249
basicFileOutInstvarTypeKeywordOn:aStream
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2250
    "a helper for fileOutDefinition"
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2251
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2252
    |isVar superclass|
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2253
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  2254
    superclass := self superclass.
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2255
    superclass isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2256
        isVar := self isVariable
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2257
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2258
        "I cant remember what this is for ?"
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2259
        isVar := (self isVariable and:[superclass isVariable not])
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2260
    ].
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2261
3920
0c1b9b2fa23b added longlong indexed instvars;
Claus Gittinger <cg@exept.de>
parents: 3788
diff changeset
  2262
    aStream nextPutAll:(self firstDefinitionSelectorPart).
1707
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2263
cdd8c765c06e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1699
diff changeset
  2264
    "Created: 11.10.1996 / 18:57:29 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2265
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2266
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2267
fileOut
894
138c21732ab9 more on binary class storage (sourceMode argument)
Claus Gittinger <cg@exept.de>
parents: 892
diff changeset
  2268
    "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
  2269
     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
  2270
     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
  2271
     directory. Care is taken, to not clobber any existing file in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2272
     case of errors (for example: disk full).
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2273
     Also, since the classes methods need a valid sourcefile, the current
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2274
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2275
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2276
    |dirName nm fileName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2277
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2278
    nm := (Smalltalk fileNameForClass:self name),'.st'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2279
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  2280
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2281
     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
  2282
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2283
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2284
        dirName := Project currentProjectDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2285
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2286
        dirName := Filename currentDirectory
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2287
    ].
3788
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2288
    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
  2289
    fileName makeLegalFilename.
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2290
ea7d4f4a2ba6 convert fileName to a legal name in fileOut / binaryFileOut (for win32)
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  2291
    self fileOutAs:fileName name.
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2292
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2293
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2294
"/     add a change record; that way, administration is much easier,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2295
"/     since we can see in that changeBrowser, which changes have
2771
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2296
"/     already found their way into a sourceFile and which must be
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2297
"/     applied again
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2298
"/    "
c5b18e2e7e26 only one changeRecord when filing out
ca
parents: 2719
diff changeset
  2299
"/    self addChangeRecordForClassFileOut:self
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2300
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2301
    "Modified: / 07-06-1996 / 09:14:43 / stefan"
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2302
    "Modified: / 06-10-2006 / 16:16:19 / cg"
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2303
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2304
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2305
fileOutAllMethodsOn:aStream
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2306
    self fileOutAllMethodsOn:aStream methodFilter:nil
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2307
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2308
    "Created: 15.10.1996 / 11:13:00 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2309
    "Modified: 22.3.1997 / 16:12:17 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2310
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2311
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2312
fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2313
    |collectionOfCategories|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2314
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2315
    collectionOfCategories := self class categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2316
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2317
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2318
            self class fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2319
            aStream cr
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2320
        ]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2321
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2322
    collectionOfCategories := self categories asSortedCollection.
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2323
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2324
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2325
            self fileOutCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2326
            aStream cr
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2327
        ]
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2328
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2329
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2330
    self privateClassesSorted do:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2331
        aClass fileOutAllMethodsOn:aStream methodFilter:methodFilter
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2332
    ].
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2333
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2334
    "Created: 15.10.1996 / 11:13:00 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2335
    "Modified: 22.3.1997 / 16:12:17 / cg"
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2336
!
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2337
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2338
fileOutAs:fileNameString
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2339
    "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
  2340
     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
  2341
     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
  2342
     Care is taken, to not clobber any existing file in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2343
     case of errors (for example: disk full).
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2344
     Also, since the classes methods need a valid sourcefile, the current
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2345
     sourceFile may not be rewritten."
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2346
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2347
    |aStream fileName newFileName savFilename needRename
2553
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2348
     mySourceFileName sameFile s mySourceFileID anySourceRef|
4993919699a3 separated #fileOut into an extra #fileOutAs:;
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  2349
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2350
    self isLoaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2351
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2352
            raiseRequestWith:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2353
                 errorString:' - will not fileOut unloaded class: ', self name
3750
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2354
    ].
d544994a1c3e in fileOut: raise error for unloaded classes BEFORE
Claus Gittinger <cg@exept.de>
parents: 3702
diff changeset
  2355
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2356
    fileName := fileNameString asFilename.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2357
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2358
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2359
     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
  2360
     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
  2361
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2362
    "
1116
a3c136969f7c got rid of some asFilename messages
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  2363
    (fileName exists) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2364
        sameFile := false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2365
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2366
        "/ check carefully - maybe, my source does not really come from that
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2367
        "/ file (i.e. all of my methods have their source as string)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2368
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2369
        anySourceRef := false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2370
        self instAndClassMethodsDo:[:m |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2371
            m sourcePosition notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2372
                anySourceRef := true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2373
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2374
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2375
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2376
        anySourceRef ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2377
            s := self sourceStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2378
            s notNil ifTrue:[
10035
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2379
                OperatingSystem isUNIXlike ifTrue:[
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2380
                    mySourceFileID := s pathName asFilename info id.
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2381
                    sameFile := (fileName info id) == mySourceFileID.
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2382
                ] ifFalse:[
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2383
                    mySourceFileID := s pathName asFilename asAbsoluteFilename.
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2384
                    sameFile := (fileName asFilename asAbsoluteFilename) = mySourceFileID.
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2385
                ].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2386
                s close.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2387
            ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2388
                classFilename notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2389
                    "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2390
                     check for overwriting my current source file
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2391
                     this is not allowed, since it would clobber my methods source
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2392
                     file ... you have to save it to some other place.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2393
                     This happens if you ask for a fileOut into the source-directory
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2394
                     (from which my methods get their source)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2395
                    "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2396
                    mySourceFileName := Smalltalk getSourceFileName:classFilename.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2397
                    sameFile := (fileNameString = mySourceFileName).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2398
                    sameFile ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2399
                        mySourceFileName notNil ifTrue:[
10035
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2400
                            OperatingSystem isUNIXlike ifTrue:[
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2401
                                sameFile := (fileName info id) == (mySourceFileName asFilename info id)
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2402
                            ]
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2403
                        ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2404
                    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2405
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2406
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2407
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2408
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2409
        sameFile ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2410
            ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2411
                raiseRequestWith:fileNameString
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2412
                errorString:(' - may not overwrite sourcefile:', fileNameString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2413
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2414
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2415
        savFilename := Filename newTemporary.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2416
        fileName copyTo:savFilename.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2417
        newFileName := fileName withSuffix:'new'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2418
        needRename := true
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2419
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2420
        "/ another possible trap: if my sourceFileName is
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2421
        "/ the same as the written one AND the new files directory
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2422
        "/ is along the sourcePath, we also need a temporary file
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2423
        "/ first, to avoid accessing the newly written file.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2424
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2425
        anySourceRef := false.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2426
        self instAndClassMethodsDo:[:m |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2427
            |mSrc|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2428
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2429
            (mSrc := m sourceFilename) notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2430
                mSrc asFilename baseName = fileName baseName ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2431
                    anySourceRef := true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2432
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2433
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2434
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2435
        anySourceRef ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2436
            newFileName := fileName withSuffix:'new'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2437
            needRename := true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2438
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2439
            newFileName := fileName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2440
            needRename := false
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2441
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2442
    ].
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2443
    [
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2444
        aStream := newFileName writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2445
    ] on:FileStream openErrorSignal do:[:ex|
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2446
        savFilename notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2447
            savFilename delete
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2448
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2449
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2450
                raiseRequestWith:newFileName name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2451
                errorString:(' - cannot create file:', newFileName name)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2452
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2453
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2454
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2455
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2456
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2457
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2458
     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
  2459
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2460
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2461
    needRename ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2462
        newFileName copyTo:fileName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2463
        newFileName delete
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2464
    ].
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  2465
    savFilename notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2466
        savFilename delete
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2467
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2468
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2469
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2470
     add a change record; that way, administration is much easier,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2471
     since we can see in that changeBrowser, which changes have
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2472
     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
  2473
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2474
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2475
    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
  2476
10035
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2477
    "Modified: / 07-06-1996 / 09:14:43 / stefan"
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2478
    "Created: / 16-04-1997 / 20:44:05 / cg"
f1408385efac samefile (in fileOut) detection fixed for
Claus Gittinger <cg@exept.de>
parents: 10033
diff changeset
  2479
    "Modified: / 04-10-2006 / 17:26:23 / cg"
1753
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2480
!
fc2ff98b99f7 fixed fileOut of sub-sub private classes
Claus Gittinger <cg@exept.de>
parents: 1748
diff changeset
  2481
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2482
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2483
    "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
  2484
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  2485
    self class
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2486
        fileOutClassInstVarDefinitionOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2487
        withNameSpace:false
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2488
!
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2489
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2490
fileOutClassInstVarDefinitionOn:aStream withNameSpace:withNameSpace
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2491
    "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
  2492
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2493
    |anySuperClassInstVar|
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2494
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2495
    self isLoaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2496
        ^ self basicFileOutDefinitionOn:aStream withNameSpace:withNameSpace
5296
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2497
    ].
12a5de62fef7 class-instvar definition if unloaded
Claus Gittinger <cg@exept.de>
parents: 5257
diff changeset
  2498
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2499
    withNameSpace ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2500
        self name printOn:aStream.
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2501
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2502
        self printClassNameOn:aStream.
4375
857f5ac00d2b oops - fileout of class-instvars ignored namespace
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  2503
    ].
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2504
    aStream nextPutAll:' class instanceVariableNames:'''.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2505
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2506
    aStream nextPutAll:''''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2507
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2508
    "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
  2509
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2510
    anySuperClassInstVar := false.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2511
    self allSuperclassesDo:[:aSuperClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2512
        aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true].
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2513
    ].
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2514
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2515
    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
  2516
    anySuperClassInstVar ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2517
        aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2518
            nextPutLine:'No other class instance variables are inherited by this class.'.
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2519
    ] ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2520
        aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2521
            nextPutLine:'The following class instance variables are inherited by this class:'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2522
        aStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2523
        self allSuperclassesDo:[:aSuperClass |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2524
            aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2525
            aStream nextPutLine:(aSuperClass class instanceVariableString).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2526
        ].
5235
e21657631d7a definition string better if no classInstVars are inherited.
Claus Gittinger <cg@exept.de>
parents: 5225
diff changeset
  2527
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2528
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2529
    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
  2530
3338
0423dac35a45 dont prepend namespace in classes instanceVariableName decl.
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  2531
    "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
  2532
    "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
  2533
    "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
  2534
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2535
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2536
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2537
    "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
  2538
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2539
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2540
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2541
    self printClassNameOn:aStream.
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2542
    aStream nextPutAll:' comment:'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2543
    (comment := self comment) isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2544
        s := ''''''
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2545
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2546
        s := comment storeString
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2547
    ].
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2548
    aStream nextPutAllAsChunk:s.
1063
b45a722a10c3 oops - forgot excla after comment-chunk
Claus Gittinger <cg@exept.de>
parents: 989
diff changeset
  2549
    aStream nextPutChunkSeparator.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2550
    aStream cr
988
b17239b51874 double exclas in comment (when filing out)
Claus Gittinger <cg@exept.de>
parents: 986
diff changeset
  2551
2011
9a382deb44d7 suppress nameSpace prefix when filing out
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2552
    "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
  2553
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2554
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2555
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2556
    "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
  2557
2059
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2558
    ^ 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
  2559
c58962259667 care for definition message of private classes within a nameSpace
Claus Gittinger <cg@exept.de>
parents: 2049
diff changeset
  2560
    "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
  2561
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2562
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2563
fileOutIn:aDirectoryName
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2564
    "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
  2565
     directory aDirectoryName (ignoring any directory setting in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2566
     the current project).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2567
     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
  2568
12297
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2569
    ^ self fileOutIn:aDirectoryName withTimeStamp:true
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2570
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2571
    "
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2572
        self fileOutIn:'/tmp'
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2573
        self fileOutIn:'/tmp/doesNotExistBla'
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2574
        self fileOutIn:'/tmp' asFilename
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2575
    "
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2576
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2577
    "Modified: / 19-09-1997 / 00:03:53 / stefan"
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2578
    "Modified: / 06-10-2006 / 16:16:13 / cg"
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2579
!
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2580
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2581
fileOutIn:aDirectoryName withTimeStamp:withTimeStamp
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2582
    "create a file 'class.st' consisting of all methods in self in
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2583
     directory aDirectoryName (ignoring any directory setting in
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2584
     the current project).
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2585
     This is not logged in that change file (should it be ?)."
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2586
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2587
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2588
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2589
    fileName := (Smalltalk fileNameForClass:self name),'.st'.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2590
    [
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2591
        aStream := (aDirectoryName asFilename construct:fileName) writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2592
    ] on:FileStream openErrorSignal do:[:ex|
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2593
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2594
                raiseRequestWith:fileName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2595
                errorString:(' - cannot create file:', fileName)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2596
    ].
12297
31d62fae7c8d added: #fileOutIn:withTimeStamp:
Claus Gittinger <cg@exept.de>
parents: 12259
diff changeset
  2597
    self fileOutOn:aStream withTimeStamp:withTimeStamp.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2598
    aStream close
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2599
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2600
    "
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2601
        self fileOutIn:'/tmp'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2602
        self fileOutIn:'/tmp/doesNotExistBla'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2603
        self fileOutIn:'/tmp' asFilename
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2604
    "
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  2605
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2606
    "Modified: / 19-09-1997 / 00:03:53 / stefan"
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2607
    "Modified: / 06-10-2006 / 16:16:13 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2608
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2609
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2610
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2611
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2612
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2613
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2614
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2615
    "Created: 15.11.1995 / 12:53:32 / cg"
2046
e3522807960f more *withoutPrefix stuff.
Claus Gittinger <cg@exept.de>
parents: 2041
diff changeset
  2616
    "Modified: 3.1.1997 / 17:50:28 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2617
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2618
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2619
fileOutOn:aStream withTimeStamp:stampIt
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2620
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2621
     If stampIt is true, a timeStamp comment is prepended."
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2622
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2623
    self fileOutOn:aStream withTimeStamp:stampIt withInitialize:true
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2624
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2625
    "Modified: / 13.3.1998 / 12:23:02 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2626
!
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2627
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2628
fileOutOn:aStream withTimeStamp:stampIt withInitialize:initIt
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2629
    "file out my definition and all methods onto aStream.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2630
     If stampIt is true, a timeStamp comment is prepended.
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2631
     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
  2632
     append a corresponding doIt expression for initialization."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2633
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2634
    self
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2635
        fileOutOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2636
        withTimeStamp:stampIt
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2637
        withInitialize:initIt
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2638
        withDefinition:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2639
        methodFilter:nil
4733
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2640
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2641
    "Created: / 15.11.1995 / 12:53:06 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2642
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2643
    "Modified: / 13.3.1998 / 12:23:59 / cg"
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2644
!
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2645
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2646
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
  2647
    "file out my definition and all methods onto aStream.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2648
     If stampIt is true, a timeStamp comment is prepended.
c0f5ef2bac18 additional protocol for selective fileout
Claus Gittinger <cg@exept.de>
parents: 4667
diff changeset
  2649
     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
  2650
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2651
     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
  2652
     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
  2653
8212
791fe3ab2089 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8208
diff changeset
  2654
    |encoder any16Bit|
8164
db7a658c7bfc fileout in utf8-format
ca
parents: 8149
diff changeset
  2655
11699
36f3cff10f30 code cleanup
Claus Gittinger <cg@exept.de>
parents: 11536
diff changeset
  2656
    any16Bit := self instAndClassMethods 
36f3cff10f30 code cleanup
Claus Gittinger <cg@exept.de>
parents: 11536
diff changeset
  2657
                    contains:[:m |
36f3cff10f30 code cleanup
Claus Gittinger <cg@exept.de>
parents: 11536
diff changeset
  2658
                        |src|
36f3cff10f30 code cleanup
Claus Gittinger <cg@exept.de>
parents: 11536
diff changeset
  2659
36f3cff10f30 code cleanup
Claus Gittinger <cg@exept.de>
parents: 11536
diff changeset
  2660
                        src := m source ? ''.
36f3cff10f30 code cleanup
Claus Gittinger <cg@exept.de>
parents: 11536
diff changeset
  2661
                        (src contains:[:ch | ch codePoint > 16rFF])
36f3cff10f30 code cleanup
Claus Gittinger <cg@exept.de>
parents: 11536
diff changeset
  2662
                    ].
36f3cff10f30 code cleanup
Claus Gittinger <cg@exept.de>
parents: 11536
diff changeset
  2663
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2664
    any16Bit ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2665
        encoder := CharacterEncoder encoderForUTF8.
8075
819735e0ca47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8072
diff changeset
  2666
    ].
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2667
    ^ self
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2668
        fileOutOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2669
        withTimeStamp:stampIt
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2670
        withInitialize:initIt
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2671
        withDefinition:withDefinition
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2672
        methodFilter:methodFilter
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2673
        encoder:encoder
8051
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2674
!
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2675
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2676
fileOutOn:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2677
    "file out my definition and all methods onto aStream.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2678
     If stampIt is true, a timeStamp comment is prepended.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2679
     If initIt is true, and the class implements a class-initialize method,
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2680
     append a corresponding doIt expression for initialization.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2681
     The order by which the fileOut is done is used to put the version string at the end.
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2682
     Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move"
510f2dd4b771 use utf8 encoding when filing out a class.
Claus Gittinger <cg@exept.de>
parents: 7894
diff changeset
  2683
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  2684
    self class
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2685
        fileOutOn:outStreamArg
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2686
        withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2687
        methodFilter:methodFilter encoder:encoderOrNil
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  2688
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2689
3339
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2690
    "Created: / 15.11.1995 / 12:53:06 / cg"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2691
    "Modified: / 1.4.1997 / 16:01:05 / stefan"
6864210a1c27 added #fileOutOn:withTimeStamp:withInitialize:
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  2692
    "Modified: / 13.3.1998 / 12:23:59 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2693
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2694
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2695
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2696
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2697
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2698
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2699
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2700
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2701
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2702
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2703
    (s := self primitiveDefinitionsString) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2704
        aStream nextPutChunkSeparator.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2705
        self printClassNameOn:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2706
        aStream nextPutAll:' primitiveDefinitions';
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2707
                nextPutChunkSeparator;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2708
                cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2709
        aStream nextPutAll:s.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2710
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2711
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2712
    (s := self primitiveVariablesString) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2713
        aStream nextPutChunkSeparator.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2714
        self printClassNameOn:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2715
        aStream nextPutAll:' primitiveVariables';
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2716
                nextPutChunkSeparator;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2717
                cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2718
        aStream nextPutAll:s.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2719
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2720
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2721
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2722
    "Modified: 8.1.1997 / 17:45:40 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2723
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2724
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2725
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2726
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2727
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2728
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2729
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2730
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2731
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2732
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2733
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2734
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2735
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2736
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2737
    (s := self primitiveFunctionsString) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2738
        aStream nextPutChunkSeparator.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2739
        self printClassNameOn:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2740
        aStream nextPutAll:' primitiveFunctions';
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2741
                nextPutChunkSeparator;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2742
                cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2743
        aStream nextPutAll:s.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2744
        aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2745
    ].
2088
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2746
d7e8d0bce74f care for nameSpace in primitiveDefinitions
Claus Gittinger <cg@exept.de>
parents: 2072
diff changeset
  2747
    "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
  2748
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2749
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2750
!Class methodsFor:'fileOut-binary'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2751
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2752
binaryFileOut
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2753
    "create a file 'class.cls' (in the current projects fileOut-directory),
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2754
     consisting of all methods in myself in a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2755
     The methods source is saved by reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2756
     to the classes sourceFile if there is any.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2757
     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
  2758
     browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2759
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2760
    self binaryFileOutWithSourceMode:#reference
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2761
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2762
    "Modified: 5.1.1997 / 15:40:05 / cg"
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
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2765
binaryFileOutOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2766
    "append a binary representation of myself to aStream"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2767
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2768
    self binaryFileOutOn:aStream sourceMode:#reference
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2769
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2770
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2771
binaryFileOutOn:aStream sourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2772
    "append a binary representation of myself to aStream in
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2773
     a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2774
     The argument controls how sources are to be saved:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2775
        #keep - include the source
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2776
        #reference - include a reference to the sourceFile
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2777
        #discard - dont save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2778
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2779
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2780
     in order to be browsable."
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
    |bos|
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
    bos := BinaryObjectStorage onNew:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2785
    bos sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2786
    bos nextPutClasses:(Array with:self).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2787
    bos close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2788
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2789
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2790
binaryFileOutWithSourceMode:sourceMode
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2791
    "create a file 'class.cls' (in the current projects fileOut-directory),
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2792
     consisting of all methods in myself in a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2793
     The argument controls how sources are to be saved:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2794
        #keep - include the source
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2795
        #reference - include a reference to the sourceFile
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2796
        #discard - dont save sources.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2797
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2798
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2799
     in order to be browsable."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2800
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2801
    |fileName dirName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2802
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2803
    fileName := (Smalltalk fileNameForClass:self name), '.cls'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2804
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2805
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2806
        dirName := Project currentProjectDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2807
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2808
        dirName := '.'
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2809
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2810
    fileName := dirName asFilename construct:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2811
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2812
    fileName := fileName name.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2813
    self binaryFileOutWithSourceMode:sourceMode as:fileName.
10053
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2814
5c14f82b1964 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 10050
diff changeset
  2815
    "Modified: / 06-10-2006 / 16:16:29 / cg"
5374
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
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2818
binaryFileOutWithSourceMode:sourceMode as:fileNameString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2819
    "create a file fileNameString,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2820
     consisting of all methods in myself in a portable binary format.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2821
     The argument controls how sources are to be saved:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2822
        #keep - include the source
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2823
        #reference - include a reference to the sourceFile
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2824
        #discard - dont save sources.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2825
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2826
     With #reference, the sourceFile needs to be present after reload
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2827
     in order to be browsable."
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
    |fileName aStream|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2830
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2831
    fileName := fileNameString asFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2832
    fileName makeLegalFilename.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2833
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2834
    [
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2835
        aStream := fileName newReadWriteStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2836
    ] on:FileStream openErrorSignal do:[:ex|
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2837
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2838
                raiseRequestWith:fileName name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2839
                errorString:(' - cannot create file:', fileName name)
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2840
    ].
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2841
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2842
    aStream binary.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2843
    self binaryFileOutOn:aStream sourceMode:sourceMode.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2844
    aStream close.
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
    "Created: / 29.12.1998 / 21:38:38 / cg"
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
!Class methodsFor:'fileOut-xml'!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2850
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2851
fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2852
    "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
  2853
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2854
     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
  2855
     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
  2856
     case of errors (for example: disk full)"
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2857
7693
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2858
    |dirName nm fileName|
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2859
212597279482 fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 7658
diff changeset
  2860
    nm := (Smalltalk fileNameForClass:self name) , '.xml'.
5374
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
     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
  2864
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2865
    Project notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2866
        dirName := Project currentProjectDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2867
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2868
        dirName := Filename currentDirectory
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2869
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2870
    fileName := (dirName asFilename construct:nm).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2871
    fileName makeLegalFilename.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2872
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2873
    self fileOutXMLAs:fileName.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2874
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2875
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2876
     Class fileOutXML
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2877
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2878
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2879
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2880
fileOutXMLAllDefinitionsOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2881
    "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
  2882
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2883
    self fileOutXMLDefinitionOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2884
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2885
    "/ here, the full nameSpace prefixes are output,
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  2886
    "/ to avoid confusing stc
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2887
    "/ (which otherwise could not find the correct superclass)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2888
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2889
    FileOutNameSpaceQuerySignal answer:true do:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2890
        self privateClassesSorted do:[:aClass |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2891
            aClass fileOutXMLAllDefinitionsOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2892
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2893
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2894
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2895
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2896
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2897
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2898
fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2899
    |collectionOfCategories|
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2900
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2901
    collectionOfCategories := self class categories asSortedCollection.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2902
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2903
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2904
            self class fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2905
            aStream cr
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2906
        ]
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2907
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2908
    collectionOfCategories := self categories asSortedCollection.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2909
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2910
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2911
            self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2912
            aStream cr
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2913
        ]
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2914
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2915
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2916
    self privateClassesSorted do:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2917
        aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2918
    ].
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2919
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2920
!
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2921
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2922
fileOutXMLAs:fileNameOrString
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2923
    "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
  2924
     XML sourceForm.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2925
     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
  2926
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2927
    |aStream fileName|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2928
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2929
    self isLoaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2930
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2931
            raiseRequestWith:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2932
                 errorString:' - will not fileOut unloaded class: ', self name
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2933
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2934
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2935
    fileName := fileNameOrString asFilename.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2936
    [
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2937
        aStream := fileName writeStream.
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2938
    ] on:FileStream openErrorSignal do:[:ex|
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2939
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2940
                raiseRequestWith:fileName name
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2941
                errorString:(' - cannot create file: ', fileName name)
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2942
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2943
    self fileOutXMLOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2944
    aStream close.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2945
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2946
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2947
     Class fileOutXMLAs:'test.xml'
7089
c4a27118cc2a Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7084
diff changeset
  2948
     Class fileOutXMLAs:'/blaDoesNotExist/test.xml'
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2949
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2950
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2951
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2952
fileOutXMLDefinitionOn:aStream
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2953
    "append an xml expression on aStream, which defines myself."
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2954
6703
ffea6ebb676d Remove unused method vars.
Stefan Vogel <sv@exept.de>
parents: 6701
diff changeset
  2955
    |varNames|
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2956
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2957
    aStream nextPutLine:'<class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2958
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2959
    aStream nextPutAll:'  <name>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2960
    aStream nextPutAll:(self nameWithoutPrefix).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2961
    aStream nextPutLine:'</name>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2962
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2963
    aStream nextPutAll:'  <environment>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2964
    aStream nextPutAll:(self nameSpace name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2965
    aStream nextPutLine:'</environment>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2966
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2967
    aStream nextPutAll:'  <super>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2968
    aStream nextPutAll:(self theNonMetaclass superclass name).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2969
    aStream nextPutLine:'</super>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2970
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2971
    aStream nextPutAll:'  <private>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2972
    aStream nextPutAll:(self isPrivate printString).
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2973
    aStream nextPutLine:'</private>'.
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:'  <indexed-type>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2976
    aStream nextPutAll:'none'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2977
    aStream nextPutLine:'</indexed-type>'.
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:'  <inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2980
    varNames := self instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2981
    varNames size > 0 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2982
        aStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2983
        varNames do:[:nm |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2984
            aStream nextPutAll:'    <name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2985
            aStream nextPutAll:nm.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2986
            aStream nextPutLine:'</name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2987
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2988
        aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2989
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2990
    aStream nextPutLine:'</inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  2991
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2992
    aStream nextPutAll:'  <class-inst-vars>'.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2993
    varNames := self class instVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  2994
    varNames size > 0 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2995
        aStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2996
        varNames do:[:nm |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2997
            aStream nextPutAll:'    <name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2998
            aStream nextPutAll:nm.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  2999
            aStream nextPutLine:'</name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3000
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3001
        aStream nextPutAll:'  '.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3002
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3003
    aStream nextPutLine:'</class-inst-vars>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3004
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3005
    aStream nextPutAll:'  <imports>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3006
    aStream nextPutAll:''.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3007
    aStream nextPutLine:'</imports>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3008
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3009
    aStream nextPutAll:'  <category>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3010
    aStream nextPutAll:self category.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3011
    aStream nextPutLine:'</category>'.
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
    aStream nextPutLine:'</class>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3014
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3015
    varNames := self classVarNames.
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3016
    varNames size > 0 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3017
        varNames do:[:nm |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3018
            aStream nextPutLine:'<static>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3019
            aStream nextPutAll:' <name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3020
            aStream nextPutAll:nm.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3021
            aStream nextPutLine:'</name>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3022
            aStream nextPutAll:' <environment>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3023
            aStream nextPutAll:self name.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3024
            aStream nextPutLine:'</environment>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3025
            aStream nextPutLine:'</static>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3026
        ].
5464
af5c4f052b20 xml fileOut
Claus Gittinger <cg@exept.de>
parents: 5374
diff changeset
  3027
    ].
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3028
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3029
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3030
fileOutXMLOn:aStream
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3031
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3032
     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
  3033
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3034
    self
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3035
        fileOutXMLOn:aStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3036
        withTimeStamp:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3037
        withInitialize:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3038
        withDefinition:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3039
        methodFilter:nil
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3040
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3041
!
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3042
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3043
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
  3044
    "WARNING: untested first version. Not for general use (yet)
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3045
     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
  3046
     If stampIt is true, a timeStamp comment is prepended.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3047
     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
  3048
     append a corresponding doIt expression for initialization.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3049
     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
  3050
     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
  3051
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3052
    |collectionOfCategories copyrightMethod copyrightText comment meta|
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3053
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3054
    self isLoaded ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3055
        ^ FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3056
            raiseRequestWith:self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3057
                 errorString:' - will not fileOut unloaded class: ', self name
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3058
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3059
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3060
    meta := self class.
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
    aStream nextPutLine:'<?xml version="1.0"?>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3063
    aStream nextPutLine:'<st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3064
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3065
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3066
     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
  3067
     taking the string from the copyright method.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3068
     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
  3069
     being put on your code ;-).
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3070
     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
  3071
     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
  3072
     code was edited in the browser and filedOut.
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
    (copyrightMethod := meta compiledMethodAt:#copyright) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3075
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3076
         get the copyright methods source,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3077
         and insert at beginning.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3078
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3079
        copyrightText := copyrightMethod source.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3080
        copyrightText isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3081
            "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3082
             no source available - trigger an error
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3083
            "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3084
            FileOutErrorSignal
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3085
                raiseRequestWith:' - no source for class: '.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3086
            ^ self
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3087
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3088
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3089
         strip off the selector-line
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3090
        "
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3091
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3092
        copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3093
        [copyrightText last isEmpty] whileTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3094
            copyrightText := copyrightText copyWithoutLast:1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3095
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3096
        (copyrightText first = '"') ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3097
            (copyrightText last = '"') ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3098
                copyrightText := copyrightText copyFrom:2 to:(copyrightText size - 1).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3099
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3100
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3101
        copyrightText := copyrightText asString.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3102
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3103
        aStream nextPutAll:'<copyright>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3104
        self fileOutXMLString:copyrightText on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3105
        aStream nextPutLine:'</copyright>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3106
    ].
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
    stampIt ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3109
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3110
        "/ first, a timestamp
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3111
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3112
        aStream nextPutAll:'<time-stamp>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3113
        self fileOutXMLString:(Smalltalk timeStampString) on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3114
        aStream nextPutLine:'</time-stamp>'.
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3115
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3116
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3117
    withDefinition ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3118
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3119
        "/ then the definition
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3120
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3121
        self fileOutXMLAllDefinitionsOn:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3122
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3123
        "/ a comment - if any
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3124
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3125
        (comment := self comment) notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3126
            aStream nextPutLine:'<comment>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3127
            aStream nextPutAll:'<class-id>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3128
            aStream nextPutAll:(self name).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3129
            aStream nextPutLine:'</class-id>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3130
            aStream nextPutLine:'</comment>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3131
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3132
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3133
        "/ primitive definitions - if any
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3134
        "/
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3135
"/        self fileOutPrimitiveSpecsOn:aStream.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3136
    ].
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
    "/ 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
  3140
    "/ 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
  3141
    "/         avoid sourcePosition-shifts when checked out later.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3142
    "/         (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
  3143
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3144
    collectionOfCategories := meta categories asSortedCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3145
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3146
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3147
            meta fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3148
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3149
    ].
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
    "/ methods from all categories in myself
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3153
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3154
    collectionOfCategories := self categories asSortedCollection.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3155
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3156
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3157
            self fileOutXMLCategory:aCategory methodFilter:methodFilter on:aStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3158
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3159
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3160
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3161
    "/
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3162
    "/ any private classes' methods
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
    self privateClassesSorted do:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3165
        aClass fileOutXMLAllMethodsOn:aStream methodFilter:methodFilter
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3166
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3167
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3168
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3169
    initIt ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3170
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3171
        "/ optionally an initialize message
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3172
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3173
        (meta includesSelector:#initialize) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3174
            aStream nextPutLine:'<initialize>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3175
            aStream nextPutAll:'<class-id>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3176
            aStream nextPutAll:(self name).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3177
            aStream nextPutLine:'</class-id>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3178
            aStream nextPutLine:'</initialize>'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3179
        ]
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3180
    ].
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3181
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3182
    aStream nextPutLine:'</st-source>'.
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3183
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3184
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3185
     Class
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3186
        fileOutXMLOn:'test.xml' asFilename writeStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3187
        withTimeStamp:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3188
        withInitialize:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3189
        withDefinition:true
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3190
        methodFilter:nil
5374
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3191
    "
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3192
! !
df453d2c7390 first attempt in XML storage
Claus Gittinger <cg@exept.de>
parents: 5370
diff changeset
  3193
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3194
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3195
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3196
htmlDocumentation
8356
96c5195d52c7 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 8285
diff changeset
  3197
    <resource: #obsolete>
7227
5df22f2ffebc htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents: 7222
diff changeset
  3198
    self obsoleteMethodWarning:'use HTMLDocGenerator htmlDocOf:'.
5df22f2ffebc htmlDocumentation is going to be obsolete
Claus Gittinger <cg@exept.de>
parents: 7222
diff changeset
  3199
2482
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3200
    ^ HTMLDocGenerator htmlDocOf:self
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3201
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3202
    "Created: 22.3.1997 / 14:18:23 / cg"
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3203
!
a13e40246125 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
  3204
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3205
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3206
    "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
  3207
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3208
    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
  3209
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3210
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3211
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3212
    "print myself and all subclasses on aStream.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3213
     recursively calls itself to print subclasses.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3214
     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
  3215
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3216
    |nm|
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3217
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3218
    nm := self name.
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3219
    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
  3220
    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
  3221
    aStream nextPutLine:')'.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3222
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3223
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3224
        aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3225
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3226
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3227
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3228
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3229
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3230
     printStream close"
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3231
1996
9048e53f76d8 use self name instead of direct instVar access
Claus Gittinger <cg@exept.de>
parents: 1994
diff changeset
  3232
    "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
  3233
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3234
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3235
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3236
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3237
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  3238
    |comment s superclass|
333
claus
parents: 328
diff changeset
  3239
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3240
    aPrintStream nextPutAll:'class                '; bold; nextPutLine:self name; normal.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3241
    aPrintStream nextPutAll:'superclass           '.
6394
492964c0fd9b instance variables should only be accessed by getters/setters
Claus Gittinger <cg@exept.de>
parents: 6386
diff changeset
  3242
    superclass := self superclass.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3243
    superclass isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3244
        s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3245
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3246
        s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3247
    ].
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3248
    aPrintStream nextPutLine:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3249
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3250
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3251
    self printInstVarNamesOn:aPrintStream indent:21.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3252
    aPrintStream cr.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3253
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3254
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3255
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3256
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3257
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3258
    category notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3259
        aPrintStream nextPutAll:'category             ';
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3260
                     nextPutLine:(category printString).
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3261
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3262
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  3263
    (comment := self comment) notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3264
        aPrintStream cr; nextPutLine:'comment:'; italic; nextPutLine:comment; normal
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3265
    ]
733
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3266
983d045c17f5 make definition indent be tabs (to avoid CVS seeing differences where none are)
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  3267
    "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
  3268
    "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
  3269
    "Modified: 1.4.1997 / 16:01:26 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3270
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3271
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3272
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3273
    "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
  3274
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3275
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3276
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3277
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3278
    aPrintStream cr.
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3279
    collectionOfCategories := self class categories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3280
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3281
        aPrintStream nextPutLine:'class protocol'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3282
        aPrintStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3283
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3284
            self class printOutCategory:aCategory on:aPrintStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3285
        ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3286
    ].
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3287
    collectionOfCategories := self categories asSortedCollection.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3288
    collectionOfCategories notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3289
        aPrintStream nextPutLine:'instance protocol'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3290
        aPrintStream cr.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3291
        collectionOfCategories do:[:aCategory |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3292
            self printOutCategory:aCategory on:aPrintStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3293
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3294
    ]
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3295
3937
38a48ab7eac7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3920
diff changeset
  3296
    "Modified: / 25.11.1998 / 12:40:31 / cg"
5938
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3297
!
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3298
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3299
printOutProtocolOn:aPrintStream
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3300
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3301
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3302
    |collectionOfCategories|
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3303
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3304
    self printOutDefinitionOn:aPrintStream.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3305
    aPrintStream cr.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3306
    collectionOfCategories := self class categories asSortedCollection.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3307
    collectionOfCategories notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3308
        aPrintStream nextPutLine:'class protocol'.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3309
        aPrintStream cr.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3310
        collectionOfCategories do:[:aCategory |
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3311
            self class printOutCategoryProtocol:aCategory on:aPrintStream
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3312
        ]
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3313
    ].
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3314
    collectionOfCategories := self categories asSortedCollection.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3315
    collectionOfCategories notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3316
        aPrintStream nextPutLine:'instance protocol'.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3317
        aPrintStream cr.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3318
        collectionOfCategories do:[:aCategory |
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3319
            self printOutCategoryProtocol:aCategory on:aPrintStream
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3320
        ]
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3321
    ]
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3322
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3323
    "Modified: / 25.11.1998 / 12:40:38 / cg"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3324
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3325
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3326
printSharedPoolNamesOn:aStream indent:indent
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3327
    "print the pool names indented and breaking at line end"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3328
13214
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  3329
    self printNameArray:(self sharedPoolNames) on:aStream indent:indent
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  3330
Claus Gittinger <cg@exept.de>
parents: 13209
diff changeset
  3331
    "Modified: / 18-01-2011 / 17:56:16 / cg"
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3332
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3333
5938
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3334
storeOn:aStream
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3335
    "append my name only - expects class to be there, when restoring"
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3336
3217017b7ff4 changed #storeOn: to store the name only
Claus Gittinger <cg@exept.de>
parents: 5875
diff changeset
  3337
    aStream nextPutAll:self name
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3338
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3339
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3340
!Class methodsFor:'private-accessing'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3341
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3342
attributes
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3343
    "return the extra class attributes or nil"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3344
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3345
    attributes isNil ifTrue:[^ nil].
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3346
    ^ self classAttributes
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3347
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3348
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3349
attributes:aClassAttributesObject
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3350
    "set the extra class attributes"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3351
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3352
    self classAttributes:aClassAttributesObject
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3353
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3354
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3355
classAttributes
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3356
    "return the extra class attributes or create them if nil.
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  3357
     Notice that the stc-compiler is too stupid to generate instances of ClassAttributes directly;
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  3358
     therefore, it generates arrays which are converted here, when we first access the attribute."
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3359
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3360
    attributes isNil ifTrue:[
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3361
        attributes := ClassAttributes new.
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3362
    ] ifFalse:[
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3363
        attributes isArray ifTrue:[
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3364
            attributes := ClassAttributes new fromSTCPrimitiveArray:attributes.
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3365
        ].
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3366
    ].
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  3367
    ^ attributes
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3368
!
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3369
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3370
classAttributes:aClassAttributesObject
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3371
    "set the extra class attributes"
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3372
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3373
    attributes := aClassAttributesObject
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3374
!
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3375
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3376
flushSubclasses
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3377
    subclasses := nil
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3378
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3379
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3380
getAttribute:aKey
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3381
    "get an attribute (by symbolic key)"
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  3382
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3383
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3384
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3385
    attributes isNil ifTrue:[ ^ nil].
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3386
    ^ self classAttributes perform:aKey asSymbol
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3387
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3388
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3389
getSourceChunkAttribute:aKey
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3390
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3391
7472
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3392
    |pos stream string|
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3393
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3394
    pos := self getAttribute:aKey.
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3395
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3396
    "the attribute is either a string, or an integer specifying the
7472
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3397
     position within the classes sourcefile ..."
6db2e9f22714 remove unused instvars
Stefan Vogel <sv@exept.de>
parents: 7463
diff changeset
  3398
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3399
    pos isNumber ifTrue:[
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3400
"/        classFilename notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3401
            stream := self sourceStream.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3402
            stream notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3403
                stream position0Based:pos.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3404
                string := stream nextChunk.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3405
                stream close.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3406
                ^ string
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3407
            ].
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3408
"/        ].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3409
        ^ nil
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3410
    ].
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3411
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3412
    ^ pos
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3413
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3414
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3415
setAttribute:key to:aValue
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3416
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3417
7486
d0f96377345c renamed attributes
tm
parents: 7472
diff changeset
  3418
    self classAttributes perform:(key , ':') asSymbol with:aValue
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3419
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3420
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3421
setName:aString
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3422
    "set the classes name - be careful, it will be still
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3423
     in the Smalltalk dictionary - under another key.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3424
     This is NOT for general use - see renameTo:"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3425
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3426
    environment := nil.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3427
    name := aString
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3428
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3429
    "Created: 1.4.1997 / 15:46:01 / stefan"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3430
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3431
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3432
setPrimitiveDefinitions:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3433
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3434
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3435
    "set the primitiveDefinition string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3436
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3437
    ^ self setAttribute:#primitiveDefinitions to:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3438
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3439
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3440
setPrimitiveFunctions:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3441
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3442
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3443
    "set the primitiveFunction string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3444
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3445
    ^ self setAttribute:#primitiveFunctions to:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3446
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3447
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3448
setPrimitiveVariables:aString
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3449
    "{ Pragma: +optSpace }"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3450
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3451
    "set the primitiveVariable string (no change notifications)"
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3452
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3453
    ^ self setAttribute:#primitiveVariables to:aString
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3454
!
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3455
13221
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  3456
setSharedPoolNames:aStringOrCollection
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3457
    "{ Pragma: +optSpace }"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3458
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3459
    "set the sharedPools string (no change notifications)"
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3460
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3461
    ^ self setAttribute:#sharedPools to:aStringOrCollection
13221
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  3462
11f21a9fb78d added: #setSharedPoolNames:
Claus Gittinger <cg@exept.de>
parents: 13214
diff changeset
  3463
    "Created: / 18-01-2011 / 20:41:09 / cg"
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3464
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3465
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3466
setSubclasses:aCollection
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3467
    subclasses := aCollection
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3468
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3469
    "Created: / 28-04-2010 / 08:48:49 / cg"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3470
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3471
7435
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3472
setSuperclass:aClass
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3473
    "set the superclass of the receiver.
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3474
     this method is for special uses only - there will be no recompilation
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3475
     and no change record written here. Also, if the receiver class has
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3476
     already been in use, future operation of the system is not guaranteed to
c5afb1b0fd1b Prepare for moving of SubclassInfo to subclass instcar in Class
Stefan Vogel <sv@exept.de>
parents: 7371
diff changeset
  3477
     be correct, since no caches are flushed.
8072
e7542f2dbb9c flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents: 8051
diff changeset
  3478
     Therefore: do NOT use it; use #superclass: (or flush the caches, at least)."
e7542f2dbb9c flush cached subclassInfo whenever a superclass changes
Claus Gittinger <cg@exept.de>
parents: 8051
diff changeset
  3479
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3480
    superclass := aClass
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3481
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3482
    "Modified: / 28-04-2010 / 08:49:07 / cg"
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3483
!
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3484
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3485
updateAllCachedSubclasses
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3486
    |subclassesPerClass|
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3487
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3488
    subclassesPerClass := Dictionary new.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3489
    Smalltalk allClassesDo:[:each |
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3490
        |cls superclass|
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3491
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3492
        cls := each theNonMetaclass.
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3493
        (superclass := each superclass) notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3494
            (subclassesPerClass at:superclass ifAbsentPut:[Set new]) add:cls
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3495
        ].
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3496
        subclassesPerClass at:cls ifAbsentPut:[Set new].
12689
834adbd43cc1 comment/format in: #subclassesDo:
Claus Gittinger <cg@exept.de>
parents: 12633
diff changeset
  3497
    ].
12903
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3498
    subclassesPerClass keysAndValuesDo:[:cls :subclasses |
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3499
        cls setSubclasses:(subclasses asArray).
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3500
    ].
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3501
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3502
    "
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3503
     Class updateAllCachedSubclasses
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3504
    "
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3505
Claus Gittinger <cg@exept.de>
parents: 12859
diff changeset
  3506
    "Created: / 28-04-2010 / 08:47:20 / cg"
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3507
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  3508
7258
9ccdbee7d1ad method category rename
Claus Gittinger <cg@exept.de>
parents: 7227
diff changeset
  3509
!Class methodsFor:'private-changes management'!
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3510
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3511
addChangeRecordForChangeCategory:category to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3512
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3513
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3514
    "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
  3515
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3516
    self printClassNameOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3517
    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
  3518
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3519
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3520
    "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
  3521
    "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
  3522
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3523
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3524
addChangeRecordForClass:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3525
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3526
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3527
    "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
  3528
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3529
    aClass isLoaded ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3530
        aClass basicFileOutDefinitionOn:aStream withNameSpace:true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3531
        aStream nextPutChunkSeparator.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3532
    ]
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3533
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3534
    "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
  3535
    "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
  3536
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3537
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3538
addChangeRecordForClassComment:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3539
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3540
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3541
    "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
  3542
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3543
    aClass fileOutCommentOn:aStream.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3544
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3545
    "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
  3546
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3547
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3548
addChangeRecordForClassInstvars:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3549
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3550
5225
d74b4c895376 comments; handle class-instvar and comment changes
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
  3551
    "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
  3552
8277
357428ca03c5 classInstVar definition string (for non-ST metaclasses)
Claus Gittinger <cg@exept.de>
parents: 8267
diff changeset
  3553
    aClass class fileOutClassInstVarDefinitionOn:aStream withNameSpace:true.
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3554
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3555
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3556
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  3557
addChangeRecordForClassRemove:oldClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3558
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3559
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3560
    "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
  3561
7179
71010cbeb76f james' package changes (pass down class/method)
james
parents: 7174
diff changeset
  3562
    aStream nextPutAll:('Smalltalk removeClass:' , oldClass name).
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3563
    aStream nextPutChunkSeparator.
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3564
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3565
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3566
addChangeRecordForClassRename:oldName to:newName to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3567
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3568
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3569
    "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
  3570
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3571
    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
  3572
    aStream nextPutChunkSeparator.
1846
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3573
b7042a82eee6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1843
diff changeset
  3574
    "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
  3575
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3576
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3577
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3578
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3579
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3580
    "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
  3581
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3582
    aStream nextPutAll:aClass name; nextPutLine:' primitiveDefinitions:''';
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3583
            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
  3584
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3585
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3586
    "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
  3587
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3588
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3589
addChangeRecordForPrimitiveFunctions:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3590
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3591
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3592
    "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
  3593
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3594
    aStream nextPutAll:aClass name; nextPutLine:' primitiveFunctions:''';
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3595
            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
  3596
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3597
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3598
    "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
  3599
!
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3600
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3601
addChangeRecordForPrimitiveVariables:aClass to:aStream
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3602
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  3603
1113
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3604
    "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
  3605
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3606
    aStream nextPutAll:aClass name; nextPutLine:' primitiveVariables:''';
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3607
            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
  3608
    aStream nextPutChunkSeparator.
1951
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3609
2ece0b1e4710 use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 1942
diff changeset
  3610
    "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
  3611
! !
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3612
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3613
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3614
9815
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3615
canHaveExtensions
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3616
    "return true, if this class allows extensions from other packages.
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3617
     Private classes, namespaces and projectDefinitions dont allow this"
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3618
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3619
    ^ self isPrivate not
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3620
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3621
    "
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3622
     Smalltalk allClasses select:[:each | each canHaveExtensions not]
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3623
    "
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3624
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3625
    "Created: / 30-08-2006 / 15:27:53 / cg"
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3626
!
cb3a9069eb91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9741
diff changeset
  3627
8167
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3628
classResources
8185
e09efa26b6f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8167
diff changeset
  3629
    self isPrivate ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3630
        ^ self owningClass classResources
8185
e09efa26b6f8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8167
diff changeset
  3631
    ].
9930
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3632
    ^ ResourcePack for:self cached:true.
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3633
301a6bad960a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9929
diff changeset
  3634
    "Modified: / 18-09-2006 / 20:37:16 / cg"
8167
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3635
!
622b4431e3a0 + classResources
Claus Gittinger <cg@exept.de>
parents: 8164
diff changeset
  3636
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3637
extensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3638
    "return a collection of extension-methods from any package, or empty if there are none."
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3639
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3640
    |extensions classPackage|
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3641
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3642
    classPackage := self package.
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3643
    self instAndClassMethodsDo:[:mthd |
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3644
        mthd package ~= classPackage ifTrue:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3645
            extensions isNil ifTrue:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3646
                extensions := OrderedCollection new.
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3647
            ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3648
            extensions add:mthd
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3649
        ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3650
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3651
    ^ extensions ? #()
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3652
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3653
    "
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3654
     CType extensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3655
     Rectangle extensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3656
     Rectangle hasExtensions
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3657
    "
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3658
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3659
    "Created: / 12-10-2006 / 18:29:51 / cg"
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3660
    "Modified: / 05-03-2007 / 17:12:04 / cg"
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3661
!
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3662
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3663
extensionsFrom:aPackageID
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3664
    "return the set of extension-methods from the given package."
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3665
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3666
    |extensions|
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3667
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3668
    aPackageID = self package ifTrue:[^ #() ].
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3669
    self instAndClassMethodsDo:[:mthd | 
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3670
        mthd package = aPackageID ifTrue:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3671
            extensions isNil ifTrue:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3672
                extensions := OrderedCollection new.
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3673
            ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3674
            extensions add:mthd
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3675
        ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3676
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3677
    ^ extensions ? #()
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3678
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3679
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3680
     CType extensionsFrom:#'bosch:dapasx'
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3681
     Rectangle extensionsFrom:#'bosch:dapasx/support' 
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3682
     Rectangle extensions
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3683
     Class extensions
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3684
     Class extensionsFrom:#'stx:libboss'
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3685
    "
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3686
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3687
    "Created: / 07-08-2006 / 22:02:15 / fm"
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3688
    "Modified: / 06-03-2007 / 11:54:53 / cg"
9494
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3689
!
151f98864b52 *** empty log message ***
fm
parents: 9470
diff changeset
  3690
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3691
hasExtensions
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3692
    "return true, if there are methods in the receiver, which belong to
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3693
     a different package (i.e. package of class ~= package of method).
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3694
     Those are class extensions, which must be treated specially when checking classes
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3695
     into the sourceCode repository. (extensions are stored separate)"
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3696
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3697
    |clsPkg defaultPkg|
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3698
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  3699
    defaultPkg := PackageId noProjectID.
6166
cd11364e8eb8 change management
Claus Gittinger <cg@exept.de>
parents: 6150
diff changeset
  3700
    clsPkg := self package.
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3701
    self instAndClassMethodsDo:[:mthd |
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3702
        |mthdPkg|
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3703
        (((mthdPkg := mthd package) ~= clsPkg) and:[ mthdPkg ~= defaultPkg ]) ifTrue:[^ true ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3704
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3705
    ^ false
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3706
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3707
    "
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3708
     Time millisecondsToRun:[
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3709
        Smalltalk allClasses select:[:each | each hasExtensions]
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3710
     ]. 190 130 260
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3711
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3712
     Dictionary 
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3713
        withAssociations:
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3714
            (Smalltalk allClasses 
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3715
                select:[:each | each hasExtensions]
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3716
                thenCollect:[:each | each -> each extensions])
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3717
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3718
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3719
    "Modified: / 05-03-2007 / 17:06:20 / cg"
5545
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3720
!
1faf1228868d added #hasExtensions
Claus Gittinger <cg@exept.de>
parents: 5514
diff changeset
  3721
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3722
hasExtensionsFrom:aPackageID
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3723
    "return true, if there are methods in the receiver, which belong to
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3724
     the package with aPackageID (i.e. package of class ~= package of method).
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3725
     Those are class extensions, which must be treated specially when checking classes
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3726
     into the sourceCode repository. (extensions are stored separate)"
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3727
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3728
    |clsPkg|
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3729
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3730
    clsPkg := self package.
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3731
    aPackageID = clsPkg ifTrue:[^ #()].
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3732
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3733
    self instAndClassMethodsDo:[:mthd | 
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3734
        mthd package = aPackageID ifTrue:[ ^ true].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3735
    ].
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3736
    ^ false
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3737
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3738
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3739
     Smalltalk allClasses 
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3740
        select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser']
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3741
     Smalltalk allClasses 
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3742
        select:[:each | each hasExtensionsFrom:'stx:libboss']
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3743
    "
10084
f6af35f81242 extension code refactored
Claus Gittinger <cg@exept.de>
parents: 10078
diff changeset
  3744
10438
9b6b921306c7 +hasExtensions queries tuned
Claus Gittinger <cg@exept.de>
parents: 10376
diff changeset
  3745
    "Modified: / 06-03-2007 / 11:55:39 / cg"
5659
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3746
!
58a0b506f1e1 added #hasExtensionsFrom:
Claus Gittinger <cg@exept.de>
parents: 5635
diff changeset
  3747
12415
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3748
hasUnsavedChanges
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3749
    "return true, if there are changes for this class in the current changeSet"
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3750
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3751
    ^ ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:self
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3752
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3753
    "
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3754
     Class hasUnsavedChanges
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3755
     Array hasUnsavedChanges
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3756
    "
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3757
!
4fc8895fb7aa added: #hasUnsavedChanges
Claus Gittinger <cg@exept.de>
parents: 12361
diff changeset
  3758
10042
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3759
isBrowserStartable
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3760
    "return true, if this is an application class,
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3761
     which can be started from the browser"
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3762
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3763
    ^ self isVisualStartable or:[self isStartableWithStart or:[ self isStartableWithMain ]]
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3764
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3765
    "Created: / 06-10-2006 / 11:34:28 / cg"
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3766
!
d028c01995f8 protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 10035
diff changeset
  3767
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3768
isClass
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3769
    "return true, if the receiver is some kind of class
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3770
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3771
     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
  3772
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3773
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3774
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3775
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3776
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3777
     Point isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3778
     1 isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3779
     Behavior new isBehavior
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3780
     Behavior new isClass
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3781
     Class new isBehavior
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3782
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3783
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3784
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3785
8933
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  3786
isJavaScriptClass
8936
e098919f2f79 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8933
diff changeset
  3787
    ^ self class isJavaScriptMetaclass
8933
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  3788
!
875368d130ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
  3789
6723
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3790
isStartableWithMain
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3791
    "return true, if this is an application class,
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3792
     which can be started via #main"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3793
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3794
    ^ self theMetaclass includesSelector:#main
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3795
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3796
    "Created: / 2.11.2001 / 09:37:01 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3797
    "Modified: / 2.11.2001 / 09:48:05 / cg"
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3798
!
51ed366a10b1 category change
Claus Gittinger <cg@exept.de>
parents: 6703
diff changeset
  3799
8756
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3800
isStartableWithStart
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3801
    "return true, if this is an application class,
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3802
     which can be started via #start"
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3803
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3804
    ^ self theMetaclass includesSelector:#start
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3805
!
240a8c625065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8737
diff changeset
  3806
11382
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3807
packageDirectory
11413
6ec31156cc0d comment
Claus Gittinger <cg@exept.de>
parents: 11382
diff changeset
  3808
    "return the packageDirectory of this classes package.
6ec31156cc0d comment
Claus Gittinger <cg@exept.de>
parents: 11382
diff changeset
  3809
     That is usually the directory where my source is, and where package specific additional
6ec31156cc0d comment
Claus Gittinger <cg@exept.de>
parents: 11382
diff changeset
  3810
     files (bitmaps, resources etc.) are found."
6ec31156cc0d comment
Claus Gittinger <cg@exept.de>
parents: 11382
diff changeset
  3811
11382
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3812
    ^ Smalltalk getPackageDirectoryForPackage:self package.
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3813
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3814
    "
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3815
      self packageDirectory  
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3816
      stx_libbasic3 packageDirectory   
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3817
      Array packageDirectory           
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3818
    "
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3819
!
76e5a3021ded packageDirectory moved up
Claus Gittinger <cg@exept.de>
parents: 11278
diff changeset
  3820
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3821
rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3822
    "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
  3823
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3824
    |set|
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3825
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3826
    set := IdentitySet new.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  3827
    Smalltalk allClassesDo:[:aClass |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3828
        aClass superclass isNil ifTrue:[set add:aClass]
2568
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3829
    ].
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3830
    ^ set asOrderedCollection
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3831
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3832
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3833
     Class rootsOfTheWorld
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3834
    "
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3835
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3836
    "Modified: 18.4.1997 / 20:55:34 / cg"
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3837
!
9b7a3a08b8ca added #rootsOfTheWorld for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2561
diff changeset
  3838
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3839
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3840
    "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
  3841
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3842
     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
  3843
     Autoload. The interface here is for your convenience."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3844
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3845
    ^ 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
  3846
840b03d131d7 category changes; lock changeFileUpdates via a semaphore (for slow background checkins)
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  3847
    "Modified: 21.3.1996 / 16:27:09 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3848
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3849
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3850
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3851
    "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
  3852
     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
  3853
     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
  3854
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3855
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3856
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3857
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3858
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3859
    [cls notNil] whileTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3860
        (cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3861
        cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3862
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3863
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3864
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3865
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3866
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3867
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3868
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3869
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3870
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3871
!Class methodsFor:'renaming'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3872
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3873
makePrivateIn:newOwner
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3874
    "make a private class of newOwner from the receiver;
5612
17b7c8b69df6 comment
Claus Gittinger <cg@exept.de>
parents: 5581
diff changeset
  3875
     the receiver must be a public class.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3876
     Returns the new private class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3877
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3878
    |sel newClass|
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3879
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3880
    self owningClass notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3881
        ^ self
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3882
    ].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3883
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3884
    sel := self definitionSelectorPrivate.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3885
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3886
    newClass := self superclass
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3887
        perform:sel
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3888
        withArguments:(Array
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3889
                        with:(self nameWithoutPrefix asSymbol)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3890
                        with:(self instanceVariableString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3891
                        with:(self classVariableString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3892
                        with:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3893
                        with:newOwner).
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3894
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3895
    "/ copy over methods ...
6023
63f7111fd2f9 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5938
diff changeset
  3896
    ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class.
63f7111fd2f9 Use ClassBuilder
Claus Gittinger <cg@exept.de>
parents: 5938
diff changeset
  3897
    ClassBuilder copyInvalidatedMethodsFrom:self for:newClass.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3898
    newClass class recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3899
    newClass recompileInvalidatedMethods.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3900
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3901
    newOwner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3902
    Smalltalk changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3903
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3904
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3905
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3906
3494
23a6cf28b3a6 fixed makePrivate, if newOwner is in a nameSpace
Claus Gittinger <cg@exept.de>
parents: 3407
diff changeset
  3907
    "Modified: / 29.5.1998 / 19:03:49 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3908
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3909
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3910
makePublic
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3911
    "make a public class from the receiver.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3912
     The receiver must be a private class.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3913
     Returns the new public class."
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3914
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3915
    ^ self makePublicIn:Smalltalk
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3916
!
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3917
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3918
makePublicIn:newNameSpace
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3919
    "make a public class from the receiver.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3920
     The receiver must be a private class.
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3921
     Returns the new public class."
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3922
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3923
    |sel owner baseName newName newClass|
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3924
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3925
    owner := self topOwningClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3926
    owner isNil ifTrue:[^ self].
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3927
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3928
    "/ first, create the public class ...
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3929
    sel := self definitionSelector.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3930
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3931
    Class nameSpaceQuerySignal answer:newNameSpace
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3932
    do:[
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3933
        baseName := self nameWithoutPrefix.
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3934
"/        (newNameSpace isNil or:[newNameSpace == Smalltalk]) ifTrue:[
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3935
"/            newName := baseName
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3936
"/        ] ifFalse:[
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3937
"/            newName := newNameSpace name , '::' , baseName
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3938
"/        ].
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3939
        newName := baseName.
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3940
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3941
        newClass := self superclass
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3942
            perform:sel
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3943
            withArguments:(Array
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3944
                            with:(newName asSymbol)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3945
                            with:(self instanceVariableString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3946
                            with:(self classVariableString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3947
                            with:''
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3948
                            with:(owner category)).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3949
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3950
        "/ copy over methods ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3951
        ClassBuilder copyInvalidatedMethodsFrom:self class for:newClass class.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3952
        ClassBuilder copyInvalidatedMethodsFrom:self for:newClass.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3953
        newClass class recompileInvalidatedMethods.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  3954
        newClass recompileInvalidatedMethods.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3002
diff changeset
  3955
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3956
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3957
    owner changed:#newClass with:newClass.
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3958
    Smalltalk changed:#newClass with:newClass.
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3959
    (newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3960
        newNameSpace changed:#newClass with:newClass.
5703
36c0ae8ba8d6 added #makePublicIn:aNameSpace
Claus Gittinger <cg@exept.de>
parents: 5660
diff changeset
  3961
    ].
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3962
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3963
    self removeFromSystem.
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3964
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3965
    ^ newClass
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3966
9417
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3967
    "Created: / 23-06-1997 / 13:28:52 / cg"
e782a74fd958 make public fix
Claus Gittinger <cg@exept.de>
parents: 9371
diff changeset
  3968
    "Modified: / 04-07-2006 / 16:27:12 / cg"
2712
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3969
!
32c381e81547 added #makePublic & #makePrivateIn:
Claus Gittinger <cg@exept.de>
parents: 2709
diff changeset
  3970
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3971
renameTo:newName
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3972
    "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
  3973
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3974
    <resource:#obsolete>
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3975
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3976
    |oldSym newSym|
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3977
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3978
    "/ the code below is obsolete - it does not deal with
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3979
    "/ classVariables, private classes and does not
5863
cd29b95b3c72 Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 5849
diff changeset
  3980
    "/ recompile other classes in order to care for namespace
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3981
    "/ changes.
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3982
    "/ Please use Smalltalk>>renameClass:to:,
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3983
    "/ which deals with all of that.
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3984
    self obsoleteMethodWarning:'use Smalltalk>>renameClass:to:'.
2835
9030f7d3a0d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2771
diff changeset
  3985
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3986
    oldSym := name asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3987
    newSym := newName asSymbol.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3988
    self setName:newSym.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3989
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3990
    Smalltalk at:oldSym put:nil.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3991
    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
  3992
    Smalltalk at:newSym put:self.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3993
3702
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3994
    "Created: / 1.4.1997 / 15:27:53 / stefan"
7d6e03420831 comment
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  3995
    "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
  3996
! !
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3997
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3998
!Class methodsFor:'signature checking'!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  3999
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4000
classinstSizeFromSignature:aSignature
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4001
    "for checking class compatibility: return some number based on
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4002
     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
  4003
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4004
    ^ (aSignature bitShift:-7) bitAnd:7
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4005
12840
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4006
    "
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4007
     Class classinstSizeFromSignature:16r100. 2
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4008
     Class classinstSizeFromSignature:16r180. 3
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4009
    "
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4010
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4011
    "Created: 1.4.1997 / 15:23:01 / stefan"
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  4012
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  4013
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4014
instNameKeyFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4015
    "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
  4016
     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
  4017
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4018
    ^ (aSignature bitShift:-14) bitAnd:16rFFFF
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4019
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4020
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4021
     Point instNameKeyFromSignature:Point signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4022
     Association instNameKeyFromSignature:Association signature.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4023
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4024
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4025
    "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
  4026
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4027
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4028
instSizeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4029
    "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
  4030
     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
  4031
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4032
    ^ aSignature bitAnd:16r7F
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4033
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4034
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4035
     Class instSizeFromSignature:Point signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4036
     Class instSizeFromSignature:Association signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4037
     Class instSizeFromSignature:Dictionary signature.
12840
a5d5020f56c5 comments in:
Claus Gittinger <cg@exept.de>
parents: 12701
diff changeset
  4038
     Class instSizeFromSignature:16r100.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4039
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4040
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4041
    "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
  4042
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4043
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4044
instTypeFromSignature:aSignature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4045
    "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
  4046
     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
  4047
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4048
    ^ (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
  4049
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4050
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4051
     Class instTypeFromSignature:Object signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4052
     Class instTypeFromSignature:Array signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4053
     Class instTypeFromSignature:String signature.
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4054
     Class instTypeFromSignature:OrderedCollection signature.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4055
    "
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4056
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4057
    "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
  4058
!
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4059
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4060
signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4061
    "return a signature number - this number is useful for a quick
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4062
     check for changed classes, and is done in the binary-object loader,
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4063
     and the dynamic class loader.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4064
     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
  4065
     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
  4066
     (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
  4067
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4068
    |value   "{ Class: SmallInteger }"
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4069
     nameKey "{ Class: SmallInteger }" |
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4070
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4071
    signature notNil ifTrue:[^ signature].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4072
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4073
    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
  4074
    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
  4075
    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
  4076
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4077
    nameKey := 0.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4078
    self allInstVarNames do:[:name |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4079
        nameKey := nameKey bitShift:1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4080
        (nameKey bitAnd:16r10000) ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4081
            nameKey := nameKey bitXor:1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4082
            nameKey := nameKey bitAnd:16rFFFF.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4083
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4084
        nameKey := (nameKey + (name at:1) codePoint) bitAnd:16rFFFF.
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4085
    ].
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4086
    value := value + (nameKey bitShift:14).
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4087
    signature := value.
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4088
    ^ value
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4089
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4090
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4091
     Array signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4092
     ByteArray signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4093
     View signature
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4094
    "
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4095
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4096
    "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
  4097
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  4098
773
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
!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
  4100
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
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
  4102
    "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
  4103
     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
  4104
     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
  4105
     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
  4106
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4107
    |owner info c|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4108
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4109
    (owner := self owningClass) notNil ifTrue:[^ owner binaryRevision].
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4110
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4111
    revision notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4112
        c := revision first.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4113
        c == $$ ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4114
            info := Class revisionInfoFromString:revision.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4115
            info isNil ifTrue:[^ '0'].
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4116
            ^ (info revision) ? '0'.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4117
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4118
        c isDigit ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4119
            ^ '0'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4120
        ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4121
    ].
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4122
773
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
    ^ 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
  4124
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4125
    "
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
     Object binaryRevision
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4127
     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
  4128
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4129
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4130
    "
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
     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
  4132
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4133
     |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
  4134
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4135
     classes := Smalltalk allClasses
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4136
                    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
  4137
     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
  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
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4140
    "Created: / 07-12-1995 / 10:58:47 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4141
    "Modified: / 01-04-1997 / 23:33:01 / stefan"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4142
    "Modified: / 22-10-2008 / 20:37:05 / 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
  4143
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4144
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4145
currentSourceStream
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4146
    "return an open stream on the current source of the receiver"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4147
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4148
    |theWriteStream theCurrentSource|
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4149
8222
f2c454a9a038 replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents: 8212
diff changeset
  4150
    theWriteStream := String writeStream.
5183
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4151
    Method flushSourceStreamCache.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4152
    self fileOutOn:theWriteStream withTimeStamp:false.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4153
    theCurrentSource := theWriteStream contents asString.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4154
    theWriteStream close.
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4155
    ^ theCurrentSource
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4156
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4157
    "Modified: 15.10.1996 / 18:59:40 / cg"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4158
    "Modified: 1.4.1997 / 14:33:12 / stefan"
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4159
!
dc96a118a4c0 *** empty log message ***
ps
parents: 5182
diff changeset
  4160
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4161
findVersionMethod
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4162
    "{ Pragma: +optSpace }"
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4163
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4164
    "return my revision method. Either this is the sourceCodeManager-specific versionMethod,
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4165
     or the fallBack (for backward compatibility)"
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4166
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4167
    |owner|
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4168
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4169
    (owner := self owningClass) notNil ifTrue:[^ owner findVersionMethod].
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4170
    ^ self findVersionMethodOfManager:self sourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4171
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4172
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4173
     Smalltalk allClassesDo:[:cls |
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4174
        Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4175
     ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4176
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4177
     Number findVersionMethod   
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4178
     FileDirectory findVersionMethod     
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4179
     Metaclass findVersionMethod       
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4180
     Class findVersionMethod       
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4181
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4182
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4183
    "Modified: / 19-04-2011 / 13:30:42 / cg"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4184
!
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4185
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4186
findVersionMethodOfManager:aSourceCodemanagerOrNil
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4187
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4188
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4189
    "return my revision method. Either this is the sourceCodeManager-specific versionMethod,
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4190
     or the fallBack (for backward compatibility)"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4191
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4192
    |owner cls meta versionMethodsToTry|
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4193
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4194
    (owner := self owningClass) notNil ifTrue:[^ owner findVersionMethodOfManager:aSourceCodemanagerOrNil].
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4195
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4196
    meta := self theMetaclass.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4197
    cls := self theNonMetaclass.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4198
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4199
    "/ allow for sc-manager-specific version methods,
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4200
    "/ before falling back to the default version method.
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4201
    versionMethodsToTry := OrderedCollection new.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4202
    aSourceCodemanagerOrNil notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4203
        versionMethodsToTry add:aSourceCodemanagerOrNil nameOfVersionMethodInClasses.   
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4204
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4205
    versionMethodsToTry add:self nameOfVersionMethod.   "/ fallback
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4206
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4207
    versionMethodsToTry do:[:versionMethodsName |
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4208
        |aVersionMethod val|
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4209
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4210
        aVersionMethod := meta compiledMethodAt:versionMethodsName.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4211
        (aVersionMethod notNil and:[aVersionMethod isExecutable]) ifTrue:[
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4212
            "/
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4213
            "/ if it's a method returning the version string,
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4214
            "/ that's the returned value
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4215
            "/
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4216
            val := cls perform:versionMethodsName.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4217
            val isString ifTrue:[^ aVersionMethod].
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4218
        ].
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4219
    ].
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4220
    ^ nil.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4221
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4222
    "
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4223
     Smalltalk allClassesDo:[:cls |
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4224
        Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4225
     ].
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4226
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4227
     Number findVersionMethod   
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4228
     FileDirectory findVersionMethod     
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4229
     Metaclass findVersionMethod       
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4230
     Class findVersionMethod       
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4231
    "
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4232
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4233
    "Created: / 19-04-2011 / 13:30:05 / cg"
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4234
!
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4235
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4236
localSourceStreamFor:sourceFile
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4237
    "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
  4238
5073
9c92ad3f3a05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4876
diff changeset
  4239
    |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
  4240
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4241
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4242
    "/ old: look in 'source/<filename>'
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4243
    "/ 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
  4244
    "/ classes in her currentDirectory.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4245
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4246
    fileName := Smalltalk getSourceFileName:sourceFile.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4247
    fileName notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4248
        ^ fileName asFilename readStreamOrNil.
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4249
    ].
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4250
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4251
    (package := self package) notNil ifTrue:[
10009
72c87816423e fix typo
Stefan Vogel <sv@exept.de>
parents: 9959
diff changeset
  4252
        "/ newest scheme ...
13369
62969d3810b9 changed: #localSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 13342
diff changeset
  4253
        packageDir := Smalltalk findPackageDirectoryForPackage:package.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4254
        packageDir notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4255
            "/ present there ?
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4256
            packageDir := packageDir asFilename.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4257
            (fn := packageDir construct:sourceFile) exists ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4258
                ^ fn readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4259
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4260
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4261
            "/ a source subdirectory ?
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4262
            fn := (packageDir construct:'source') construct:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4263
            fn exists ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4264
                ^ fn readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4265
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4266
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4267
            "/ a zip-file ?
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4268
            fn := (packageDir construct:'source.zip').
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4269
            fn exists ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4270
                zar := ZipArchive oldFileNamed:fn.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4271
                zar notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4272
                    entry := zar extract:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4273
                    entry notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4274
                        ^ entry asString readStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4275
                    ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4276
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4277
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4278
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4279
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4280
        "/ will vanish ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4281
        (package includes:$:) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4282
            package := package asString copyReplaceAll:$: with:$/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4283
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4284
            package := 'stx/' , package
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4285
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4286
        fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4287
        fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4288
            ^ fileName asFilename readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4289
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4290
        (package startsWith:'stx/') ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4291
            fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4292
            fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4293
                ^ fileName asFilename readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4294
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4295
        ]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4296
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4297
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4298
    "/
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4299
    "/ new: look in 'source/<module>/<package>/<filename>
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4300
    "/ 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
  4301
    "/ obsolete.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4302
    info := self packageSourceCodeInfo.
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4303
    info notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4304
        module := info at:#module ifAbsent:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4305
        module notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4306
            dir := info at:#directory ifAbsent:nil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4307
            dir notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4308
                fn := (module asFilename construct:dir) construct:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4309
                fileName := Smalltalk getSourceFileName:(fn name).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4310
                fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4311
                    ^ fileName asFilename readStreamOrNil.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4312
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4313
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4314
                "/ brand new: look for source/<module>/package.zip
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4315
                "/ containing an entry for <filename>
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4316
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4317
                fn := (module asFilename construct:dir) withSuffix:'zip'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4318
                fileName := Smalltalk getSourceFileName:(fn name).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4319
                fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4320
                    zar := ZipArchive oldFileNamed:fileName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4321
                    zar notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4322
                        entry := zar extract:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4323
                        entry notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4324
                            ^ entry asString readStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4325
                        ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4326
                    ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4327
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4328
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4329
                "/ and also in source/source.zip ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4330
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4331
                fileName := Smalltalk getSourceFileName:'source.zip'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4332
                fileName notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4333
                    zar := ZipArchive oldFileNamed:fileName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4334
                    zar notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4335
                        entry := zar extract:sourceFile.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4336
                        entry notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4337
                            ^ entry asString readStream
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4338
                        ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4339
                    ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4340
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4341
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4342
        ]
2955
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4343
    ].
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4344
    ^ nil
3165
b6bde90005a8 also try package-subdir of source-dir for classes source
Claus Gittinger <cg@exept.de>
parents: 3064
diff changeset
  4345
3657
9e9fe2dd4c30 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4346
    "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
  4347
!
6411d359b747 Use Filename instead of obsolete FileDirectory
Stefan Vogel <sv@exept.de>
parents: 2917
diff changeset
  4348
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4349
nameOfVersionMethod
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4350
    "this is now more ore less obsolete, as multiple sourceCodeManagers might use
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4351
     different version_XXX methods. Keep this for backward compatibility."
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4352
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4353
    ^ #version
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4354
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4355
    "Modified: / 19-04-2011 / 13:42:18 / cg"
7174
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4356
!
a508fa893276 name of #version method at one place only
Claus Gittinger <cg@exept.de>
parents: 7128
diff changeset
  4357
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4358
packageSourceCodeInfo
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4359
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4360
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4361
    "return the sourceCodeInfo, which defines the module and the subdirectory
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4362
     in which the receiver class was built.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4363
     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
  4364
     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
  4365
     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
  4366
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4367
     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
  4368
     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
  4369
     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
  4370
     (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
  4371
     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
  4372
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
     By convention, this info is encoded in the classes package
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4374
     string (which is given as argument to stc) as the last word in parenthesis.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4375
     The info consists of 1 to 3 subcomponents, separated by colons.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4376
     The first defines the classes module (i.e. some application identifier),
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4377
     the second defines the subdirectory within that module, the third
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4378
     defines the name of the class library.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4379
     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
  4380
     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
  4381
     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
  4382
     (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
  4383
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4384
     For example:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4385
        '....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4386
        '....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4387
        '....(stx:foo:libbfoo)'                  -> module: stx directory: foo library: libfoo
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4388
        '....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4389
        '....(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
  4390
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4391
     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
  4392
     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
  4393
     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
  4394
     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
  4395
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4396
     Caveat:
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4397
        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
  4398
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4399
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4400
    |owner sourceInfo packageString idx1 idx2
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4401
     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
  4402
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4403
    (owner := self owningClass) notNil ifTrue:[^ owner packageSourceCodeInfo].
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4404
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4405
    package isNil ifTrue:[^ nil].
12219
dd55372693c1 Project noPackageId -> PackageId noPackageId
Claus Gittinger <cg@exept.de>
parents: 12197
diff changeset
  4406
    package == (PackageId noProjectID) ifTrue:[^ nil].
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4407
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4408
    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
  4409
    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
  4410
    idx1 ~~ 0 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4411
        idx2 := packageString indexOf:$) startingAt:idx1+1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4412
        idx2 ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4413
            sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4414
        ]
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4415
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4416
        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
  4417
    ].
2453
603af5a4e0fc handle degenerated package string from other modules,
Claus Gittinger <cg@exept.de>
parents: 2444
diff changeset
  4418
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4419
    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
  4420
    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
  4421
    components size == 0 ifTrue:[
2958
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4422
"/        moduleString := 'stx'.
ccfef4e0bd4a use filename protocol to construct fileNames (fileOut)
Claus Gittinger <cg@exept.de>
parents: 2955
diff changeset
  4423
"/        directoryString := libraryString := ''.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4424
        ^ nil
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4425
    ].
4116
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4426
ea4fe17d575b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4055
diff changeset
  4427
    component1 := components at:1.
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4428
    components size == 1 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4429
        "/ a single name given - the module becomes 'stx' or
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4430
        "/ the very first directory component (if such a module exists).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4431
        "/ If the component includes slashes, its the directory
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4432
        "/ otherwise the library.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4433
        "/
8737
8ddb74dc1833 Use Filename>>#newTemporary to create temp file
Stefan Vogel <sv@exept.de>
parents: 8726
diff changeset
  4434
        dirComponents := Filename components:component1.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4435
        (dirComponents size > 1
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4436
        and:[(mgr := self sourceCodeManager) notNil
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4437
        and:[mgr checkForExistingModule:dirComponents first]]) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4438
            moduleString := dirComponents first.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4439
            directoryString := libraryString := (Filename fromComponents:(dirComponents copyFrom:2)) asString.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4440
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4441
            "/ non-existing; assume directory under the stx package.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4442
            moduleString := 'stx'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4443
            (component1 startsWith:'stx/') ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4444
                component1 := component1 copyFrom:5
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4445
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4446
            directoryString := libraryString := component1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4447
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4448
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4449
        (libraryString includes:$/) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4450
            libraryString := libraryString asFilename baseName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4451
        ]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4452
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4453
        component2 := components at:2.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4454
        components size == 2 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4455
            "/ two components - assume its the module and the directory;
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4456
            "/ the library is assumed to be named after the directory
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4457
            "/ except, if slashes are in the name; then the libraryname
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4458
            "/ is the last component.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4459
            "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4460
            moduleString := component1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4461
            directoryString := libraryString := component2.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4462
            (libraryString includes:$/) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4463
                libraryString := libraryString asFilename baseName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4464
            ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4465
        ] ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4466
            "/ all components given
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4467
            moduleString := component1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4468
            directoryString := component2.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4469
            libraryString := components at:3.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4470
        ]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4471
    ].
2454
479b4c4bb05e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  4472
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4473
    libraryString isEmpty ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4474
        directoryString notEmpty ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4475
            libraryString := directoryString asFilename baseName
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4476
        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4477
        libraryString isEmpty ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4478
            "/ lets extract the library from the liblist file ...
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4479
            libraryString := Smalltalk libraryFileNameOfClass:self.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4480
            libraryString isNil ifTrue:[^ nil].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4481
        ]
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4482
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4483
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
    moduleString isEmpty ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4485
        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
  4486
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4487
    directoryString isEmpty ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4488
        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
  4489
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4490
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4491
    ^ IdentityDictionary
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4492
        with:(#module->moduleString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4493
        with:(#directory->directoryString)
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4494
        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
  4495
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4496
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4497
     Object packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4498
     View packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4499
     Model packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4500
     BinaryObjectStorage packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4501
     MemoryMonitor packageSourceCodeInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4502
     ClockView packageSourceCodeInfo
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4503
    "
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
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
    "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
  4506
    "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
  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
8770
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4509
projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4510
    "return my projects directory - thats where the sources, binaries, classLib, 
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4511
     resources etc. are typically found."
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4512
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4513
    ^ Smalltalk projectDirectoryForClass:self
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4514
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4515
    "
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4516
     Object projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4517
     View projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4518
     ApplicationModel projectDirectory
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4519
    "
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4520
!
58da3f88a882 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8756
diff changeset
  4521
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4522
resourceDirectory
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4523
    "return the directory where my resource file is supposed to live.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4524
     Here, take the package and assume that a directory named 'resources' exists
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4525
     in my package directory.
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4526
     Return nil, if no such directory exists."
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4527
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4528
    ^ Smalltalk resourceDirectoryForPackage:(self package)
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4529
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4530
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4531
     Object resourceDirectory
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4532
     View resourceDirectory
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4533
     ApplicationModel resourceDirectory
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4534
    "
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4535
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4536
    "Modified: / 19-10-2006 / 23:08:37 / cg"
7866
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4537
!
6624a55c7dd0 resourceDirectory
Claus Gittinger <cg@exept.de>
parents: 7833
diff changeset
  4538
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4539
resourcePackName
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4540
    "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
  4541
     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
  4542
     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
  4543
     The default here is the classes name - this can be redefined in classes
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4544
     which want to use another classes resources (NewLauncher -> Launcher)."
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4545
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4546
    ^ self name
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4547
10102
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4548
    "Created: / 29-01-1998 / 22:20:12 / cg"
729c151ddff1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10084
diff changeset
  4549
    "Modified: / 19-10-2006 / 23:11:57 / cg"
3248
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4550
!
99c249e6a797 provide a redefinable method to aquire a resourcePack name
Claus Gittinger <cg@exept.de>
parents: 3229
diff changeset
  4551
8267
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4552
resourcePackage
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4553
    "return the package from where my resources are loaded.
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4554
     By default, that is the classes package."
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4555
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4556
    ^ self package
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4557
!
ca8d1b9dc4b9 resource package
Claus Gittinger <cg@exept.de>
parents: 8230
diff changeset
  4558
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4559
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
  4560
    "return the revision-ID of the class which corresponds to the
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4561
     cvs-id of the source to which this class is equivalent.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4562
     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
  4563
     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
  4564
     the old revision, while logically, the class has the new (checked-in) revision.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4565
     To check if a source corresponds to a compiled binary, compare this
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4566
     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
  4567
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4568
    |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
  4569
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4570
    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
  4571
    info notNil ifTrue:[
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4572
        ^ info 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
  4573
    ].
2500
c217e646447e 'revision' instvar may now be both a number ('1.12') and a
Stefan Vogel <sv@exept.de>
parents: 2493
diff changeset
  4574
    ^ 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
  4575
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4576
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4577
     Object revision
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4578
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4579
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4580
    "Created: / 11-11-1995 / 14:27:20 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4581
    "Modified: / 26-03-1997 / 00:14:00 / stefan"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4582
    "Modified: / 22-10-2008 / 20:37:59 / 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
  4583
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4584
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4585
revisionDateString
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4586
    "return the revision-Date of the class as a string.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4587
     This is extracted from the version string."
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4588
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4589
    |info|
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4590
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4591
    info := self revisionInfo.
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4592
    info notNil ifTrue:[
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4593
        ^ (info date) ? '??/??/??'
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4594
    ].
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4595
    ^ '??/??/??'
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4596
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4597
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4598
     Object revisionDateString
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4599
    "
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4600
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4601
    "Created: / 23-04-1997 / 12:29:21 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4602
    "Modified: / 22-10-2008 / 20:38:25 / cg"
2582
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4603
!
6d443f8adb86 added #revisionDateString
Claus Gittinger <cg@exept.de>
parents: 2568
diff changeset
  4604
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4605
revisionInfo
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4606
    "return an object filled with revision info.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4607
     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
  4608
     The revisionInfo contains all or a subset of:
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4609
        binaryRevision - the revision upon which the binary of this class is based
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4610
        revision       - the revision upon which the class is based logically
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4611
                          (different, if a changed class was checked in, but not yet recompiled)
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4612
        user           - the user who checked in the logical revision
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4613
        date           - the date when the logical revision was checked in
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4614
        time           - the time when the logical revision was checked in
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4615
        fileName       - the classes source file name
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4616
        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
  4617
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4618
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4619
    ^ self revisionInfoOfManager:self sourceCodeManager
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4620
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4621
    "
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4622
     Object revisionString
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4623
     Object revisionInfo
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4624
     Image revisionInfo
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4625
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4626
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4627
    "Created: / 11-11-1995 / 14:27:20 / cg"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4628
    "Modified: / 26-03-1997 / 00:13:17 / stefan"
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4629
    "Modified: / 19-04-2011 / 13:41:24 / cg"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4630
!
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4631
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4632
revisionInfoOfManager:aSourceCodemanagerOrNil
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4633
    "return an object filled with revision info.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4634
     This extracts the relevant info from the revisionString.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4635
     The revisionInfo contains all or a subset of:
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4636
        binaryRevision - the revision upon which the binary of this class is based
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4637
        revision       - the revision upon which the class is based logically
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4638
                          (different, if a changed class was checked in, but not yet recompiled)
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4639
        user           - the user who checked in the logical revision
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4640
        date           - the date when the logical revision was checked in
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4641
        time           - the time when the logical revision was checked in
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4642
        fileName       - the classes source file name
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4643
        repositoryPath - the classes source container
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4644
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4645
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4646
    |vsnString info|
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4647
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4648
    aSourceCodemanagerOrNil notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4649
        vsnString := self revisionStringOfManager:aSourceCodemanagerOrNil.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4650
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4651
    vsnString isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4652
        vsnString := self revisionStringOfManager:nil.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4653
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4654
    vsnString isNil ifTrue:[^ nil].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4655
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4656
    aSourceCodemanagerOrNil notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4657
        info := aSourceCodemanagerOrNil revisionInfoFromString:vsnString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4658
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4659
        info := Class revisionInfoFromString:vsnString.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4660
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4661
    info notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4662
        info binaryRevision:self binaryRevision.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4663
    ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4664
    ^ info
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4665
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4666
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4667
     Object revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4668
     Object revisionInfo
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4669
     Image revisionInfo
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4670
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4671
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4672
    "Modified: / 26-03-1997 / 00:13:17 / stefan"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4673
    "Created: / 19-04-2011 / 13:41:13 / 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
  4674
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4675
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4676
revisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4677
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4678
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4679
    "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
  4680
     classes #version method. Either this is a method returning that string,
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4681
     or it's a comment-only method and the comment defines the version.
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4682
     If the receiver is unloaded, or the source is not accessable,
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4683
     or no such method exists, then nil is returned."
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4684
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4685
    ^ self revisionStringOfManager:nil
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4686
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4687
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4688
     Smalltalk allClassesDo:[:cls |
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4689
        Transcript show:cls name; show:' -> '; showCR:cls revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4690
     ].
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4691
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4692
     Number revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4693
     FileDirectory revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4694
     Metaclass revisionString
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4695
    "
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4696
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4697
    "Created: / 29-10-1995 / 19:28:03 / cg"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4698
    "Modified: / 01-04-1997 / 23:37:25 / stefan"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4699
    "Modified: / 07-02-2001 / 18:03:39 / ps"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4700
    "Modified: / 19-04-2011 / 13:38:07 / cg"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4701
!
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4702
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4703
revisionStringOfManager:aSourceCodeManagerOrNil
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4704
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4705
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4706
    "return my revision string; that one is extracted from the
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4707
     classes #version method. Either this is a method returning that string,
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4708
     or it's a comment-only method and the comment defines the version.
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4709
     If the receiver is unloaded, or the source is not accessable,
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4710
     or no such method exists, then nil is returned."
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4711
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4712
    |owner versionMethod|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4713
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4714
    (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
  4715
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4716
    versionMethod := self findVersionMethodOfManager:aSourceCodeManagerOrNil.
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4717
    versionMethod notNil ifTrue:[
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4718
        ^ versionMethod valueWithReceiver:(self theNonMetaclass) arguments:#()
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4719
    ].
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4720
    ^ 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
  4721
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4722
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4723
     Smalltalk allClassesDo:[:cls |
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4724
        Transcript show:cls name; show:' -> '; 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
  4725
     ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4726
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4727
     Number revisionString
2666
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4728
     FileDirectory revisionString
7981b615b48a Make Metaclass a subclass of ClassDescription instead of Class.
Stefan Vogel <sv@exept.de>
parents: 2659
diff changeset
  4729
     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
  4730
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4731
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4732
    "Modified: / 01-04-1997 / 23:37:25 / stefan"
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4733
    "Modified: / 07-02-2001 / 18:03:39 / ps"
13342
Claus Gittinger <cg@exept.de>
parents: 13221
diff changeset
  4734
    "Created: / 19-04-2011 / 13:37:42 / 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
  4735
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4736
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4737
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
  4738
    "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
  4739
     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
  4740
     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
  4741
     (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
  4742
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4743
    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
  4744
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4745
    "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
  4746
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4747
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4748
setPackageFromRevision
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4749
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4750
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4751
    "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
  4752
     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
  4753
     (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
  4754
      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
  4755
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4756
    |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
  4757
1756
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4758
    self owningClass notNil ifTrue:[^ self].
d2518afa9df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1754
diff changeset
  4759
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4760
    mgr := self sourceCodeManager.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4761
    mgr notNil ifTrue:[
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4762
        info := mgr sourceInfoOfClass:self.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4763
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4764
        info notNil ifTrue:[
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4765
            mod := info at:#module ifAbsent:nil.    "/ stx, aeg, <your-organization>
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4766
            dir := info at:#directory ifAbsent:nil. "/ libbasic, libtool ...
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4767
            lib := info at:#library ifAbsent:dir.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4768
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4769
            p := ''.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4770
            mod notNil ifTrue:[
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4771
"/            mod ~= 'stx' ifTrue:[
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4772
                    p := p , mod
4012
e87e53bc45a6 when autoloading, directory info has priority over
Claus Gittinger <cg@exept.de>
parents: 3997
diff changeset
  4773
"/            ]
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4774
            ].
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4775
            dir notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4776
                p notEmpty ifTrue:[p := p , ':'].
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4777
                p := p , dir.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4778
            ] ifFalse:[
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4779
                lib notNil ifTrue:[
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4780
                    p notEmpty ifTrue:[p := p , ':'].
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4781
                    p := p , lib.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4782
                ].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4783
            ].
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4784
            (p notEmpty and:[p ~= package]) ifTrue:[
2072
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4785
"/            package notNil ifTrue:[
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4786
"/                (name , ': changing packageID from ''' , package , ''' to ''' , p , '''') infoPrintCR.
e84dbf5e5424 removed package-change info message
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  4787
"/            ].
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4788
                package := p.
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4789
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4790
                self methodDictionary do:[:aMethod |
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4791
                    aMethod package isNil ifTrue:[
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4792
                        aMethod setPackage:p
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4793
                    ]
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4794
                ]
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4795
            ].
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4796
        ].
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4797
    ].
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4798
    ^ self
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4799
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4800
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4801
     MemoryMonitor autoload.
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4802
     MemoryMonitor setPackageFromRevision
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4803
    "
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4804
9839
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4805
    "Modified: / 12-06-1996 / 11:49:31 / stefan"
e8640b794983 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
  4806
    "Modified: / 12-09-2006 / 14:15:47 / cg"
937
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4807
!
f2243cbb7ae0 set package info when autoloading; flush cachedClasses when unloading
Claus Gittinger <cg@exept.de>
parents: 934
diff changeset
  4808
8230
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  4809
sourceFileSuffix
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  4810
    ^ self class sourceFileSuffix
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  4811
!
56d6ed5e7cca let the metaclass do the fileOut
ca
parents: 8222
diff changeset
  4812
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4813
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
  4814
    "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
  4815
11429
b863adcf4b12 refactored
Claus Gittinger <cg@exept.de>
parents: 11413
diff changeset
  4816
    |owner source stream|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4817
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4818
    (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
  4819
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4820
    classFilename notNil ifTrue:[
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4821
        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
  4822
    ] ifFalse:[
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4823
        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
  4824
    ].
8149
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4825
    stream := self sourceStreamFor:source.
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4826
    stream notNil ifTrue:[
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8605
diff changeset
  4827
        "/ see if its utf8 encoded...
12606
18ce223ec106 code move
Claus Gittinger <cg@exept.de>
parents: 12517
diff changeset
  4828
        stream := EncodedStream decodedStreamFor:stream.
8149
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4829
    ].
c0b336aacec6 utf8-check
Claus Gittinger <cg@exept.de>
parents: 8102
diff changeset
  4830
    ^ stream.
953
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4831
!
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4832
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4833
sourceStreamFor:source
a3c14f2bf1e9 metaclasses return a valid binaryRevision, too
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  4834
    "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
  4835
12509
0a69e1d87ba3 comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents: 12507
diff changeset
  4836
    |owner sourceStream sourceCodeManager validated guessedFileName sep mod dir|
1754
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4837
9ce8fd84ebe8 more message delegation from private classes
Claus Gittinger <cg@exept.de>
parents: 1753
diff changeset
  4838
    (owner := self owningClass) notNil ifTrue:[^ owner sourceStreamFor:source].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4839
    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
  4840
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4841
    "/
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4842
    "/ if there is no SourceCodeManager,
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4843
    "/ or TryLocalSourceFirst is true,
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4844
    "/ 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
  4845
    "/
12509
0a69e1d87ba3 comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents: 12507
diff changeset
  4846
    ((sourceCodeManager := self sourceCodeManager) isNil
892
2b680edcd115 optionally allow localSources to override sourceManager files
Claus Gittinger <cg@exept.de>
parents: 888
diff changeset
  4847
    or:[TryLocalSourceFirst == true]) ifTrue:[
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4848
        sourceStream := 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
  4849
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4850
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4851
    sourceStream isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4852
        "/ mhmh - still no source file.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4853
        "/ If there is a SourceCodeManager, ask it to aquire the
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4854
        "/ the source for my class, and return an open stream on it.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4855
        "/ if that one does not know about the source, look in
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4856
        "/ standard places
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4857
12509
0a69e1d87ba3 comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents: 12507
diff changeset
  4858
        sourceCodeManager notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4859
            classFilename ~= source ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4860
                sep := self package indexOfAny:'/\:'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4861
                sep ~~ 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4862
                    mod := package copyTo:sep - 1.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4863
                    dir := package copyFrom:sep + 1.
12517
41a810c685de changed: #sourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 12509
diff changeset
  4864
self breakPoint:#fm.
12509
0a69e1d87ba3 comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents: 12507
diff changeset
  4865
                    sourceStream := sourceCodeManager streamForClass:nil fileName:source revision:(self binaryRevision) directory:dir module:mod cache:true.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4866
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4867
            ].
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4868
            sourceStream isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4869
                classFilename isNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4870
                    guessedFileName := (Smalltalk fileNameForClass:self) , '.st'.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4871
                ].
12633
843af03b1517 changed: #sourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 12606
diff changeset
  4872
                source asFilename baseName = (classFilename ? guessedFileName) asFilename baseName ifTrue:[
12509
0a69e1d87ba3 comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents: 12507
diff changeset
  4873
                    sourceStream := sourceCodeManager getSourceStreamFor:self.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4874
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4875
            ].
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4876
            sourceStream notNil ifTrue:[
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4877
                (self validateSourceStream:sourceStream) ifFalse:[
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4878
                    ('Class [info]: repositories source for "%1" is invalid.' bindWith:self theNonMetaclass name) errorPrintCR.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4879
                    sourceStream close.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4880
                    sourceStream := nil
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4881
                ] ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4882
                    validated := true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4883
                ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4884
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4885
        ]
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4886
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4887
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4888
    sourceStream isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4889
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4890
        "/ hard case - there is no source file for this class
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4891
        "/ (in the source-dir-path).
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4892
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4893
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4894
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4895
        "/ look if my binary is from a dynamically loaded module,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4896
        "/ and, if so, look in the modules directory for the
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4897
        "/ source file.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4898
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4899
        ObjectFileLoader notNil ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4900
            ObjectFileLoader loadedObjectHandlesDo:[:h |
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4901
                |f classes|
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4902
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4903
                sourceStream isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4904
                    (classes := h classes) size > 0 ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4905
                        (classes includes:self) ifTrue:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4906
                            f := h pathName.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4907
                            f := f asFilename directory.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4908
                            f := f construct:source.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4909
                            f exists ifTrue:[
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4910
                                sourceStream := f readStreamOrNil.
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4911
                            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4912
                        ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4913
                    ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4914
                ]
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4915
            ].
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4916
        ].
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4917
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4918
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4919
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4920
    "/ try along sourcePath
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4921
    "/
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4922
    sourceStream isNil ifTrue:[
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4923
        sourceStream := self localSourceStreamFor:source.
5116
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4924
    ].
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4925
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4926
    "/
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4927
    "/ final chance: try current directory
df218693a2dc always try the sourceCodeManager first (even when fetching a package-
ca
parents: 5073
diff changeset
  4928
    "/
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4929
    sourceStream isNil ifTrue:[
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4930
        sourceStream := source asFilename readStreamOrNil.
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4931
    ].
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4932
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4933
    (sourceStream notNil and:[validated not]) ifTrue:[
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4934
        (self validateSourceStream:sourceStream) ifFalse:[
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4935
            ('Class [warning]: source for "%1" is invalid or stripped. Take care.' bindWith:self theNonMetaclass name) errorPrintCR.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4936
            sourceStream close.
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4937
            sourceStream := nil
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4938
        ].
1909
66fc00f58885 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
  4939
    ].
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4940
"/    (sourceStream notNil and:[sourceStream isFileStream]) ifTrue:[
9610
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  4941
"/        guessedFileName notNil ifTrue:[
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  4942
"/            self setClassFilename:(aStream pathName asFilename baseName).
b523b76eb103 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9497
diff changeset
  4943
"/        ]
12014
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4944
"/    ].
a0c7fef7565c added: #versionManagement
Claus Gittinger <cg@exept.de>
parents: 12004
diff changeset
  4945
    ^ 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
  4946
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4947
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4948
     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
  4949
     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
  4950
     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
  4951
    "
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4952
3391
e012d2965887 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3390
diff changeset
  4953
    "Created: / 10.11.1995 / 21:05:13 / cg"
e012d2965887 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3390
diff changeset
  4954
    "Modified: / 22.4.1998 / 19:20:50 / ca"
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4955
    "Modified: / 5.11.2001 / 16:36:30 / cg"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4956
!
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4957
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4958
updateVersionMethodFor:newRevisionString
1843
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4959
    "{ Pragma: +optSpace }"
15df4adc5b70 some methods are compiled for space
Claus Gittinger <cg@exept.de>
parents: 1824
diff changeset
  4960
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  4961
    "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
  4962
     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
  4963
12044
0d31c1727d68 changed: #updateVersionMethodFor:
fm
parents: 12020
diff changeset
  4964
    "/ for backward compatibility - however, please change callers...
0d31c1727d68 changed: #updateVersionMethodFor:
fm
parents: 12020
diff changeset
  4965
    ^ self sourceCodeManager updateVersionMethodOf:self for:newRevisionString
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4966
!
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4967
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4968
validateSourceStream:aStream
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4969
    "check if aStream really contains my source.
12509
0a69e1d87ba3 comment/format in: #validateSourceStream:
Claus Gittinger <cg@exept.de>
parents: 12507
diff changeset
  4970
     This is done by checking the version method's return value
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4971
     against the version string as contained in the version method.
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  4972
     This helps to detect mangled source code."
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4973
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4974
    |cls meta cannotCheckReason versionMethod info
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4975
     versionFromCode versionFromSource oldPos pos src rev|
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4976
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  4977
    meta := self theMetaclass.
6150
4f05c7815f4a isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6137
diff changeset
  4978
    cls := self theNonMetaclass.
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4979
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  4980
    cannotCheckReason := nil.
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4981
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4982
    versionMethod := self findVersionMethod.
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4983
    versionMethod isNil ifTrue:[
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4984
        cannotCheckReason := 'no valid version method'.
2544
c3a2791de289 care for unloaded methods, when validating the source revision
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
  4985
    ] ifFalse:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4986
        "/
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4987
        "/ if its a method returning the string,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4988
        "/ thats the returned value
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4989
        "/
12103
ed82da6dace4 added: #findVersionMethod
fm
parents: 12052
diff changeset
  4990
        versionFromCode := versionMethod valueWithReceiver:cls arguments:#().
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4991
        versionFromCode isString ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4992
            cannotCheckReason := 'version method does not return a string'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  4993
        ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4994
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4995
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4996
    "/
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4997
    "/ 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
  4998
    "/ 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
  4999
    "/ 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
  5000
    "/ 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
  5001
    "/ for the source ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5002
    "/
1942
b9d11ab9a1ec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1938
diff changeset
  5003
    versionMethod notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5004
        pos := versionMethod sourcePosition.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5005
        pos isInteger ifFalse:[
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5006
            "/ mhmh - either no version method,
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5007
            "/ or updated due to a checkin.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5008
            "/ in any case, this should be a good source.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5009
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5010
            ^ true.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5011
            "/ cannotCheckReason := 'no source position for version-method'
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5012
        ]
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5013
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5014
1766
5c07f58a54c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  5015
    cannotCheckReason notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5016
        ('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5017
        'Class [info]: cannot validate source; trusting source' infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5018
        ^ true
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5019
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5020
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5021
    oldPos := aStream position.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  5022
    Stream positionErrorSignal handle:[:ex |
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5023
        'Class [info]: position error when accessing source' infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5024
        ^ false
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  5025
    ] do:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5026
        aStream position1Based:pos.
3371
1d8aa07c4b7f care for position-error when validating source
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
  5027
    ].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5028
    src := aStream nextChunk.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5029
    aStream position:oldPos.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5030
9063
953b305e35d6 isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5031
    (src isEmptyOrNil) ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5032
        'Class [info]: empty source for version-method' infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5033
        ^ false
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5034
    ].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5035
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5036
    versionFromSource := Class revisionStringFromSource:src.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5037
    versionFromSource = versionFromCode ifTrue:[^ true].
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5038
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  5039
    versionFromSource isNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5040
        'Class [info]: version-from source is nil' infoPrintCR.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5041
        ^ false
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  5042
    ].
1786
6a60221f0c77 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1779
diff changeset
  5043
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5044
    "/ mhmh - check my binary version ...
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5045
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5046
    info := Class revisionInfoFromString:versionFromSource.
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5047
    info notNil ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5048
        rev := info at:#revision.
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5049
        rev = self binaryRevision ifTrue:[^ true].
1765
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5050
    ].
4784
8616fba1e9e3 source access fixed.
Claus Gittinger <cg@exept.de>
parents: 4752
diff changeset
  5051
    '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
  5052
    ^ false
64e428dbb53d validate the stream as returned by the srcManager
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  5053
11277
8a3339bf1d7f versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 11261
diff changeset
  5054
    "Modified: / 22-10-2008 / 20:30:36 / cg"
12015
fm
parents: 12014
diff changeset
  5055
!
fm
parents: 12014
diff changeset
  5056
fm
parents: 12014
diff changeset
  5057
versionMethodTemplateForSourceCodeManager:aSourceCodeManager
fm
parents: 12014
diff changeset
  5058
fm
parents: 12014
diff changeset
  5059
    ^self class versionMethodTemplateForSourceCodeManager:aSourceCodeManager
fm
parents: 12014
diff changeset
  5060
fm
parents: 12014
diff changeset
  5061
    "Created: / 16-08-2009 / 12:57:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
773
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5062
! !
1ff2f5af29cc category changes / return proper sourceManager, even if access is disabled (in Launchers setting box)
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  5063
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5064
!Class::ClassAttributes class methodsFor:'documentation'!
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5065
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5066
documentation
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5067
"
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5068
    Instances hold additional attributes of a class.
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5069
    Currently, these are primitive definitions and sharedPools information.
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5070
    As these are seldom needed, they are only present as object in some classes
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5071
    thus saving us from mostly empty additional slots in the class object itself for most classes
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5072
"
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5073
! !
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5074
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5075
!Class::ClassAttributes methodsFor:'accessing'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5076
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5077
localSelectors
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5078
    ^ localSelectors
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5079
!
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5080
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5081
localSelectors:something
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5082
    localSelectors := something.
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5083
!
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5084
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5085
primitiveDefinitions
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5086
    ^ primitiveDefinitions
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5087
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5088
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5089
primitiveDefinitions:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5090
    primitiveDefinitions := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5091
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5092
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5093
primitiveFunctions
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5094
    ^ primitiveFunctions
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5095
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5096
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5097
primitiveFunctions:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5098
    primitiveFunctions := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5099
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5100
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5101
primitiveVariables
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5102
    ^ primitiveVariables
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5103
!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5104
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5105
primitiveVariables:something
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5106
    primitiveVariables := something.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5107
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5108
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5109
sharedPools
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5110
    ^ sharedPools
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5111
!
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5112
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5113
sharedPools:something
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5114
    sharedPools := something.
12259
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5115
!
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5116
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5117
traitComposition
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5118
    ^ traitComposition
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5119
!
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5120
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5121
traitComposition:something
bcf1c65266c3 changed:
Claus Gittinger <cg@exept.de>
parents: 12219
diff changeset
  5122
    traitComposition := something.
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5123
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5124
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5125
!Class::ClassAttributes methodsFor:'conversion'!
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5126
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5127
fromSTCPrimitiveArray:anArray
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5128
    "for now, the stc compiler generates a 3- or 4-element primitive spec array
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5129
     (it does not know anything about the ClassAttributes class).
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5130
     This method is invoked to convert."
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5131
7463
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5132
    primitiveDefinitions := anArray at:1.
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5133
    primitiveVariables := anArray at:2.
3d74f00e444b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7435
diff changeset
  5134
    primitiveFunctions := anArray at:3.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5135
    anArray size > 3 ifTrue:[
8726
3eeeb7f22720 *** empty log message ***
james
parents: 8720
diff changeset
  5136
        sharedPools := anArray at:4.
8551
de314b9f8fa3 sharedPools
ca
parents: 8532
diff changeset
  5137
    ].
7369
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5138
! !
e8d914774426 primitiveSpec changed to attributes object.
Claus Gittinger <cg@exept.de>
parents: 7368
diff changeset
  5139
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5140
!Class::SimulatedClassPool class methodsFor:'documentation'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5141
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5142
documentation
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5143
"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5144
    in contrast to other smalltalks, ST/X does not keep the classVariables
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5145
    in a dictionary; instead, classVariables are stored as special globals,
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5146
    with the className as prefix (colon-separated).
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5147
    The reason is that stc-compiled code should be allowed to access classVars
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5148
    in a similar fashion to globals.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5149
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5150
    Whenever a classes classPool is requested, an instance of myself is
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5151
    created, which forwards at: and at:put: messages to the original class.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5152
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5153
    This is an additional goody class; therefore:
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5154
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5155
    THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5156
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5157
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5158
    ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5159
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5160
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5161
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5162
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5163
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5164
    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5165
    SUCH DAMAGE.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5166
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5167
    [author:]
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5168
        Claus Gittinger
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5169
"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5170
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5171
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5172
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5173
!Class::SimulatedClassPool methodsFor:'accessing'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5174
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5175
associationAt:aName
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5176
    "simulate an association"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5177
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5178
    ^ SimulatedVariableBinding key:aName value:(class classVarAt:aName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5179
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5180
    "Modified: / 4.2.2000 / 00:27:40 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5181
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5182
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5183
associationAt:aName ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5184
    "simulate an association"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5185
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5186
    |internalName cls|
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5187
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5188
    cls := class theNonMetaclass. 
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5189
    internalName := (cls name , ':' , aName) asSymbol.
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5190
    ^ SimulatedVariableBinding key:internalName value:(cls classVarAt:aName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5191
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5192
    "Created: / 3.2.2000 / 23:30:07 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5193
    "Modified: / 4.2.2000 / 01:58:56 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5194
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5195
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5196
associationsDo:aBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5197
    "evaluate aBlock for all of my simulated classVarName->value associations"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5198
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5199
    class classVarNames do:[:eachName |
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5200
        aBlock value:(self associationAt:eachName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5201
    ].
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5202
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5203
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5204
at:aKey
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5205
    ^ class classVarAt:aKey
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5206
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5207
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5208
at:aKey ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5209
    ^ class classVarAt:aKey ifAbsent:exceptionBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5210
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5211
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5212
at:aKey put:something
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5213
    ^ class classVarAt:aKey put:something
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5214
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5215
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5216
keys
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5217
    ^ class classVarNames collect:[:nm | nm asSymbol]
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5218
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5219
    "
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5220
     Button classPool keys 
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5221
     Button classPool at:#ReturnForm
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5222
    "
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5223
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5224
!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5225
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5226
keysAndValuesDo:aBlock
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5227
    "evaluate aBlock for all of my simulated classVarName->value associations"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5228
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5229
    class classVarNames do:[:eachName |
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5230
        aBlock value:eachName value:(class classVarAt:eachName)
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5231
    ].
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5232
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5233
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5234
!Class::SimulatedClassPool methodsFor:'accessing-private'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5235
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5236
setClass:aClass
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5237
    class := aClass
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5238
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5239
12020
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5240
!Class::SimulatedClassPool::SimulatedVariableBinding class methodsFor:'documentation'!
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5241
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5242
documentation
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5243
"
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5244
    Instances are returned from the simulated classPool for VW compatibility.
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5245
"
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5246
! !
bf2165daff68 changed: #classFilename
Claus Gittinger <cg@exept.de>
parents: 12018
diff changeset
  5247
8605
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5248
!Class::SimulatedClassPool::SimulatedVariableBinding methodsFor:'queries'!
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5249
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5250
isVariableBinding
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5251
     ^ true
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5252
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5253
    "Created: / 4.2.2000 / 00:27:20 / cg"
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5254
! !
12e3a0f16d76 Make SimulatedClassPool a private class of Class.
Stefan Vogel <sv@exept.de>
parents: 8561
diff changeset
  5255
1739
64afb1cba77d fixed name - printing;
Claus Gittinger <cg@exept.de>
parents: 1735
diff changeset
  5256
!Class class methodsFor:'documentation'!
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  5257
12044
0d31c1727d68 changed: #updateVersionMethodFor:
fm
parents: 12020
diff changeset
  5258
version_CVS
13418
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
  5259
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.583 2011-06-28 13:16:04 vrany Exp $'
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
  5260
!
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
  5261
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
  5262
version_SVN
99d8ad133755 Jan's changes
vrany
parents: 13374
diff changeset
  5263
    ^ ' Id: Class.st 10643 2011-06-08 21:53:07Z vranyj1  '
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  5264
! !