epoc32/include/xmlengnodelist.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/xmlengnodelist.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/xmlengnodelist.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,131 @@
     1.4 -xmlengnodelist.h
     1.5 +/*
     1.6 +* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:       Node list inline functions
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +
    1.24 +
    1.25 +
    1.26 +
    1.27 +
    1.28 +#ifndef XMLENGINE_NODELIST_H_INCLUDED
    1.29 +#define XMLENGINE_NODELIST_H_INCLUDED
    1.30 +
    1.31 +#include "xmlengnode.h"
    1.32 +#include "xmlengnodelist_impl.h"
    1.33 +
    1.34 +
    1.35 +
    1.36 +/**
    1.37 + * Template implements list container.
    1.38 + *
    1.39 + * List may contain different types of nodes.
    1.40 + * Node pointer is casted to specify node type when
    1.41 + * is returned by Next() method.
    1.42 + *
    1.43 + * @lib XmlEngineDOM.lib
    1.44 + * @since S60 v3.2
    1.45 + */
    1.46 +template<class T> 
    1.47 +class RXmlEngNodeList
    1.48 +{
    1.49 +public:
    1.50 +    /**
    1.51 +     * Get list length.
    1.52 +     *
    1.53 +     * @since S60 v3.2
    1.54 +     * @return Number of nodes in a node list
    1.55 +     */
    1.56 +	inline TInt Count() const;
    1.57 +
    1.58 +    /**
    1.59 +     * Checks whether next node exists in a node list
    1.60 +     *
    1.61 +     * @since S60 v3.2
    1.62 +     * @return TRUE if next node exists, FALSE otherwise
    1.63 +     */
    1.64 +	inline TBool HasNext() const;
    1.65 +
    1.66 +    /**
    1.67 +     * Retrieves next node from a node list
    1.68 +     *
    1.69 +     * @since S60 v3.2
    1.70 +     * @return Next node 
    1.71 +     */
    1.72 +	inline T Next();
    1.73 +
    1.74 +    /**
    1.75 +     * Closes a node list
    1.76 +     *
    1.77 +     * @since S60 v3.2
    1.78 +     */
    1.79 +	inline void Close();
    1.80 +
    1.81 +private:
    1.82 +    friend class TXmlEngNode;
    1.83 +    friend class TXmlEngElement;
    1.84 +
    1.85 +    /*
    1.86 +     * Opens node.
    1.87 +     *
    1.88 +     * @since S60 v3.2
    1.89 +     * @param aHead node pointer to the node from which the searching 
    1.90 +            of list elements is started
    1.91 +     * @param aType type of list elements
    1.92 +     * @param aName name of list elements 
    1.93 +     * @param aNs namespace of list elements
    1.94 +     *
    1.95 +     * @note If aType is NULL, aName and aNs are ignored
    1.96 +     */
    1.97 +    void OpenL( 
    1.98 +			void* aHead,
    1.99 +			TXmlEngNode::TXmlEngDOMNodeType aType,
   1.100 +			const TDesC8&	aName = KNullDesC8,
   1.101 +			const TDesC8&	aNs = KNullDesC8);
   1.102 +
   1.103 +    /** 
   1.104 +     * Opens node.
   1.105 +     *
   1.106 +     * @since S60 v3.2
   1.107 +     * @param aHead node pointer to the node from which the searching 
   1.108 +            of list elements is started
   1.109 +     * @param aType type of list elements
   1.110 +     */
   1.111 +    void Open( 
   1.112 +			void* aHead,
   1.113 +			TXmlEngNode::TXmlEngDOMNodeType aType);
   1.114 +
   1.115 +    /** List with nodes */
   1.116 +	RXmlEngNodeListImpl iList;
   1.117 +};
   1.118 +
   1.119 +/**
   1.120 + * Template implements list container for nodes.
   1.121 + *
   1.122 + * Specialization for trivial case: list of TXmlEngNode objects
   1.123 + * No "thin wrapper" pattern needed, operate directly on NodeListImpl
   1.124 + *
   1.125 + * @lib XmlEngineDOM.lib
   1.126 + * @since S60 v3.1
   1.127 + */
   1.128 +template<>
   1.129 +class RXmlEngNodeList<TXmlEngNode>: public RXmlEngNodeListImpl {};
   1.130 +
   1.131 +
   1.132 +
   1.133 +#include "xmlengnodelist.inl"
   1.134 +
   1.135 +#endif /* XMLENGINE_NODELIST_H_INCLUDED */