|
1 /* |
|
2 * Copyright (c) 2009 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <xml/documentparameters.h> |
|
21 #include <xml/taginfo.h> |
|
22 #include <xml/attribute.h> |
|
23 |
|
24 #include "iaupdateversionminorxmlparser.h" |
|
25 #include "iaupdateprotocolconsts.h" |
|
26 |
|
27 |
|
28 CIAUpdateVersionMinorXmlParser* CIAUpdateVersionMinorXmlParser::NewL( TIAUpdateVersion& aVersion ) |
|
29 { |
|
30 CIAUpdateVersionMinorXmlParser* self = |
|
31 CIAUpdateVersionMinorXmlParser::NewLC( aVersion ); |
|
32 CleanupStack::Pop( self ); |
|
33 return self; |
|
34 } |
|
35 |
|
36 |
|
37 CIAUpdateVersionMinorXmlParser* CIAUpdateVersionMinorXmlParser::NewLC( TIAUpdateVersion& aVersion ) |
|
38 { |
|
39 CIAUpdateVersionMinorXmlParser* self = |
|
40 new( ELeave ) CIAUpdateVersionMinorXmlParser( aVersion ); |
|
41 CleanupStack::PushL( self ); |
|
42 self->ConstructL(); |
|
43 return self; |
|
44 } |
|
45 |
|
46 |
|
47 CIAUpdateVersionMinorXmlParser::CIAUpdateVersionMinorXmlParser( TIAUpdateVersion& aVersion ) |
|
48 : CIAUpdateXmlSubParser(), |
|
49 iVersion( aVersion ) |
|
50 { |
|
51 |
|
52 } |
|
53 |
|
54 |
|
55 void CIAUpdateVersionMinorXmlParser::ConstructL() |
|
56 { |
|
57 CIAUpdateXmlSubParser::ConstructL( IAUpdateProtocolConsts::KVersionMinor() ); |
|
58 } |
|
59 |
|
60 |
|
61 CIAUpdateVersionMinorXmlParser::~CIAUpdateVersionMinorXmlParser() |
|
62 { |
|
63 } |
|
64 |
|
65 |
|
66 void CIAUpdateVersionMinorXmlParser::OnContentL( const TDesC8& aBytes, |
|
67 TInt aErrorCode ) |
|
68 { |
|
69 // If the parent wants to do something with the information. |
|
70 CIAUpdateXmlSubParser::OnContentL( aBytes, aErrorCode ); |
|
71 |
|
72 if ( AcceptData() ) |
|
73 { |
|
74 // Because there is no current subparser set, this means |
|
75 // that this parser is the leaf parser at the moment. |
|
76 |
|
77 // We have gotten content for this element. |
|
78 // Now, set the platform information to the dependency object. |
|
79 TInt value( 0 ); |
|
80 TLex8 lex( aBytes ); |
|
81 // If aBytes value was corrputed, |
|
82 // then just set the default value. |
|
83 lex.Val( value ); |
|
84 Version().iMinor = value; |
|
85 } |
|
86 } |
|
87 |
|
88 |
|
89 TIAUpdateVersion& CIAUpdateVersionMinorXmlParser::Version() |
|
90 { |
|
91 return iVersion; |
|
92 } |
|
93 |