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