--- a/epoc32/include/xml/dom/xmlengnodelist.h Wed Mar 31 12:27:01 2010 +0100
+++ b/epoc32/include/xml/dom/xmlengnodelist.h Wed Mar 31 12:33:34 2010 +0100
@@ -1,131 +1,114 @@
-/*
-* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
-* which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Node list inline functions
-*
-*/
-
-
-
-
-
-
-
-#ifndef XMLENGINE_NODELIST_H_INCLUDED
-#define XMLENGINE_NODELIST_H_INCLUDED
-
-#include "xmlengnode.h"
-#include "xmlengnodelist_impl.h"
+// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Node list class
+//
/**
- * Template implements list container.
- *
- * List may contain different types of nodes.
- * Node pointer is casted to specify node type when
- * is returned by Next() method.
- *
- * @lib XmlEngineDOM.lib
- * @since S60 v3.2
- */
+ @file
+ @publishedAll
+ @released
+*/
+#ifndef XMLENGNODELIST_H
+#define XMLENGNODELIST_H
+
+#include <xml/dom/xmlengnode.h>
+#include <xml/dom/xmlengnodelist_impl.h>
+
+/**
+Implements an iterator or filtered iterator for a tree.
+
+This classes behaves in two very different ways, depending on the
+template parameter.
+
+1) RXmlEngNodeList<TXmlEngNode>
+
+Through template specialization, this becomes an alias for RXmlEngNodeListImpl.
+The RXmlEngNodeListImpl::OpenL() methods control which nodes are included in
+the iterator. It is possible to iterate across all node types or only a single
+type. It is possible to iterate only over nodes within a specific namespace.
+It is also possible to iterate over nodes with the same name.
+
+RXmlEngNodeListImpl should not be used directly.
+
+@see RXmlEngNodeListImpl
+
+2) RXmlEngNodeList<X> where X is not TXmlEngNode
+
+As the OpenL() methods of this class are private, this class cannot be opened
+except by friend classes TXmlEngNode and TXmlEngElement. As such, this form
+should not be used.
+*/
template<class T>
class RXmlEngNodeList
{
+ friend class TXmlEngNode;
+ friend class TXmlEngElement;
+
public:
/**
- * Get list length.
- *
- * @since S60 v3.2
- * @return Number of nodes in a node list
- */
+ Gets the list length.
+ @return The number of nodes in the list
+ */
inline TInt Count() const;
/**
- * Checks whether next node exists in a node list
- *
- * @since S60 v3.2
- * @return TRUE if next node exists, FALSE otherwise
- */
+ Checks whether a next node exists in the list
+ @return ETrue of a next node exists, EFalse otherwise
+ */
inline TBool HasNext() const;
/**
- * Retrieves next node from a node list
- *
- * @since S60 v3.2
- * @return Next node
- */
+ Gets the next node in the list
+ @return The next node casted to the templated type or NULL if it does not
+ exist
+ */
inline T Next();
- /**
- * Closes a node list
- *
- * @since S60 v3.2
- */
+ /**
+ Closes a node list. This does not affect any of the nodes. Only
+ internally used memory is freed.
+ */
inline void Close();
private:
- friend class TXmlEngNode;
- friend class TXmlEngElement;
- /*
- * Opens node.
- *
- * @since S60 v3.2
- * @param aHead node pointer to the node from which the searching
- of list elements is started
- * @param aType type of list elements
- * @param aName name of list elements
- * @param aNs namespace of list elements
- *
- * @note If aType is NULL, aName and aNs are ignored
- */
- void OpenL(
+ inline void OpenL(
void* aHead,
TXmlEngNode::TXmlEngDOMNodeType aType,
const TDesC8& aName = KNullDesC8,
const TDesC8& aNs = KNullDesC8);
- /**
- * Opens node.
- *
- * @since S60 v3.2
- * @param aHead node pointer to the node from which the searching
- of list elements is started
- * @param aType type of list elements
- */
- void Open(
+ inline void Open(
void* aHead,
TXmlEngNode::TXmlEngDOMNodeType aType);
- /** List with nodes */
+private:
RXmlEngNodeListImpl iList;
};
/**
- * Template implements list container for nodes.
- *
- * Specialization for trivial case: list of TXmlEngNode objects
- * No "thin wrapper" pattern needed, operate directly on NodeListImpl
- *
- * @lib XmlEngineDOM.lib
- * @since S60 v3.1
- */
+This template specialization makes RXmlEngNodeList<TXmlEngNode> an alias for
+RXmlEngNodeListImpl. No part of the class specified above is used, rather the
+interface (and implementation) of RXmlEngNodeListImpl is used instead.
+*/
template<>
class RXmlEngNodeList<TXmlEngNode>: public RXmlEngNodeListImpl {};
+#include <xml/dom/xmlengnodelist.inl>
-#include "xmlengnodelist.inl"
+#endif /* XMLENGNODELIST_H */
-#endif /* XMLENGINE_NODELIST_H_INCLUDED */