|
1 // Copyright (c) 2005-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 // Node set functions |
|
15 // |
|
16 |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @publishedAll |
|
22 @released |
|
23 */ |
|
24 #ifndef XMLENGNODESET_H |
|
25 #define XMLENGNODESET_H |
|
26 |
|
27 #include <xml/dom/xmlengnode.h> |
|
28 |
|
29 /** |
|
30 This class implements the node set container, which is one of the result type |
|
31 in XPath. |
|
32 */ |
|
33 class RXmlEngNodeSet |
|
34 { |
|
35 friend class TXmlEngXPathEvaluator; |
|
36 friend class RXmlEngXPathResult; |
|
37 friend class RXmlEngXPathExpression; |
|
38 |
|
39 public: |
|
40 /** Default constructor */ |
|
41 IMPORT_C RXmlEngNodeSet(); |
|
42 |
|
43 /** |
|
44 Frees any allocated resources. |
|
45 |
|
46 As a node set only refers to existing nodes in the DOM tree, no nodes are |
|
47 freed. However, namespace declarations are copied into the node set and |
|
48 these copies are indeed freed. |
|
49 */ |
|
50 IMPORT_C void Free(); |
|
51 |
|
52 /** Closes the node set. This simply calls Free(). */ |
|
53 inline void Close(); |
|
54 |
|
55 /** |
|
56 Initializes the node set to an empty state. |
|
57 |
|
58 @see Free() |
|
59 |
|
60 This method is used when preparing node sets that will be used with |
|
61 RXmlEngXPathExpression::EvaluateWithDependenciesL(TXmlEngNode,RXmlEngNodeSet&) |
|
62 and |
|
63 TXmlEngXPathEvaluator::EvaluateWithDependenciesL(aExpression,aContextNode,aResolver,aDependents). |
|
64 |
|
65 @leave KErrNoMemory Memory allocation failure |
|
66 @leave - Otherwise, any of the system wide errors. |
|
67 */ |
|
68 IMPORT_C void InitializeL(); |
|
69 |
|
70 /** |
|
71 Gets the size of the node set |
|
72 @return The number of nodes |
|
73 */ |
|
74 IMPORT_C TInt Length() const; |
|
75 |
|
76 /** |
|
77 Checks whether a node is in the node set. |
|
78 |
|
79 @param aNode The node to check |
|
80 @return ETrue if the node is in the node set, EFalse otherwise |
|
81 */ |
|
82 IMPORT_C TBool Contains(TXmlEngNode aNode) const; |
|
83 |
|
84 /** |
|
85 Retrieves a node from the node set by index |
|
86 |
|
87 @param aIndex Node index ( 0 <= aIndex < Length() ) |
|
88 @return The node |
|
89 @leave KXmlEngErrWrongUseOfAPI aIndex is less than 0 or greater than |
|
90 Length(), in debug builds only. |
|
91 @leave - Otherwise, any of the system wide errors. |
|
92 */ |
|
93 IMPORT_C TXmlEngNode operator[](TInt aIndex) const; |
|
94 |
|
95 private: |
|
96 /** |
|
97 Constructor |
|
98 @param aData Internal data pointer |
|
99 */ |
|
100 RXmlEngNodeSet(void* aData); |
|
101 |
|
102 private: |
|
103 void* iInternal; |
|
104 |
|
105 }; |
|
106 |
|
107 #include <xml/dom/xmlengnodeset.inl> |
|
108 |
|
109 #endif /* XMLENGNODESET_H */ |
|
110 |