1 //!ExtractConstantInt |
|
2 //#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest |
|
3 //@A.h |
|
4 #ifndef A_H_ |
|
5 #define A_H_ |
|
6 |
|
7 class A |
|
8 { |
|
9 public: |
|
10 A(); |
|
11 virtual ~A(); |
|
12 int foo(); |
|
13 void bar(); |
|
14 }; |
|
15 |
|
16 #endif /*A_H_*/ |
|
17 |
|
18 //= |
|
19 #ifndef A_H_ |
|
20 #define A_H_ |
|
21 |
|
22 class A |
|
23 { |
|
24 public: |
|
25 A(); |
|
26 virtual ~A(); |
|
27 int foo(); |
|
28 void bar(); |
|
29 static const int theAnswer = 42; |
|
30 }; |
|
31 |
|
32 #endif /*A_H_*/ |
|
33 |
|
34 //@A.cpp |
|
35 #include "A.h" |
|
36 |
|
37 A::A() |
|
38 { |
|
39 } |
|
40 |
|
41 A::~A() |
|
42 { |
|
43 } |
|
44 |
|
45 int A::foo() |
|
46 { |
|
47 return 42; //Hallo |
|
48 } |
|
49 |
|
50 void A::bar() |
|
51 { |
|
52 int a = 42; |
|
53 int b = 42; |
|
54 } |
|
55 |
|
56 //= |
|
57 #include "A.h" |
|
58 |
|
59 A::A() |
|
60 { |
|
61 } |
|
62 |
|
63 A::~A() |
|
64 { |
|
65 } |
|
66 |
|
67 int A::foo() |
|
68 { |
|
69 return theAnswer; //Hallo |
|
70 } |
|
71 |
|
72 void A::bar() |
|
73 { |
|
74 int a = theAnswer; |
|
75 int b = theAnswer; |
|
76 } |
|
77 |
|
78 //@refScript.xml |
|
79 <?xml version="1.0" encoding="UTF-8"?> |
|
80 <session version="1.0"> |
|
81 <refactoring comment="Create constant for 42" description="Extract Constant Refactoring" |
|
82 fileName="file:$$projectPath$$/A.cpp" flags="4" |
|
83 id="org.eclipse.cdt.ui.refactoring.extractconstant.ExtractConstantRefactoring" name="theAnswer" |
|
84 project="RegressionTestProject" selection="64,2" visibility="public"/> |
|
85 </session> |
|
86 |
|
87 |
|
88 //!replaceNumberProtected |
|
89 //#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest |
|
90 //@A.h |
|
91 #ifndef A_H_ |
|
92 #define A_H_ |
|
93 |
|
94 class A |
|
95 { |
|
96 public: |
|
97 A(); |
|
98 virtual ~A(); |
|
99 int foo(); |
|
100 }; |
|
101 |
|
102 #endif /*A_H_*/ |
|
103 |
|
104 //= |
|
105 #ifndef A_H_ |
|
106 #define A_H_ |
|
107 |
|
108 class A |
|
109 { |
|
110 public: |
|
111 A(); |
|
112 virtual ~A(); |
|
113 int foo(); |
|
114 protected: |
|
115 static const int theAnswer = 42; |
|
116 }; |
|
117 |
|
118 #endif /*A_H_*/ |
|
119 |
|
120 //@A.cpp |
|
121 #include "A.h" |
|
122 |
|
123 A::A() |
|
124 { |
|
125 } |
|
126 |
|
127 A::~A() |
|
128 { |
|
129 } |
|
130 |
|
131 int A::foo() |
|
132 { |
|
133 return 42; |
|
134 } |
|
135 |
|
136 //= |
|
137 #include "A.h" |
|
138 |
|
139 A::A() |
|
140 { |
|
141 } |
|
142 |
|
143 A::~A() |
|
144 { |
|
145 } |
|
146 |
|
147 int A::foo() |
|
148 { |
|
149 return theAnswer; |
|
150 } |
|
151 |
|
152 //@refScript.xml |
|
153 <?xml version="1.0" encoding="UTF-8"?> |
|
154 <session version="1.0"> |
|
155 <refactoring comment="Create constant for 42" description="Extract Constant Refactoring" |
|
156 fileName="file:$$projectPath$$/A.cpp" flags="4" |
|
157 id="org.eclipse.cdt.ui.refactoring.extractconstant.ExtractConstantRefactoring" name="theAnswer" |
|
158 project="RegressionTestProject" selection="64,2" visibility="protected"/> |
|
159 </session> |
|
160 |
|
161 //!replaceNumberPrivate |
|
162 //#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest |
|
163 //@A.h |
|
164 #ifndef A_H_ |
|
165 #define A_H_ |
|
166 |
|
167 class A |
|
168 { |
|
169 public: |
|
170 A(); |
|
171 virtual ~A(); |
|
172 int foo(); |
|
173 }; |
|
174 |
|
175 #endif /*A_H_*/ |
|
176 |
|
177 //= |
|
178 #ifndef A_H_ |
|
179 #define A_H_ |
|
180 |
|
181 class A |
|
182 { |
|
183 public: |
|
184 A(); |
|
185 virtual ~A(); |
|
186 int foo(); |
|
187 private: |
|
188 static const int theAnswer = 42; |
|
189 }; |
|
190 |
|
191 #endif /*A_H_*/ |
|
192 |
|
193 //@A.cpp |
|
194 #include "A.h" |
|
195 |
|
196 A::A() |
|
197 { |
|
198 } |
|
199 |
|
200 A::~A() |
|
201 { |
|
202 } |
|
203 |
|
204 int A::foo() |
|
205 { |
|
206 return 42; |
|
207 } |
|
208 |
|
209 //= |
|
210 #include "A.h" |
|
211 |
|
212 A::A() |
|
213 { |
|
214 } |
|
215 |
|
216 A::~A() |
|
217 { |
|
218 } |
|
219 |
|
220 int A::foo() |
|
221 { |
|
222 return theAnswer; |
|
223 } |
|
224 |
|
225 //@refScript.xml |
|
226 <?xml version="1.0" encoding="UTF-8"?> |
|
227 <session version="1.0"> |
|
228 <refactoring comment="Create constant for 42" description="Extract Constant Refactoring" |
|
229 fileName="file:$$projectPath$$/A.cpp" flags="4" |
|
230 id="org.eclipse.cdt.ui.refactoring.extractconstant.ExtractConstantRefactoring" name="theAnswer" |
|
231 project="RegressionTestProject" selection="64,2" visibility="private"/> |
|
232 </session> |
|