1 // Copyright (c) 2006-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Node list implementation functions
24 #ifndef XMLENGNODELIST_IMPL_H
25 #define XMLENGNODELIST_IMPL_H
28 #include <xml/dom/xmlengnode.h>
31 This class should not be used directly. However, it defines the interface for
32 RXmlEngNodeList<TXmlEngNode> through template specialization.
36 This class implements an iterator or filtered iterator for a tree. The OpenL()
37 methods control which nodes are included in the iterator. It is possible to
38 iterate across all node types or only a single type. It is possible to iterate
39 only over nodes within a specific namespace. It is also possible to iterate
40 over nodes with the same name.
42 class RXmlEngNodeListImpl
46 /** Default constructor */
47 IMPORT_C RXmlEngNodeListImpl();
50 Closes a node list. This does not affect any of the nodes. Only
51 internally used memory is freed.
53 IMPORT_C void Close();
57 @return Number of nodes in the list
59 IMPORT_C TInt Count() const;
62 Checks whether the next node exists in the list
63 @return ETrue if the next node exists, EFalse otherwise
65 IMPORT_C TBool HasNext() const;
68 Gets the next node in the list
69 @return The next node or NULL if it does not exist
71 IMPORT_C TXmlEngNode Next();
74 Initializes the list. The parameters to this method control what nodes are
75 included in the list. If aType is NULL, all nodes are included in the
76 list. Both aName and aNs, if specified, are copied internally.
78 @param aHead The first node in the list
79 @param aType Only include nodes of this type
80 @param aName Only include nodes that match this name
81 @param aNs Only include nodes that match this namespace
82 @leave - One of the system-wide error codes
86 TXmlEngNode::TXmlEngDOMNodeType aType,
87 const TDesC8& aName = KNullDesC8,
88 const TDesC8& aNs = KNullDesC8);
91 Initializes the list. The parameters to this method control what nodes are
92 included in the list. If aType is NULL, all nodes are included in the
95 @param aHead The first node in the list
96 @param aType Only include nodes of this type
100 TXmlEngNode::TXmlEngDOMNodeType aType);
105 Finds the next node in the list according to the criteria specified in OpenL().
106 @param aCurrentNode The current node pointer
107 @return The next node or NULL if no next node
109 void* FindNextNode(void* aCurrentNode) const;
112 TInt iType; // NodeType:4 bits (0-3) & MatchName flag (bit 4)
113 unsigned char* iName;
114 unsigned char* iNsUri;
118 Compares two strings.
119 @param aStr1 String 1 to compare
120 @param aStr2 String 2 to compare
121 @return ETrue of aStr1 and aStr2 are equal or if they are both NULL. EFalse otherwise.
123 TBool StrEqualOrNull(const void* aStr1, const void* aStr2);
126 #endif /* XMLENGNODELIST_IMPL_H */