servicediscoveryandcontrol/pnp/test/upnp/upnpdescription/src/deviceiconparser.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 "deviceiconparser.h"
       
    17 #include "upnpdescriptionschema.h"
       
    18 
       
    19 
       
    20 CDeviceIconParser* CDeviceIconParser::NewL(CUPnPIconInfo *aDeviceIcon, const RStringPool &aStringPool)
       
    21 	{
       
    22 	CDeviceIconParser* self = new (ELeave) CDeviceIconParser(aDeviceIcon,aStringPool);
       
    23 	return self;
       
    24 	}
       
    25 
       
    26 		
       
    27 CDeviceIconParser::CDeviceIconParser(CUPnPIconInfo *aDeviceIcon, const RStringPool &aStringPool) : iDeviceIcon(aDeviceIcon), iStringPool(aStringPool)
       
    28 	{
       
    29 	}
       
    30 
       
    31 CDeviceIconParser::~CDeviceIconParser()
       
    32 	{
       
    33 	}
       
    34 
       
    35 void CDeviceIconParser::ParseStartElementL(const RTagInfo& aElement, const RAttributeArray& /*aAttributes*/)
       
    36 	{
       
    37 	iSiblingsCount++;
       
    38 	iString = iStringPool.OpenStringL(aElement.LocalName().DesC());
       
    39 	}
       
    40 		
       
    41 
       
    42 void CDeviceIconParser::ParseEndElementL(const RTagInfo& /*aElement*/)
       
    43 	{
       
    44 	iSiblingsCount--;
       
    45 	iDeviceIcon->SetPropertyStatus(iString,ETrue);
       
    46 	iString.Close();
       
    47 	}
       
    48 
       
    49 void CDeviceIconParser::ParseContentL(const TDesC8& aBytes)
       
    50 	{
       
    51 	if ( !IsBlankSpace( aBytes ) )
       
    52 		iDeviceIcon->SetPropertyL(iString,aBytes);
       
    53 	}
       
    54