servicediscoveryandcontrol/pnp/test/upnp/upnpdescription/src/serviceinfoparser.cpp
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "serviceinfoparser.h"
       
    17 #include "upnpdescriptionschema.h"
       
    18 
       
    19 CServiceInfoParser* CServiceInfoParser::NewL(CUPnPServiceInfo *aServiceInfo, const RStringPool &aStringPool)
       
    20 	{
       
    21 	CServiceInfoParser* self = new (ELeave) CServiceInfoParser(aServiceInfo, aStringPool);
       
    22 	return self;
       
    23 	}
       
    24 
       
    25 		
       
    26 CServiceInfoParser::CServiceInfoParser(CUPnPServiceInfo *aServiceInfo, const RStringPool &aStringPool) : iServiceInfo(aServiceInfo), iStringPool(aStringPool)
       
    27 	{
       
    28 	}
       
    29 
       
    30 CServiceInfoParser::~CServiceInfoParser()
       
    31 	{
       
    32 	}
       
    33 
       
    34 void CServiceInfoParser::ParseStartElementL(const RTagInfo& aElement, const RAttributeArray& /*aAttributes*/)
       
    35 	{
       
    36 	iSiblingsCount++;
       
    37 	iString = iStringPool.OpenStringL(aElement.LocalName().DesC());
       
    38 	
       
    39 	}
       
    40 
       
    41 void CServiceInfoParser::ParseEndElementL(const RTagInfo& /*aElement*/)
       
    42 	{
       
    43 	iSiblingsCount--;
       
    44 	iServiceInfo->SetPropertyStatus(iString,ETrue);
       
    45 	iString.Close();
       
    46 	}
       
    47 
       
    48 void CServiceInfoParser::ParseContentL(const TDesC8& aBytes)
       
    49 	{
       
    50 	if ( !IsBlankSpace( aBytes ) )
       
    51 		{
       
    52 		iServiceInfo->SetPropertyL(iString , aBytes);
       
    53 		}
       
    54 	}