author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 19 | 989d2f495d90 |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: ?Description |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
||
21 |
// INCLUDE FILES |
|
22 |
#include <e32svr.h> |
|
23 |
#include <StifParser.h> |
|
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
24 |
#include <StifTestInterface.h> |
19 | 25 |
|
26 |
#include <f32file.h> |
|
27 |
#include <e32des16.h> |
|
28 |
#include <e32base.h> |
|
29 |
||
30 |
#include "tcontactssim.h" |
|
31 |
#include "tcallback.h" |
|
32 |
||
33 |
||
34 |
_LIT( KCntDbUri, "cntdb://c:contacts.cdb" ); |
|
35 |
||
36 |
// ============================ MEMBER FUNCTIONS =============================== |
|
37 |
||
38 |
||
39 |
// ----------------------------------------------------------------------------- |
|
40 |
// Csapi_getheader:RunMethodL |
|
41 |
// Run specified method. Contains also table of test mothods and their names. |
|
42 |
// ----------------------------------------------------------------------------- |
|
43 |
// |
|
44 |
TInt CContactsUT::RunMethodL( |
|
45 |
CStifItemParser& aItem ) |
|
46 |
{ |
|
47 |
||
48 |
static TStifFunctionInfo const KFunctions[] = |
|
49 |
{ |
|
50 |
ENTRY( "addcontact", CContactsUT::addcontactL ), |
|
51 |
ENTRY( "getlisttest", CContactsUT::getlisttestL ), |
|
52 |
ENTRY( "getlisttest_search", CContactsUT::getlisttest_searchL ), |
|
53 |
ENTRY( "deletetest" , CContactsUT::deletetestL ), |
|
54 |
ENTRY( "importtest" , CContactsUT::importL ), |
|
55 |
ENTRY( "exporttest" , CContactsUT::exportL ), |
|
56 |
}; |
|
57 |
||
58 |
const TInt count = sizeof( KFunctions ) / |
|
59 |
sizeof( TStifFunctionInfo ); |
|
60 |
||
61 |
return RunInternalL( KFunctions, count, aItem ); |
|
62 |
||
63 |
} |
|
64 |
// ----------------------------------------------------------------------------- |
|
65 |
// CContactsUT:addcontactL |
|
66 |
// Example test method function. |
|
67 |
// (other items were commented in a header). |
|
68 |
// ----------------------------------------------------------------------------- |
|
69 |
// |
|
70 |
TInt CContactsUT::addcontactL( CStifItemParser& aItem ) |
|
71 |
{ |
|
72 |
||
73 |
||
74 |
||
75 |
RFs fs; |
|
76 |
RFile file; |
|
77 |
User::LeaveIfError(fs.Connect()); |
|
78 |
CleanupClosePushL(fs); |
|
79 |
||
80 |
TInt errfile =file.Replace(fs,_L("C:\\Data\\tcontacts_addlog.txt"), EFileWrite | EFileStreamText); |
|
81 |
CleanupClosePushL(file); |
|
82 |
||
83 |
TBuf8<100> filebuf; |
|
84 |
||
85 |
filebuf.Append(_L8("\n Starting logs")); |
|
86 |
file.Write(filebuf); |
|
87 |
filebuf.Zero(); |
|
88 |
file.Flush(); |
|
89 |
||
90 |
||
91 |
||
92 |
||
93 |
CContactService* icontactservice = CContactService::NewL(); |
|
94 |
CleanupStack::PushL(icontactservice); |
|
95 |
||
96 |
CContactCallBack* callback = CContactCallBack::NewL(&file); |
|
97 |
CleanupStack::PushL(callback); |
|
98 |
||
99 |
CSingleContact* cont = CSingleContact::NewL(); |
|
100 |
||
101 |
cont->SetContactIdL(KNullDesC8); |
|
102 |
//delete test; |
|
103 |
||
104 |
CSingleContactField* field =CSingleContactField::NewL(); |
|
105 |
||
106 |
field->SetFieldParamsL(KLastName,KNullDesC,KName); |
|
107 |
||
108 |
cont->AddFieldToContactL(field); |
|
109 |
||
110 |
||
111 |
TRAPD(err,icontactservice->AddL(callback,0,cont,KNullDesC8,KNullDesC,KCntSimDbUri)); |
|
112 |
CActiveScheduler::Start(); |
|
113 |
||
114 |
TInt result(callback->iErrCode); |
|
115 |
||
116 |
CleanupStack::PopAndDestroy(callback); |
|
117 |
CleanupStack::PopAndDestroy(icontactservice); |
|
118 |
CleanupStack::PopAndDestroy(); |
|
119 |
CleanupStack::PopAndDestroy(); |
|
120 |
||
121 |
||
122 |
||
123 |
return result; |
|
124 |
||
125 |
||
126 |
} |
|
127 |
||
128 |
// ----------------------------------------------------------------------------- |
|
129 |
// CContactsUT:getlisttestL |
|
130 |
// Example test method function. |
|
131 |
// (other items were commented in a header). |
|
132 |
// ----------------------------------------------------------------------------- |
|
133 |
// |
|
134 |
TInt CContactsUT::getlisttestL( CStifItemParser& aItem ) |
|
135 |
{ |
|
136 |
||
137 |
// __UHEAP_MARK; |
|
138 |
||
139 |
RFs fs; |
|
140 |
RFile file; |
|
141 |
User::LeaveIfError(fs.Connect()); |
|
142 |
CleanupClosePushL(fs); |
|
143 |
||
144 |
TInt errfile =file.Replace(fs,_L("C:\\Data\\tcontacts_simlog.txt"), EFileWrite | EFileStreamText); |
|
145 |
CleanupClosePushL(file); |
|
146 |
||
147 |
TBuf8<100> filebuf; |
|
148 |
||
149 |
filebuf.Append(_L8("\n Starting logs")); |
|
150 |
file.Write(filebuf); |
|
151 |
filebuf.Zero(); |
|
152 |
file.Flush(); |
|
153 |
||
154 |
||
155 |
CContactService* icontactservice = CContactService::NewL(); |
|
156 |
CleanupStack::PushL(icontactservice); |
|
157 |
||
158 |
filebuf.Append(_L8("\n Service Class object created")); |
|
159 |
file.Write(filebuf); |
|
160 |
filebuf.Zero(); |
|
161 |
file.Flush(); |
|
162 |
||
163 |
CContactCallBack* callback = CContactCallBack::NewL(&file); |
|
164 |
CleanupStack::PushL(callback); |
|
165 |
||
166 |
filebuf.Append(_L8("\n Callback object created")); |
|
167 |
file.Write(filebuf); |
|
168 |
filebuf.Zero(); |
|
169 |
file.Flush(); |
|
170 |
||
171 |
||
172 |
//For automation purpose |
|
173 |
_LIT(KFileName,"c:\\data\\Import.vcf"); |
|
174 |
TBuf<50> flnm(KFileName); |
|
175 |
||
176 |
TRAPD(err,icontactservice->ImportVCardToStoreL(callback,0,flnm,KCntSimDbUri)); |
|
177 |
||
178 |
filebuf.Append(_L8("\nImportVCard is called\n")); |
|
179 |
file.Write(filebuf); |
|
180 |
filebuf.Zero(); |
|
181 |
file.Flush(); |
|
182 |
||
183 |
||
184 |
CActiveScheduler::Start(); |
|
185 |
||
186 |
||
187 |
||
188 |
TInt result(callback->iErrCode); |
|
189 |
||
190 |
filebuf.Num(callback->iErrCode); |
|
191 |
file.Write(filebuf); |
|
192 |
filebuf.Zero(); |
|
193 |
file.Flush(); |
|
194 |
||
195 |
if(result != KErrNone) |
|
196 |
return result; |
|
197 |
||
198 |
||
199 |
||
200 |
TRAPD(err1,icontactservice->GetListL(callback,0,EContacts,KNullDesC8,KCntSimDbUri)); |
|
201 |
filebuf.Append(_L8("\n API called")); |
|
202 |
file.Write(filebuf); |
|
203 |
filebuf.Zero(); |
|
204 |
file.Flush(); |
|
205 |
||
206 |
CActiveScheduler::Start(); |
|
207 |
||
208 |
result=callback->iErrCode; |
|
209 |
||
210 |
filebuf.Append(_L8("\n Error result")); |
|
211 |
file.Write(filebuf); |
|
212 |
filebuf.Zero(); |
|
213 |
file.Flush(); |
|
214 |
||
215 |
filebuf.Num(result); |
|
216 |
file.Write(filebuf); |
|
217 |
filebuf.Zero(); |
|
218 |
file.Flush(); |
|
219 |
||
220 |
||
221 |
CleanupStack::PopAndDestroy(callback); |
|
222 |
CleanupStack::PopAndDestroy(icontactservice); |
|
223 |
||
224 |
CleanupStack::PopAndDestroy();//file |
|
225 |
CleanupStack::PopAndDestroy();//fs |
|
226 |
||
227 |
||
228 |
||
229 |
// __UHEAP_MARKEND; |
|
230 |
return result; |
|
231 |
||
232 |
||
233 |
} |
|
234 |
||
235 |
// ----------------------------------------------------------------------------- |
|
236 |
// CContactsUT:getlisttest_searchL |
|
237 |
// Example test method function. |
|
238 |
// (other items were commented in a header). |
|
239 |
// ----------------------------------------------------------------------------- |
|
240 |
// |
|
241 |
||
242 |
TInt CContactsUT::getlisttest_searchL(CStifItemParser& aItem) |
|
243 |
{ |
|
244 |
// __UHEAP_MARK; |
|
245 |
||
246 |
RFs fs; |
|
247 |
RFile file; |
|
248 |
User::LeaveIfError(fs.Connect()); |
|
249 |
CleanupClosePushL(fs); |
|
250 |
||
251 |
TInt errfile =file.Replace(fs,_L("C:\\Data\\tcontacts_search.txt"), EFileWrite | EFileStreamText); |
|
252 |
CleanupClosePushL(file); |
|
253 |
||
254 |
TBuf8<100> filebuf; |
|
255 |
||
256 |
||
257 |
CContactService* icontactservice = CContactService::NewL(); |
|
258 |
CleanupStack::PushL(icontactservice); |
|
259 |
||
260 |
CContactCallBack* callback = CContactCallBack::NewL(&file); |
|
261 |
CleanupStack::PushL(callback); |
|
262 |
||
263 |
||
264 |
||
265 |
//For automation purpose |
|
266 |
_LIT(KFileName,"c:\\data\\Import.vcf"); |
|
267 |
TBuf<50> flnm(KFileName); |
|
268 |
||
269 |
TRAPD(err,icontactservice->ImportVCardToStoreL(callback,0,flnm,KCntSimDbUri)); |
|
270 |
||
271 |
filebuf.Append(_L8("\nImportVCard is called\n")); |
|
272 |
file.Write(filebuf); |
|
273 |
filebuf.Zero(); |
|
274 |
file.Flush(); |
|
275 |
||
276 |
||
277 |
CActiveScheduler::Start(); |
|
278 |
||
279 |
||
280 |
||
281 |
TInt result(callback->iErrCode); |
|
282 |
||
283 |
filebuf.Num(callback->iErrCode); |
|
284 |
file.Write(filebuf); |
|
285 |
filebuf.Zero(); |
|
286 |
file.Flush(); |
|
287 |
||
288 |
if(result != KErrNone) |
|
289 |
return result; |
|
290 |
||
291 |
||
292 |
||
293 |
||
294 |
||
295 |
||
296 |
||
297 |
TBuf<10> serch(_L("A")); |
|
298 |
TRAPD(err1,icontactservice->GetListL(callback,0,EContacts,KNullDesC8,serch,NULL,EAsc,KCntSimDbUri)); |
|
299 |
CActiveScheduler::Start(); |
|
300 |
||
301 |
result=callback->iErrCode; |
|
302 |
||
303 |
CleanupStack::PopAndDestroy(callback); |
|
304 |
CleanupStack::PopAndDestroy(icontactservice); |
|
305 |
||
306 |
CleanupStack::PopAndDestroy();//file |
|
307 |
CleanupStack::PopAndDestroy();//fs |
|
308 |
||
309 |
||
310 |
||
311 |
// __UHEAP_MARKEND; |
|
312 |
return result; |
|
313 |
||
314 |
||
315 |
} |
|
316 |
||
317 |
// ----------------------------------------------------------------------------- |
|
318 |
// CContactsUT:deletetestL |
|
319 |
// Example test method function. |
|
320 |
// (other items were commented in a header). |
|
321 |
// ----------------------------------------------------------------------------- |
|
322 |
// |
|
323 |
TInt CContactsUT::deletetestL(CStifItemParser& aItem) |
|
324 |
{ |
|
325 |
||
326 |
// __UHEAP_MARK; |
|
327 |
||
328 |
RFs fs; |
|
329 |
RFile file; |
|
330 |
User::LeaveIfError(fs.Connect()); |
|
331 |
CleanupClosePushL(fs); |
|
332 |
||
333 |
TInt errfile =file.Replace(fs,_L("C:\\Data\\tcontacts_delete.txt"), EFileWrite | EFileStreamText); |
|
334 |
CleanupClosePushL(file); |
|
335 |
||
336 |
TBuf8<100> filebuf; |
|
337 |
||
338 |
||
339 |
CContactService* icontactservice = CContactService::NewL(); |
|
340 |
CleanupStack::PushL(icontactservice); |
|
341 |
||
342 |
||
343 |
||
344 |
filebuf.Append(_L8("\n Core Class object created")); |
|
345 |
file.Write(filebuf); |
|
346 |
filebuf.Zero(); |
|
347 |
file.Flush(); |
|
348 |
||
349 |
||
350 |
CContactCallBack* callback = CContactCallBack::NewL(&file); |
|
351 |
CleanupStack::PushL(callback); |
|
352 |
||
353 |
filebuf.Append(_L8("\n Callback object created")); |
|
354 |
file.Write(filebuf); |
|
355 |
filebuf.Zero(); |
|
356 |
file.Flush(); |
|
357 |
||
358 |
||
359 |
//For automation purpose |
|
360 |
_LIT(KFileName,"c:\\data\\Import.vcf"); |
|
361 |
TBuf<50> flnm(KFileName); |
|
362 |
||
363 |
TRAPD(err,icontactservice->ImportVCardToStoreL(callback,0,flnm,KCntSimDbUri)); |
|
364 |
||
365 |
filebuf.Append(_L8("\nImportVCard is called\n")); |
|
366 |
file.Write(filebuf); |
|
367 |
filebuf.Zero(); |
|
368 |
file.Flush(); |
|
369 |
||
370 |
||
371 |
CActiveScheduler::Start(); |
|
372 |
||
373 |
||
374 |
||
375 |
TInt result(callback->iErrCode); |
|
376 |
||
377 |
filebuf.Num(callback->iErrCode); |
|
378 |
file.Write(filebuf); |
|
379 |
filebuf.Zero(); |
|
380 |
file.Flush(); |
|
381 |
||
382 |
if(result != KErrNone) |
|
383 |
return result; |
|
384 |
||
385 |
||
386 |
||
387 |
||
388 |
||
389 |
||
390 |
||
391 |
// GetList for getting one contact item |
|
392 |
TBuf<10> serch(_L("A")); |
|
393 |
TRAPD(err1,icontactservice->GetListL(callback,0,EContacts,KNullDesC8,serch,NULL,EAsc,KCntSimDbUri)); |
|
394 |
||
395 |
filebuf.Append(_L8("\n GetList is called")); |
|
396 |
file.Write(filebuf); |
|
397 |
filebuf.Zero(); |
|
398 |
file.Flush(); |
|
399 |
||
400 |
||
401 |
CActiveScheduler::Start(); |
|
402 |
||
403 |
if(callback->iErrCode == KErrNone) |
|
404 |
{ |
|
405 |
||
406 |
RPointerArray<TDesC8> contactIdArray; |
|
407 |
contactIdArray.Append(callback->iId); |
|
408 |
||
409 |
TRAPD(err,icontactservice->DeleteL(callback,0,contactIdArray,KCntSimDbUri)); |
|
410 |
||
411 |
filebuf.Append(_L8("\n Delete is called\n")); |
|
412 |
file.Write(filebuf); |
|
413 |
filebuf.Zero(); |
|
414 |
file.Flush(); |
|
415 |
||
416 |
CActiveScheduler::Start(); |
|
417 |
||
418 |
} |
|
419 |
||
420 |
||
421 |
||
422 |
result=callback->iErrCode; |
|
423 |
||
424 |
filebuf.Num(callback->iErrCode); |
|
425 |
file.Write(filebuf); |
|
426 |
filebuf.Zero(); |
|
427 |
file.Flush(); |
|
428 |
||
429 |
||
430 |
CleanupStack::PopAndDestroy(callback); |
|
431 |
CleanupStack::PopAndDestroy(icontactservice); |
|
432 |
||
433 |
CleanupStack::PopAndDestroy();//file |
|
434 |
CleanupStack::PopAndDestroy();//fs |
|
435 |
||
436 |
||
437 |
// __UHEAP_MARKEND; |
|
438 |
return result; |
|
439 |
||
440 |
} |
|
441 |
||
442 |
||
443 |
// ----------------------------------------------------------------------------- |
|
444 |
// CContactsUT:importL |
|
445 |
// Example test method function. |
|
446 |
// (other items were commented in a header). |
|
447 |
// ----------------------------------------------------------------------------- |
|
448 |
// |
|
449 |
TInt CContactsUT::importL(CStifItemParser& aItem) |
|
450 |
{ |
|
451 |
||
452 |
// __UHEAP_MARK; |
|
453 |
||
454 |
RFs fs; |
|
455 |
RFile file; |
|
456 |
User::LeaveIfError(fs.Connect()); |
|
457 |
CleanupClosePushL(fs); |
|
458 |
||
459 |
TInt errfile =file.Replace(fs,_L("C:\\Data\\tcontacts_import.txt"), EFileWrite | EFileStreamText); |
|
460 |
CleanupClosePushL(file); |
|
461 |
||
462 |
TBuf8<100> filebuf; |
|
463 |
||
464 |
||
465 |
CContactService* icontactservice = CContactService::NewL(); |
|
466 |
CleanupStack::PushL(icontactservice); |
|
467 |
||
468 |
filebuf.Append(_L8("\n Core class object is created")); |
|
469 |
file.Write(filebuf); |
|
470 |
filebuf.Zero(); |
|
471 |
file.Flush(); |
|
472 |
||
473 |
||
474 |
CContactCallBack* callback = CContactCallBack::NewL(&file); |
|
475 |
CleanupStack::PushL(callback); |
|
476 |
||
477 |
filebuf.Append(_L8("\nCallback object is created")); |
|
478 |
file.Write(filebuf); |
|
479 |
filebuf.Zero(); |
|
480 |
file.Flush(); |
|
481 |
||
482 |
// pre condition that Import.vcf should b present . |
|
483 |
_LIT(KFileName,"c:\\data\\Import.vcf"); |
|
484 |
TBuf<50> flnm(KFileName); |
|
485 |
||
486 |
TRAPD(err,icontactservice->ImportVCardToStoreL(callback,0,flnm,KCntSimDbUri)); |
|
487 |
||
488 |
filebuf.Append(_L8("\nImportVCard is called\n")); |
|
489 |
file.Write(filebuf); |
|
490 |
filebuf.Zero(); |
|
491 |
file.Flush(); |
|
492 |
||
493 |
||
494 |
CActiveScheduler::Start(); |
|
495 |
||
496 |
||
497 |
||
498 |
TInt result(callback->iErrCode); |
|
499 |
||
500 |
filebuf.Num(callback->iErrCode); |
|
501 |
file.Write(filebuf); |
|
502 |
filebuf.Zero(); |
|
503 |
file.Flush(); |
|
504 |
||
505 |
||
506 |
CleanupStack::PopAndDestroy(callback); |
|
507 |
CleanupStack::PopAndDestroy(icontactservice); |
|
508 |
||
509 |
||
510 |
||
511 |
CleanupStack::PopAndDestroy();//file |
|
512 |
CleanupStack::PopAndDestroy();//fs |
|
513 |
||
514 |
// __UHEAP_MARKEND; |
|
515 |
return result; |
|
516 |
||
517 |
||
518 |
} |
|
519 |
||
520 |
// ----------------------------------------------------------------------------- |
|
521 |
// CContactsUT:exportL |
|
522 |
// Example test method function. |
|
523 |
// (other items were commented in a header). |
|
524 |
// ----------------------------------------------------------------------------- |
|
525 |
// |
|
526 |
TInt CContactsUT::exportL(CStifItemParser& aItem) |
|
527 |
{ |
|
528 |
||
529 |
// __UHEAP_MARK; |
|
530 |
||
531 |
||
532 |
RFs fs; |
|
533 |
RFile file; |
|
534 |
User::LeaveIfError(fs.Connect()); |
|
535 |
CleanupClosePushL(fs); |
|
536 |
||
537 |
TInt errfile =file.Replace(fs,_L("C:\\Data\\tcontacts_export.txt"), EFileWrite | EFileStreamText); |
|
538 |
CleanupClosePushL(file); |
|
539 |
||
540 |
TBuf8<100> filebuf; |
|
541 |
||
542 |
CContactService* icontactservice = CContactService::NewL(); |
|
543 |
CleanupStack::PushL(icontactservice); |
|
544 |
||
545 |
filebuf.Append(_L8("\n Core class object is created")); |
|
546 |
file.Write(filebuf); |
|
547 |
filebuf.Zero(); |
|
548 |
file.Flush(); |
|
549 |
||
550 |
||
551 |
||
552 |
CContactCallBack* callback = CContactCallBack::NewL(&file); |
|
553 |
CleanupStack::PushL(callback); |
|
554 |
||
555 |
||
556 |
filebuf.Append(_L8("\n Callback object is created")); |
|
557 |
file.Write(filebuf); |
|
558 |
filebuf.Zero(); |
|
559 |
file.Flush(); |
|
560 |
||
561 |
||
562 |
//For automation purpose |
|
563 |
_LIT(KFileName,"c:\\data\\Import.vcf"); |
|
564 |
TBuf<50> flnm(KFileName); |
|
565 |
||
566 |
TRAPD(err,icontactservice->ImportVCardToStoreL(callback,0,flnm,KCntSimDbUri)); |
|
567 |
||
568 |
filebuf.Append(_L8("\nImportVCard is called\n")); |
|
569 |
file.Write(filebuf); |
|
570 |
filebuf.Zero(); |
|
571 |
file.Flush(); |
|
572 |
||
573 |
||
574 |
CActiveScheduler::Start(); |
|
575 |
||
576 |
||
577 |
||
578 |
TInt result(callback->iErrCode); |
|
579 |
||
580 |
filebuf.Num(callback->iErrCode); |
|
581 |
file.Write(filebuf); |
|
582 |
filebuf.Zero(); |
|
583 |
file.Flush(); |
|
584 |
||
585 |
if(result != KErrNone) |
|
586 |
return result; |
|
587 |
||
588 |
||
589 |
||
590 |
||
591 |
||
592 |
||
593 |
||
594 |
// GetList for getting one contact item |
|
595 |
TBuf<10> serch(_L("A")); |
|
596 |
TRAPD(err1,icontactservice->GetListL(callback,0,EContacts,KNullDesC8,serch,NULL,EAsc,KCntSimDbUri)); |
|
597 |
||
598 |
filebuf.Append(_L8("\nGetList is called")); |
|
599 |
file.Write(filebuf); |
|
600 |
filebuf.Zero(); |
|
601 |
file.Flush(); |
|
602 |
||
603 |
||
604 |
CActiveScheduler::Start(); |
|
605 |
||
606 |
if(callback->iErrCode == KErrNone) |
|
607 |
{ |
|
608 |
||
609 |
_LIT(KFileName,"c:\\data\\Export.vcf"); |
|
610 |
TBuf<50> flnm1(KFileName); |
|
611 |
TInt ret=0; |
|
612 |
||
613 |
TRAPD(err,icontactservice->ExportVCardL(callback,0,flnm1,*(callback->iId),KCntSimDbUri)); |
|
614 |
||
615 |
filebuf.Append(_L8("\nExportVCard is called")); |
|
616 |
file.Write(filebuf); |
|
617 |
filebuf.Zero(); |
|
618 |
file.Flush(); |
|
619 |
||
620 |
||
621 |
CActiveScheduler::Start(); |
|
622 |
||
623 |
} |
|
624 |
||
625 |
||
626 |
result=callback->iErrCode; |
|
627 |
||
628 |
filebuf.Num(callback->iErrCode); |
|
629 |
file.Write(filebuf); |
|
630 |
filebuf.Zero(); |
|
631 |
file.Flush(); |
|
632 |
||
633 |
||
634 |
||
635 |
CleanupStack::PopAndDestroy(callback); |
|
636 |
CleanupStack::PopAndDestroy(icontactservice); |
|
637 |
||
638 |
CleanupStack::PopAndDestroy();//file |
|
639 |
CleanupStack::PopAndDestroy();//fs |
|
640 |
||
641 |
||
642 |
// __UHEAP_MARKEND; |
|
643 |
return result; |
|
644 |
||
645 |
||
646 |
} |