|
1 /* |
|
2 * Copyright (c) 2006 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <s32strm.h> |
|
20 |
|
21 #include "ncdexpirednode.h" |
|
22 #include "catalogsutils.h" |
|
23 #include "catalogsdebug.h" |
|
24 #include "ncdutils.h" |
|
25 |
|
26 // ======== MEMBER FUNCTIONS ======== |
|
27 |
|
28 CNcdExpiredNode* CNcdExpiredNode::NewL( RReadStream& aReadStream ) |
|
29 { |
|
30 CNcdExpiredNode* self = CNcdExpiredNode::NewLC( aReadStream ); |
|
31 CleanupStack::Pop( self ); |
|
32 return self; |
|
33 } |
|
34 |
|
35 CNcdExpiredNode* CNcdExpiredNode::NewLC( RReadStream& aReadStream ) |
|
36 { |
|
37 CNcdExpiredNode* self = new ( ELeave ) CNcdExpiredNode( EFalse ); |
|
38 CleanupStack::PushL( self ); |
|
39 self->InternalizeL( aReadStream ); |
|
40 return self; |
|
41 } |
|
42 |
|
43 CNcdExpiredNode* CNcdExpiredNode::NewL( const CNcdNodeIdentifier& aNodeIdentifier, |
|
44 TBool aForceUpdate ) |
|
45 { |
|
46 CNcdExpiredNode* self = CNcdExpiredNode::NewLC( aNodeIdentifier, aForceUpdate ); |
|
47 CleanupStack::Pop( self ); |
|
48 return self; |
|
49 } |
|
50 |
|
51 CNcdExpiredNode* CNcdExpiredNode::NewLC( const CNcdNodeIdentifier& aNodeIdentifier, |
|
52 TBool aForceUpdate ) |
|
53 { |
|
54 CNcdExpiredNode* self = new ( ELeave ) CNcdExpiredNode( aForceUpdate ); |
|
55 CleanupStack::PushL( self ); |
|
56 self->ConstructL( aNodeIdentifier ); |
|
57 return self; |
|
58 } |
|
59 |
|
60 CNcdExpiredNode* CNcdExpiredNode::NewL( const CNcdExpiredNode& aExpiredNode ) |
|
61 { |
|
62 CNcdExpiredNode* self = CNcdExpiredNode::NewLC( aExpiredNode ); |
|
63 CleanupStack::Pop( self ); |
|
64 return self; |
|
65 } |
|
66 |
|
67 CNcdExpiredNode* CNcdExpiredNode::NewLC( const CNcdExpiredNode& aExpiredNode ) |
|
68 { |
|
69 CNcdExpiredNode* self = new ( ELeave ) CNcdExpiredNode( |
|
70 aExpiredNode.ForceUpdate() ); |
|
71 CleanupStack::PushL( self ); |
|
72 self->ConstructL( aExpiredNode.NodeIdentifier() ); |
|
73 return self; |
|
74 } |
|
75 |
|
76 CNcdExpiredNode::~CNcdExpiredNode() |
|
77 { |
|
78 delete iNodeIdentifier; |
|
79 iNodeIdentifier = 0; |
|
80 } |
|
81 |
|
82 |
|
83 void CNcdExpiredNode::InternalizeL( RReadStream& aReadStream ) |
|
84 { |
|
85 delete iNodeIdentifier; |
|
86 iNodeIdentifier = NULL; |
|
87 iNodeIdentifier = CNcdNodeIdentifier::NewL( aReadStream ); |
|
88 iForceUpdate = aReadStream.ReadInt32L(); |
|
89 } |
|
90 |
|
91 void CNcdExpiredNode::ExternalizeL( RWriteStream& aWriteStream ) const |
|
92 { |
|
93 iNodeIdentifier->ExternalizeL( aWriteStream ); |
|
94 aWriteStream.WriteInt32L( iForceUpdate ); |
|
95 } |
|
96 |
|
97 const CNcdNodeIdentifier& CNcdExpiredNode::NodeIdentifier() const |
|
98 { |
|
99 return *iNodeIdentifier; |
|
100 } |
|
101 |
|
102 TBool CNcdExpiredNode::ForceUpdate() const |
|
103 { |
|
104 return iForceUpdate; |
|
105 } |
|
106 |
|
107 CNcdExpiredNode::CNcdExpiredNode( TBool aForceUpdate ) |
|
108 : CBase(), iForceUpdate( aForceUpdate ) |
|
109 { |
|
110 } |
|
111 |
|
112 void CNcdExpiredNode::ConstructL( const CNcdNodeIdentifier& aNodeIdentifier ) |
|
113 { |
|
114 iNodeIdentifier = CNcdNodeIdentifier::NewL( aNodeIdentifier ); |
|
115 } |
|
116 |