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