|
1 /* |
|
2 * Copyright (c) 2006 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: CNcdUnknownParser implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32debug.h> |
|
20 #include "ncdunknownparser.h" |
|
21 #include "catalogsdebug.h" |
|
22 |
|
23 CNcdUnknownParser* CNcdUnknownParser::NewL( MNcdParserObserverBundle& aObservers, |
|
24 MNcdSubParserObserver& aSubParserObserver, |
|
25 TInt aDepth, |
|
26 const Xml::RTagInfo& aElement, |
|
27 const Xml::RAttributeArray& aAttributes ) |
|
28 { |
|
29 DLTRACE(("depth=%d, tag=%S",aDepth,&aElement.LocalName().DesC())); |
|
30 CNcdUnknownParser* self = new(ELeave) CNcdUnknownParser( aObservers, |
|
31 aSubParserObserver, |
|
32 aDepth ); |
|
33 CleanupStack::PushL( self ); |
|
34 self->ConstructL( aElement, aAttributes ); |
|
35 CleanupStack::Pop( self ); |
|
36 return self; |
|
37 } |
|
38 |
|
39 CNcdUnknownParser::CNcdUnknownParser( MNcdParserObserverBundle& aObservers, |
|
40 MNcdSubParserObserver& aSubParserObserver, |
|
41 TInt aDepth ) |
|
42 : CNcdSubParser( aObservers, aSubParserObserver, aDepth, EParserUnknown ), |
|
43 iInitialDepth( aDepth ) |
|
44 { |
|
45 DLTRACEIN(("")); |
|
46 DLINFO(("initial depth=%d",iInitialDepth)); |
|
47 } |
|
48 |
|
49 CNcdUnknownParser::~CNcdUnknownParser() |
|
50 { |
|
51 DLTRACEIN(("")); |
|
52 } |
|
53 |
|
54 void CNcdUnknownParser::ConstructL( |
|
55 const Xml::RTagInfo& aElement, |
|
56 const Xml::RAttributeArray& /*aAttributes*/ ) |
|
57 { |
|
58 CNcdSubParser::ConstructL( aElement ); |
|
59 } |
|
60 |
|
61 |
|
62 void CNcdUnknownParser::OnStartElementL( const Xml::RTagInfo& aElement, |
|
63 const Xml::RAttributeArray& aAttributes, |
|
64 TInt aErrorCode) |
|
65 { |
|
66 CNcdSubParser::OnStartElementL( aElement, aAttributes, aErrorCode ); |
|
67 DLTRACEIN(("unknown start tag=%S depth=%d error=%d",&aElement.LocalName().DesC(),iDepth,aErrorCode)); |
|
68 |
|
69 iDepth++; |
|
70 // Ignore everything |
|
71 } |
|
72 |
|
73 void CNcdUnknownParser::OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode) |
|
74 { |
|
75 DLTRACEIN(("unknown end tag=%S depth=%d error=%d",&aElement.LocalName().DesC(),iDepth,aErrorCode)); |
|
76 // Ignore everything |
|
77 if( iDepth == iInitialDepth && aElement.LocalName().DesC() == Tag() ) |
|
78 { |
|
79 DLINFO(("unknown section ended, tag=%S",iTag)); |
|
80 iSubParserObserver->SubParserFinishedL( aElement.LocalName().DesC(), aErrorCode ); |
|
81 } |
|
82 else |
|
83 { |
|
84 iDepth--; |
|
85 } |
|
86 } |
|
87 |
|
88 void CNcdUnknownParser::OnContentL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/) |
|
89 { |
|
90 // Ignore. |
|
91 DLTRACEIN(("")); |
|
92 } |
|
93 |