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