iaupdate/IAD/engine/controller/src/iaupdatenodeversionxmlparser.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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 "iaupdatenodeversionxmlparser.h"
       
    25 #include "iaupdateversionmajorxmlparser.h"
       
    26 #include "iaupdateversionminorxmlparser.h"
       
    27 #include "iaupdateversionbuildxmlparser.h"
       
    28 #include "iaupdateprotocolconsts.h"
       
    29 
       
    30 
       
    31 
       
    32 CIAUpdateNodeVersionXmlParser::CIAUpdateNodeVersionXmlParser( 
       
    33                                          CIAUpdateNodeDependency*& aDependency )
       
    34 : CIAUpdateXmlSubParser(),
       
    35   iDependency( aDependency )
       
    36     {
       
    37     
       
    38     }
       
    39     
       
    40     
       
    41 void CIAUpdateNodeVersionXmlParser::ConstructL( const TDesC8& aElementLocalName )
       
    42     {
       
    43     CIAUpdateXmlSubParser::ConstructL( aElementLocalName );    
       
    44 
       
    45     // Create sub parsers for the version element handling
       
    46 
       
    47     CIAUpdateVersionMajorXmlParser* majorParser(
       
    48         CIAUpdateVersionMajorXmlParser::NewLC( Version() ) );
       
    49     SubParsers().AppendL( majorParser );
       
    50     CleanupStack::Pop( majorParser );
       
    51 
       
    52     CIAUpdateVersionMinorXmlParser* minorParser(
       
    53         CIAUpdateVersionMinorXmlParser::NewLC( Version() ) );
       
    54     SubParsers().AppendL( minorParser );
       
    55     CleanupStack::Pop( minorParser );
       
    56 
       
    57     CIAUpdateVersionBuildXmlParser* buildParser(
       
    58         CIAUpdateVersionBuildXmlParser::NewLC( Version() ) );
       
    59     SubParsers().AppendL( buildParser );
       
    60     CleanupStack::Pop( buildParser );    
       
    61     }
       
    62 
       
    63 
       
    64 CIAUpdateNodeVersionXmlParser::~CIAUpdateNodeVersionXmlParser()
       
    65     {
       
    66     }
       
    67 
       
    68 
       
    69 CIAUpdateNodeDependency& CIAUpdateNodeVersionXmlParser::DependencyL()
       
    70     {
       
    71     if ( !iDependency )
       
    72         {
       
    73         User::Leave( KErrNotFound );
       
    74         }
       
    75         
       
    76     return *iDependency;
       
    77     }
       
    78 
       
    79 
       
    80 TIAUpdateVersion& CIAUpdateNodeVersionXmlParser::Version()
       
    81     {
       
    82     return iVersion;
       
    83     }
       
    84