epoc32/include/xml/dom/xmlengnodelist_impl.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Node list implementation functions
    15 //
    16 
    17 
    18 
    19 /**
    20  @file
    21  @publishedAll
    22  @released
    23 */
    24 #ifndef XMLENGNODELIST_IMPL_H
    25 #define XMLENGNODELIST_IMPL_H
    26 
    27 #include <e32def.h>
    28 #include <xml/dom/xmlengnode.h>
    29 
    30 /** 
    31 This class should not be used directly.  However, it defines the interface for
    32 RXmlEngNodeList<TXmlEngNode> through template specialization.
    33 
    34 @see RXmlEngNodeList
    35 
    36 This class implements an iterator or filtered iterator for a tree.  The OpenL()
    37 methods control which nodes are included in the iterator.  It is possible to
    38 iterate across all node types or only a single type.  It is possible to iterate
    39 only over nodes within a specific namespace.  It is also possible to iterate
    40 over nodes with the same name.
    41 */
    42 class RXmlEngNodeListImpl
    43 {
    44 public:
    45 
    46     /** Default constructor */
    47     IMPORT_C RXmlEngNodeListImpl();
    48 
    49     /** 
    50 	Closes a node list.  This does not affect any of the nodes.  Only
    51 	internally used memory is freed.
    52 	*/
    53     IMPORT_C void Close();
    54 
    55     /** 
    56     Gets the list length.
    57     @return Number of nodes in the list
    58     */
    59     IMPORT_C TInt  Count() const;
    60 
    61     /** 
    62     Checks whether the next node exists in the list
    63     @return ETrue if the next node exists, EFalse otherwise
    64     */
    65     IMPORT_C TBool HasNext() const;
    66 
    67     /** 
    68     Gets the next node in the list
    69     @return The next node or NULL if it does not exist
    70     */
    71     IMPORT_C TXmlEngNode Next();
    72 
    73     /** 
    74 	Initializes the list.  The parameters to this method control what nodes are
    75 	included in the list.  If aType is NULL, all nodes are included in the
    76 	list.  Both aName and aNs, if specified, are copied internally.
    77 
    78 	@param aHead The first node in the list
    79     @param aType Only include nodes of this type
    80     @param aName Only include nodes that match this name
    81     @param aNs Only include nodes that match this namespace
    82 	@leave - One of the system-wide error codes
    83     */
    84     void OpenL( 
    85 			void* aHead,
    86 			TXmlEngNode::TXmlEngDOMNodeType aType,
    87 			const TDesC8&	aName = KNullDesC8,
    88 			const TDesC8&	aNs = KNullDesC8);
    89 
    90     /** 
    91 	Initializes the list.  The parameters to this method control what nodes are
    92 	included in the list.  If aType is NULL, all nodes are included in the
    93 	list.
    94 
    95 	@param aHead The first node in the list
    96     @param aType Only include nodes of this type
    97     */
    98     void Open( 
    99 			void* aHead,
   100 			TXmlEngNode::TXmlEngDOMNodeType aType);
   101 
   102 private:
   103 
   104 	/**
   105 	Finds the next node in the list according to the criteria specified in OpenL().
   106 	@param aCurrentNode The current node pointer
   107 	@return The next node or NULL if no next node
   108 	*/
   109     void* FindNextNode(void* aCurrentNode) const;
   110 
   111     void*	        iCurrentNode;
   112 	TInt		    iType;  // NodeType:4 bits (0-3) & MatchName flag (bit 4)
   113 	unsigned char*	iName;
   114 	unsigned char*	iNsUri;
   115 };
   116 
   117 /**
   118 Compares two strings.
   119 @param aStr1 String 1 to compare
   120 @param aStr2 String 2 to compare
   121 @return ETrue of aStr1 and aStr2 are equal or if they are both NULL.  EFalse otherwise.
   122 */
   123 TBool StrEqualOrNull(const void* aStr1, const void* aStr2);
   124 			
   125 
   126 #endif /* XMLENGNODELIST_IMPL_H */
   127