1.1 --- a/epoc32/include/xml/dom/xmlengnodelist.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/xml/dom/xmlengnodelist.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,131 +1,114 @@
1.4 -/*
1.5 -* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
1.6 -* All rights reserved.
1.7 -* This component and the accompanying materials are made available
1.8 -* 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
1.9 -* which accompanies this distribution, and is available
1.10 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 -*
1.12 -* Initial Contributors:
1.13 -* Nokia Corporation - initial contribution.
1.14 -*
1.15 -* Contributors:
1.16 -*
1.17 -* Description: Node list inline functions
1.18 -*
1.19 -*/
1.20 -
1.21 -
1.22 -
1.23 -
1.24 -
1.25 -
1.26 -
1.27 -#ifndef XMLENGINE_NODELIST_H_INCLUDED
1.28 -#define XMLENGINE_NODELIST_H_INCLUDED
1.29 -
1.30 -#include "xmlengnode.h"
1.31 -#include "xmlengnodelist_impl.h"
1.32 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.33 +// All rights reserved.
1.34 +// This component and the accompanying materials are made available
1.35 +// under the terms of "Eclipse Public License v1.0"
1.36 +// which accompanies this distribution, and is available
1.37 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.38 +//
1.39 +// Initial Contributors:
1.40 +// Nokia Corporation - initial contribution.
1.41 +//
1.42 +// Contributors:
1.43 +//
1.44 +// Description:
1.45 +// Node list class
1.46 +//
1.47
1.48
1.49
1.50 /**
1.51 - * Template implements list container.
1.52 - *
1.53 - * List may contain different types of nodes.
1.54 - * Node pointer is casted to specify node type when
1.55 - * is returned by Next() method.
1.56 - *
1.57 - * @lib XmlEngineDOM.lib
1.58 - * @since S60 v3.2
1.59 - */
1.60 + @file
1.61 + @publishedAll
1.62 + @released
1.63 +*/
1.64 +#ifndef XMLENGNODELIST_H
1.65 +#define XMLENGNODELIST_H
1.66 +
1.67 +#include <xml/dom/xmlengnode.h>
1.68 +#include <xml/dom/xmlengnodelist_impl.h>
1.69 +
1.70 +/**
1.71 +Implements an iterator or filtered iterator for a tree.
1.72 +
1.73 +This classes behaves in two very different ways, depending on the
1.74 +template parameter.
1.75 +
1.76 +1) RXmlEngNodeList<TXmlEngNode>
1.77 +
1.78 +Through template specialization, this becomes an alias for RXmlEngNodeListImpl.
1.79 +The RXmlEngNodeListImpl::OpenL() methods control which nodes are included in
1.80 +the iterator. It is possible to iterate across all node types or only a single
1.81 +type. It is possible to iterate only over nodes within a specific namespace.
1.82 +It is also possible to iterate over nodes with the same name.
1.83 +
1.84 +RXmlEngNodeListImpl should not be used directly.
1.85 +
1.86 +@see RXmlEngNodeListImpl
1.87 +
1.88 +2) RXmlEngNodeList<X> where X is not TXmlEngNode
1.89 +
1.90 +As the OpenL() methods of this class are private, this class cannot be opened
1.91 +except by friend classes TXmlEngNode and TXmlEngElement. As such, this form
1.92 +should not be used.
1.93 +*/
1.94 template<class T>
1.95 class RXmlEngNodeList
1.96 {
1.97 + friend class TXmlEngNode;
1.98 + friend class TXmlEngElement;
1.99 +
1.100 public:
1.101 /**
1.102 - * Get list length.
1.103 - *
1.104 - * @since S60 v3.2
1.105 - * @return Number of nodes in a node list
1.106 - */
1.107 + Gets the list length.
1.108 + @return The number of nodes in the list
1.109 + */
1.110 inline TInt Count() const;
1.111
1.112 /**
1.113 - * Checks whether next node exists in a node list
1.114 - *
1.115 - * @since S60 v3.2
1.116 - * @return TRUE if next node exists, FALSE otherwise
1.117 - */
1.118 + Checks whether a next node exists in the list
1.119 + @return ETrue of a next node exists, EFalse otherwise
1.120 + */
1.121 inline TBool HasNext() const;
1.122
1.123 /**
1.124 - * Retrieves next node from a node list
1.125 - *
1.126 - * @since S60 v3.2
1.127 - * @return Next node
1.128 - */
1.129 + Gets the next node in the list
1.130 + @return The next node casted to the templated type or NULL if it does not
1.131 + exist
1.132 + */
1.133 inline T Next();
1.134
1.135 - /**
1.136 - * Closes a node list
1.137 - *
1.138 - * @since S60 v3.2
1.139 - */
1.140 + /**
1.141 + Closes a node list. This does not affect any of the nodes. Only
1.142 + internally used memory is freed.
1.143 + */
1.144 inline void Close();
1.145
1.146 private:
1.147 - friend class TXmlEngNode;
1.148 - friend class TXmlEngElement;
1.149
1.150 - /*
1.151 - * Opens node.
1.152 - *
1.153 - * @since S60 v3.2
1.154 - * @param aHead node pointer to the node from which the searching
1.155 - of list elements is started
1.156 - * @param aType type of list elements
1.157 - * @param aName name of list elements
1.158 - * @param aNs namespace of list elements
1.159 - *
1.160 - * @note If aType is NULL, aName and aNs are ignored
1.161 - */
1.162 - void OpenL(
1.163 + inline void OpenL(
1.164 void* aHead,
1.165 TXmlEngNode::TXmlEngDOMNodeType aType,
1.166 const TDesC8& aName = KNullDesC8,
1.167 const TDesC8& aNs = KNullDesC8);
1.168
1.169 - /**
1.170 - * Opens node.
1.171 - *
1.172 - * @since S60 v3.2
1.173 - * @param aHead node pointer to the node from which the searching
1.174 - of list elements is started
1.175 - * @param aType type of list elements
1.176 - */
1.177 - void Open(
1.178 + inline void Open(
1.179 void* aHead,
1.180 TXmlEngNode::TXmlEngDOMNodeType aType);
1.181
1.182 - /** List with nodes */
1.183 +private:
1.184 RXmlEngNodeListImpl iList;
1.185 };
1.186
1.187 /**
1.188 - * Template implements list container for nodes.
1.189 - *
1.190 - * Specialization for trivial case: list of TXmlEngNode objects
1.191 - * No "thin wrapper" pattern needed, operate directly on NodeListImpl
1.192 - *
1.193 - * @lib XmlEngineDOM.lib
1.194 - * @since S60 v3.1
1.195 - */
1.196 +This template specialization makes RXmlEngNodeList<TXmlEngNode> an alias for
1.197 +RXmlEngNodeListImpl. No part of the class specified above is used, rather the
1.198 +interface (and implementation) of RXmlEngNodeListImpl is used instead.
1.199 +*/
1.200 template<>
1.201 class RXmlEngNodeList<TXmlEngNode>: public RXmlEngNodeListImpl {};
1.202
1.203
1.204 +#include <xml/dom/xmlengnodelist.inl>
1.205
1.206 -#include "xmlengnodelist.inl"
1.207 +#endif /* XMLENGNODELIST_H */
1.208
1.209 -#endif /* XMLENGINE_NODELIST_H_INCLUDED */