author | Claus Gittinger <cg@exept.de> |
Tue, 21 Mar 2000 13:42:50 +0100 | |
changeset 909 | 2af6462c44ff |
parent 897 | d46a2564eba8 |
child 932 | 8028d375f842 |
permissions | -rw-r--r-- |
3 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
38 | 3 |
All Rights Reserved |
3 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
0 | 12 |
|
13 |
Object subclass:#Change |
|
235 | 14 |
instanceVariableNames:'source' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'System-Changes' |
|
0 | 18 |
! |
19 |
||
633 | 20 |
!Change class methodsFor:'documentation'! |
9 | 21 |
|
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
38 | 25 |
All Rights Reserved |
9 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
abstract superclass for all kind of changes - managed in changeSets. |
|
235 | 39 |
|
40 |
[author:] |
|
41 |
Claus Gittinger |
|
9 | 42 |
" |
43 |
! ! |
|
44 |
||
647 | 45 |
!Change methodsFor:'accessing'! |
46 |
||
850 | 47 |
changeClass |
48 |
"the class of the change (nil if not present)" |
|
49 |
||
50 |
^ nil |
|
51 |
||
52 |
! |
|
53 |
||
54 |
changeSelector |
|
55 |
^ nil |
|
56 |
||
57 |
"Created: / 6.2.1998 / 13:29:35 / cg" |
|
58 |
! |
|
59 |
||
647 | 60 |
className |
61 |
"the className of the change" |
|
62 |
||
63 |
^ nil |
|
64 |
||
65 |
"Modified: / 15.7.1996 / 09:26:34 / cg" |
|
66 |
"Created: / 6.2.1998 / 13:06:56 / cg" |
|
67 |
! |
|
68 |
||
909 | 69 |
file |
70 |
^ nil "/ to be added as instvar |
|
71 |
! |
|
72 |
||
73 |
file:aFile position:anInteger |
|
74 |
^ self "/ to be added |
|
75 |
! |
|
76 |
||
77 |
objectType:aSymbol |
|
78 |
^ self "/ to be added as instvar |
|
79 |
! |
|
80 |
||
647 | 81 |
selector |
82 |
^ nil |
|
83 |
||
84 |
"Created: / 6.2.1998 / 13:29:35 / cg" |
|
787 | 85 |
! |
86 |
||
87 |
source |
|
88 |
"return the source of the change" |
|
89 |
||
90 |
^ source |
|
91 |
||
92 |
"Modified: 15.7.1996 / 09:26:34 / cg" |
|
93 |
! |
|
94 |
||
95 |
source:someString |
|
96 |
"set the source of the change" |
|
97 |
||
98 |
source := someString |
|
99 |
||
100 |
"Modified: / 15.7.1996 / 09:26:34 / cg" |
|
101 |
"Created: / 16.2.1998 / 13:05:16 / cg" |
|
647 | 102 |
! ! |
103 |
||
849 | 104 |
!Change methodsFor:'applying'! |
105 |
||
106 |
apply |
|
107 |
"apply the change" |
|
108 |
||
109 |
self subclassResponsibility |
|
110 |
! ! |
|
111 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
112 |
!Change methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
113 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
114 |
isForSameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
115 |
"return true, if the given change represents a change for the same |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
116 |
thingy as the receiver (i.e. same method, same definition etc.)." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
117 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
118 |
^ false |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
119 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
120 |
! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
121 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
122 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
123 |
"return true, if the given change represents the same change as the receiver." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
124 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
125 |
^ false |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
126 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
127 |
! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
128 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
129 |
sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
130 |
"return true, if the given change has the same source as the receiver." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
131 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
132 |
|sourceA sourceB| |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
133 |
|
852 | 134 |
(sourceA := self source) = (sourceB := changeB source) ifTrue:[^ true]. |
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
135 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
136 |
sourceA := sourceA asCollectionOfLines. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
137 |
sourceB := sourceB asCollectionOfLines. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
138 |
sourceA size ~~ sourceB size ifTrue:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
139 |
sourceA := sourceA collect:[:line | line withTabsExpanded withoutTrailingSeparators]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
140 |
sourceB := sourceB collect:[:line | line withTabsExpanded withoutTrailingSeparators]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
141 |
^ sourceA = sourceB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
142 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
143 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
144 |
|
778 | 145 |
!Change methodsFor:'printing & storing'! |
146 |
||
897 | 147 |
printStringWithoutClassName |
778 | 148 |
|s| |
149 |
||
150 |
s := '' writeStream. |
|
897 | 151 |
self printWithoutClassNameOn:s. |
778 | 152 |
^ s contents |
153 |
||
154 |
||
155 |
! |
|
156 |
||
897 | 157 |
printWithoutClassNameOn:aStream |
778 | 158 |
self printOn:aStream |
159 |
||
160 |
||
161 |
! ! |
|
162 |
||
651 | 163 |
!Change methodsFor:'queries'! |
164 |
||
777 | 165 |
isClassCommentChange |
166 |
^ false |
|
167 |
||
168 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
169 |
! |
|
170 |
||
771 | 171 |
isClassDefinitionChange |
172 |
^ false |
|
173 |
||
174 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
175 |
! |
|
176 |
||
798 | 177 |
isClassInstVarDefinitionChange |
178 |
^ false |
|
179 |
||
180 |
! |
|
181 |
||
773 | 182 |
isDoIt |
183 |
^ false |
|
184 |
||
185 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
186 |
! |
|
187 |
||
651 | 188 |
isMethodChange |
189 |
^ false |
|
190 |
||
191 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
783 | 192 |
! |
193 |
||
194 |
isPrimitiveChange |
|
195 |
^ false |
|
196 |
||
197 |
! |
|
198 |
||
199 |
isPrimitiveDefinitionsChange |
|
200 |
^ false |
|
201 |
||
202 |
! |
|
203 |
||
204 |
isPrimitiveFunctionsChange |
|
205 |
^ false |
|
206 |
||
207 |
! |
|
208 |
||
209 |
isPrimitiveVariablesChange |
|
210 |
^ false |
|
211 |
||
651 | 212 |
! ! |
213 |
||
633 | 214 |
!Change class methodsFor:'documentation'! |
235 | 215 |
|
216 |
version |
|
909 | 217 |
^ '$Header: /cvs/stx/stx/libbasic3/Change.st,v 1.28 2000-03-21 12:42:50 cg Exp $' |
235 | 218 |
! ! |