|
1 /* |
|
2 * Copyright (c) 2005,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: Depth iterator walks the dom tree by depth first. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef XN_DOM_DEPTH_ITERATOR_H |
|
21 #define XN_DOM_DEPTH_ITERATOR_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "mxndomiterator.h" |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CXnDomNode; |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * @ingroup group_domdocument |
|
36 * Depth iterator walks through the dom tree using the depth first |
|
37 * principle. |
|
38 * |
|
39 * @lib xndomdocument.lib |
|
40 */ |
|
41 class CXnDomDepthIterator: public CBase, public MXnDomIterator |
|
42 { |
|
43 public: |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * @param aStartNode object to iterate over |
|
47 */ |
|
48 IMPORT_C static CXnDomDepthIterator* NewL( CXnDomNode& aStartNode ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 IMPORT_C virtual ~CXnDomDepthIterator(); |
|
54 |
|
55 /** |
|
56 * Documented in MXnDomIterator::First |
|
57 */ |
|
58 IMPORT_C CXnDomNode* First(); |
|
59 |
|
60 /** |
|
61 * Documented in MXnDomIterator::NextL |
|
62 */ |
|
63 IMPORT_C CXnDomNode* NextL(); |
|
64 |
|
65 private: |
|
66 /** |
|
67 * C++ default constructor |
|
68 */ |
|
69 CXnDomDepthIterator( CXnDomNode* aRootNode ); |
|
70 |
|
71 /** |
|
72 * By default Symbian 2nd phase constructor is private. |
|
73 */ |
|
74 void ConstructL(); |
|
75 |
|
76 /** |
|
77 * Push node to stack. |
|
78 * @param aNode Node to push |
|
79 */ |
|
80 //void PushL( CXnDomNode& aNode ); |
|
81 |
|
82 /** |
|
83 * Pop node from the stack. |
|
84 * @return Pointer to node |
|
85 */ |
|
86 //CXnDomNode* Pop(); |
|
87 |
|
88 private: |
|
89 // Follow tree hierarchy with stack |
|
90 RPointerArray< CXnDomNode > iStack; |
|
91 // First node |
|
92 CXnDomNode* iStart; |
|
93 //Current node |
|
94 CXnDomNode* iCurrent; |
|
95 }; |
|
96 |
|
97 #endif // XN_DOM_DEPTH_ITERATOR_H |
|
98 |
|
99 // End of File |