williamr@4: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: // All rights reserved. williamr@4: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@4: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: // williamr@4: // Initial Contributors: williamr@4: // Nokia Corporation - initial contribution. williamr@4: // williamr@4: // Contributors: williamr@4: // williamr@4: // Description: williamr@4: // Node set functions williamr@4: // williamr@4: williamr@4: williamr@4: williamr@4: /** williamr@4: @file williamr@4: @publishedAll williamr@4: @released williamr@4: */ williamr@4: #ifndef XMLENGNODESET_H williamr@4: #define XMLENGNODESET_H williamr@4: williamr@4: #include williamr@4: williamr@4: /** williamr@4: This class implements the node set container, which is one of the result type williamr@4: in XPath. williamr@4: */ williamr@4: class RXmlEngNodeSet williamr@4: { williamr@4: friend class TXmlEngXPathEvaluator; williamr@4: friend class RXmlEngXPathResult; williamr@4: friend class RXmlEngXPathExpression; williamr@4: williamr@4: public: williamr@4: /** Default constructor */ williamr@4: IMPORT_C RXmlEngNodeSet(); williamr@4: williamr@4: /** williamr@4: Frees any allocated resources. williamr@4: williamr@4: As a node set only refers to existing nodes in the DOM tree, no nodes are williamr@4: freed. However, namespace declarations are copied into the node set and williamr@4: these copies are indeed freed. williamr@4: */ williamr@4: IMPORT_C void Free(); williamr@4: williamr@4: /** Closes the node set. This simply calls Free(). */ williamr@4: inline void Close(); williamr@4: williamr@4: /** williamr@4: Initializes the node set to an empty state. williamr@4: williamr@4: @see Free() williamr@4: williamr@4: This method is used when preparing node sets that will be used with williamr@4: RXmlEngXPathExpression::EvaluateWithDependenciesL(TXmlEngNode,RXmlEngNodeSet&) williamr@4: and williamr@4: TXmlEngXPathEvaluator::EvaluateWithDependenciesL(aExpression,aContextNode,aResolver,aDependents). williamr@4: williamr@4: @leave KErrNoMemory Memory allocation failure williamr@4: @leave - Otherwise, any of the system wide errors. williamr@4: */ williamr@4: IMPORT_C void InitializeL(); williamr@4: williamr@4: /** williamr@4: Gets the size of the node set williamr@4: @return The number of nodes williamr@4: */ williamr@4: IMPORT_C TInt Length() const; williamr@4: williamr@4: /** williamr@4: Checks whether a node is in the node set. williamr@4: williamr@4: @param aNode The node to check williamr@4: @return ETrue if the node is in the node set, EFalse otherwise williamr@4: */ williamr@4: IMPORT_C TBool Contains(TXmlEngNode aNode) const; williamr@4: williamr@4: /** williamr@4: Retrieves a node from the node set by index williamr@4: williamr@4: @param aIndex Node index ( 0 <= aIndex < Length() ) williamr@4: @return The node williamr@4: @leave KXmlEngErrWrongUseOfAPI aIndex is less than 0 or greater than williamr@4: Length(), in debug builds only. williamr@4: @leave - Otherwise, any of the system wide errors. williamr@4: */ williamr@4: IMPORT_C TXmlEngNode operator[](TInt aIndex) const; williamr@4: williamr@4: private: williamr@4: /** williamr@4: Constructor williamr@4: @param aData Internal data pointer williamr@4: */ williamr@4: RXmlEngNodeSet(void* aData); williamr@4: williamr@4: private: williamr@4: void* iInternal; williamr@4: williamr@4: }; williamr@4: williamr@4: #include williamr@4: williamr@4: #endif /* XMLENGNODESET_H */ williamr@4: