|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 */ |
|
19 |
|
20 #include "CMtfTestActionParameters.h" |
|
21 #include "CMtfTestAction.h" |
|
22 |
|
23 CMtfTestActionParameters::~CMtfTestActionParameters() |
|
24 { |
|
25 iParameters.ResetAndDestroy(); |
|
26 } |
|
27 |
|
28 CMtfTestActionParameters* CMtfTestActionParameters::NewL() |
|
29 { |
|
30 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(); |
|
31 CleanupStack::Pop(self); |
|
32 return self; |
|
33 } |
|
34 |
|
35 CMtfTestActionParameters* CMtfTestActionParameters::NewLC() |
|
36 { |
|
37 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
38 CleanupStack::PushL(self); |
|
39 return self; |
|
40 } |
|
41 |
|
42 CMtfTestActionParameters* CMtfTestActionParameters::NewLC(const TDesC& aParam1) |
|
43 { |
|
44 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
45 CleanupStack::PushL(self); |
|
46 self->AddParameterL(aParam1); |
|
47 return self; |
|
48 } |
|
49 |
|
50 CMtfTestActionParameters* CMtfTestActionParameters::NewL(const TDesC& aParam1) |
|
51 { |
|
52 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(aParam1); |
|
53 CleanupStack::Pop(self); |
|
54 return self; |
|
55 } |
|
56 |
|
57 CMtfTestActionParameters* CMtfTestActionParameters::NewLC(const TDesC& aParam1, |
|
58 const TDesC& aParam2) |
|
59 { |
|
60 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
61 CleanupStack::PushL(self); |
|
62 self->AddParameterL(aParam1); |
|
63 self->AddParameterL(aParam2); |
|
64 return self; |
|
65 } |
|
66 |
|
67 CMtfTestActionParameters* CMtfTestActionParameters::NewL(const TDesC& aParam1, |
|
68 const TDesC& aParam2) |
|
69 { |
|
70 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(aParam1,aParam2); |
|
71 CleanupStack::Pop(self); |
|
72 return self; |
|
73 } |
|
74 |
|
75 CMtfTestActionParameters* CMtfTestActionParameters::NewLC(const TDesC& aParam1, |
|
76 const TDesC& aParam2, const TDesC& aParam3) |
|
77 { |
|
78 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
79 CleanupStack::PushL(self); |
|
80 self->AddParameterL(aParam1); |
|
81 self->AddParameterL(aParam2); |
|
82 self->AddParameterL(aParam3); |
|
83 return self; |
|
84 } |
|
85 |
|
86 CMtfTestActionParameters* CMtfTestActionParameters::NewL(const TDesC& aParam1, |
|
87 const TDesC& aParam2, const TDesC& aParam3) |
|
88 { |
|
89 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(aParam1,aParam2,aParam3); |
|
90 CleanupStack::Pop(self); |
|
91 return self; |
|
92 } |
|
93 |
|
94 CMtfTestActionParameters* CMtfTestActionParameters::NewLC(const TDesC& aParam1, |
|
95 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4) |
|
96 { |
|
97 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
98 CleanupStack::PushL(self); |
|
99 self->AddParameterL(aParam1); |
|
100 self->AddParameterL(aParam2); |
|
101 self->AddParameterL(aParam3); |
|
102 self->AddParameterL(aParam4); |
|
103 return self; |
|
104 } |
|
105 |
|
106 CMtfTestActionParameters* CMtfTestActionParameters::NewL(const TDesC& aParam1, |
|
107 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4) |
|
108 { |
|
109 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(aParam1,aParam2,aParam3,aParam4); |
|
110 CleanupStack::Pop(self); |
|
111 return self; |
|
112 } |
|
113 |
|
114 CMtfTestActionParameters* CMtfTestActionParameters::NewLC(const TDesC& aParam1, |
|
115 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4, const TDesC& aParam5) |
|
116 { |
|
117 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
118 CleanupStack::PushL(self); |
|
119 self->AddParameterL(aParam1); |
|
120 self->AddParameterL(aParam2); |
|
121 self->AddParameterL(aParam3); |
|
122 self->AddParameterL(aParam4); |
|
123 self->AddParameterL(aParam5); |
|
124 return self; |
|
125 } |
|
126 |
|
127 CMtfTestActionParameters* CMtfTestActionParameters::NewL(const TDesC& aParam1, |
|
128 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4, const TDesC& aParam5) |
|
129 { |
|
130 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(aParam1,aParam2,aParam3, |
|
131 aParam4,aParam5); |
|
132 CleanupStack::Pop(self); |
|
133 return self; |
|
134 } |
|
135 |
|
136 CMtfTestActionParameters* CMtfTestActionParameters::NewLC(const TDesC& aParam1, |
|
137 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4, const TDesC& aParam5, |
|
138 const TDesC& aParam6) |
|
139 { |
|
140 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
141 CleanupStack::PushL(self); |
|
142 self->AddParameterL(aParam1); |
|
143 self->AddParameterL(aParam2); |
|
144 self->AddParameterL(aParam3); |
|
145 self->AddParameterL(aParam4); |
|
146 self->AddParameterL(aParam5); |
|
147 self->AddParameterL(aParam6); |
|
148 return self; |
|
149 } |
|
150 |
|
151 CMtfTestActionParameters* CMtfTestActionParameters::NewL(const TDesC& aParam1, |
|
152 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4, const TDesC& aParam5, |
|
153 const TDesC& aParam6) |
|
154 { |
|
155 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(aParam1,aParam2,aParam3, |
|
156 aParam4,aParam5,aParam6); |
|
157 CleanupStack::Pop(self); |
|
158 return self; |
|
159 } |
|
160 |
|
161 CMtfTestActionParameters* CMtfTestActionParameters::NewLC(const TDesC& aParam1, |
|
162 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4, const TDesC& aParam5, |
|
163 const TDesC& aParam6, const TDesC& aParam7) |
|
164 { |
|
165 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
166 CleanupStack::PushL(self); |
|
167 self->AddParameterL(aParam1); |
|
168 self->AddParameterL(aParam2); |
|
169 self->AddParameterL(aParam3); |
|
170 self->AddParameterL(aParam4); |
|
171 self->AddParameterL(aParam5); |
|
172 self->AddParameterL(aParam6); |
|
173 self->AddParameterL(aParam7); |
|
174 return self; |
|
175 } |
|
176 |
|
177 CMtfTestActionParameters* CMtfTestActionParameters::NewL(const TDesC& aParam1, |
|
178 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4, const TDesC& aParam5, |
|
179 const TDesC& aParam6, const TDesC& aParam7) |
|
180 { |
|
181 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(aParam1,aParam2,aParam3, |
|
182 aParam4,aParam5,aParam6,aParam7); |
|
183 CleanupStack::Pop(self); |
|
184 return self; |
|
185 } |
|
186 |
|
187 CMtfTestActionParameters* CMtfTestActionParameters::NewLC(const TDesC& aParam1, |
|
188 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4, const TDesC& aParam5, |
|
189 const TDesC& aParam6, const TDesC& aParam7, const TDesC& aParam8) |
|
190 { |
|
191 CMtfTestActionParameters* self = new(ELeave) CMtfTestActionParameters; |
|
192 CleanupStack::PushL(self); |
|
193 self->AddParameterL(aParam1); |
|
194 self->AddParameterL(aParam2); |
|
195 self->AddParameterL(aParam3); |
|
196 self->AddParameterL(aParam4); |
|
197 self->AddParameterL(aParam5); |
|
198 self->AddParameterL(aParam6); |
|
199 self->AddParameterL(aParam7); |
|
200 self->AddParameterL(aParam8); |
|
201 return self; |
|
202 } |
|
203 |
|
204 CMtfTestActionParameters* CMtfTestActionParameters::NewL(const TDesC& aParam1, |
|
205 const TDesC& aParam2, const TDesC& aParam3, const TDesC& aParam4, const TDesC& aParam5, |
|
206 const TDesC& aParam6, const TDesC& aParam7, const TDesC& aParam8) |
|
207 { |
|
208 CMtfTestActionParameters* self = CMtfTestActionParameters::NewLC(aParam1,aParam2,aParam3, |
|
209 aParam4,aParam5,aParam6,aParam7,aParam8); |
|
210 CleanupStack::Pop(self); |
|
211 return self; |
|
212 } |
|
213 |
|
214 void CMtfTestActionParameters::AddParameterL(const TDesC& aParameter) |
|
215 { |
|
216 HBufC* newParameter = aParameter.AllocLC(); |
|
217 User::LeaveIfError(iParameters.Append(newParameter)); |
|
218 CleanupStack::Pop(newParameter); |
|
219 } |
|
220 |
|
221 TInt CMtfTestActionParameters::Count() const |
|
222 { |
|
223 return iParameters.Count(); |
|
224 } |
|
225 |
|
226 const TDesC& CMtfTestActionParameters::Parameter(TInt aParameterIndex) const |
|
227 { |
|
228 __ASSERT_ALWAYS(aParameterIndex>=0,CMtfTestAction::Panic(CMtfTestAction::EMtfNegativeParameterIndex)); |
|
229 __ASSERT_ALWAYS(aParameterIndex<iParameters.Count(),CMtfTestAction::Panic(CMtfTestAction::EMtfParameterIndexOutOfRange)); |
|
230 return *iParameters[aParameterIndex]; |
|
231 } |