|
1 /* |
|
2 * Copyright (c) 2002-2005 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 "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: holds the partial success information |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "CCAPartialSuccessData.h" |
|
20 #include "CCAErrorData.h" |
|
21 |
|
22 #include "ChatDebugPrint.h" |
|
23 |
|
24 #include <impsdetailed.h> |
|
25 |
|
26 // ================= MEMBER FUNCTIONS ======================= |
|
27 |
|
28 // Two-phased constructor. |
|
29 CCAPartialSuccessData* CCAPartialSuccessData::NewL() |
|
30 { |
|
31 CCAPartialSuccessData* self = new ( ELeave ) CCAPartialSuccessData(); |
|
32 |
|
33 // no need for ConstructL |
|
34 |
|
35 return self; |
|
36 } |
|
37 |
|
38 |
|
39 // C++ default constructor can NOT contain any code, that |
|
40 // might leave. |
|
41 // |
|
42 CCAPartialSuccessData::CCAPartialSuccessData() |
|
43 { |
|
44 } |
|
45 |
|
46 // Destructor |
|
47 CCAPartialSuccessData::~CCAPartialSuccessData() |
|
48 { |
|
49 iErrorData.ResetAndDestroy(); |
|
50 iErrorData.Close(); |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------- |
|
54 // CCAPartialSuccessData::SetPartialSuccessDataL |
|
55 // --------------------------------------------------------- |
|
56 // |
|
57 void CCAPartialSuccessData::SetPartialSuccessDataL( |
|
58 const CImpsDetailed& aDetailedResults ) |
|
59 { |
|
60 iErrorData.ResetAndDestroy(); |
|
61 |
|
62 TInt count( aDetailedResults.Count() ); |
|
63 |
|
64 for ( TInt arrayIndex( 0 ); arrayIndex < count; ++arrayIndex ) |
|
65 { |
|
66 CCAErrorData* errorData = CCAErrorData::NewL( |
|
67 *( aDetailedResults.At( arrayIndex ) ) ); |
|
68 |
|
69 // NOTE: iErrorData takes ownership |
|
70 TInt err( iErrorData.Append( errorData ) ); |
|
71 if ( err != KErrNone ) |
|
72 { |
|
73 delete errorData; |
|
74 User::Leave( err ); |
|
75 } |
|
76 } |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------- |
|
80 // CCAPartialSuccessData::PartialSuccessData |
|
81 // --------------------------------------------------------- |
|
82 // |
|
83 const RPointerArray<MCAError>* CCAPartialSuccessData::PartialSuccessData() |
|
84 const |
|
85 { |
|
86 return &iErrorData; |
|
87 } |
|
88 |
|
89 // End of File |