servicediscoveryandcontrol/pnp/test/upnp/upnpdescription/inc/specversionparser.h
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 #ifndef __SPECVERSIONPARSER_H__
       
    17 #define __SPECVERSIONPARSER_H__
       
    18 
       
    19 #include <xml/parser.h>
       
    20 #include "parsehandlerbase.h"
       
    21 #include "cpnpdeviceparam.h"
       
    22 #include "cpnpserviceparam.h"
       
    23 /* CSpecVersionParser is used to parse the specification element in service and device
       
    24    description files
       
    25  */
       
    26 class CSpecVersionParser : public CParseHandlerBase
       
    27 	{
       
    28 public:
       
    29 	
       
    30 	static CSpecVersionParser* NewL(CUPnPDeviceDescription *aDeviceDesc, const RStringPool& aStringPool);
       
    31 	static CSpecVersionParser* NewL(CUPnPServiceDescription *aServiceDesc, const RStringPool& aStringPool);
       
    32 		
       
    33 	virtual ~CSpecVersionParser();
       
    34 
       
    35 	virtual void ParseStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes);
       
    36 	virtual void ParseEndElementL(const RTagInfo& aElement);
       
    37 	virtual void ParseContentL(const TDesC8& aBytes);
       
    38 
       
    39 private:
       
    40 	enum
       
    41 		{
       
    42 		ESpec			   = 	0x01,
       
    43 		EMajorVersion 	   = 	0x02,
       
    44 		EMinorVersion      = 	0x04,
       
    45 		};
       
    46 	enum TDescriptionType
       
    47 		{
       
    48 		EDeviceType  = 0xFE,
       
    49 		EServiceType = 0xFF,
       
    50 		};
       
    51 	TDescriptionType iType;
       
    52 	
       
    53 	CSpecVersionParser(CUPnPDeviceDescription* aDeviceDesc, const RStringPool& aStringPool);
       
    54 	CSpecVersionParser(CUPnPServiceDescription* aServiceDesc, const RStringPool& aStringPool);
       
    55 private:
       
    56 	CUPnPDeviceDescription* 	iDeviceDesc;
       
    57 	CUPnPServiceDescription* 	iServiceDesc;
       
    58 	
       
    59 	const RStringPool& iStringPool;
       
    60 	CParser* iXmlParser;
       
    61 	TUint iFlags;
       
    62 	};
       
    63 
       
    64 #endif//__SPECVERSIONPARSER_H__