Files
mono/mcs/class/System.XML/System.Xml.XPath/XPathNodeIterator.cs
T
Piers Haken 8d73a2306c 2002-06-23 Piers Haken <[email protected]>
System.Xml:

    * XmlDocumentNavigator.cs: implement Clone()
    * XmlElement.cs: remove bogus unimplemented override of InnerText
    * XmlNode.cs: implment SelectNodes/SelectSingleNode
    * XmlNodeArrayList.cs: new support class for SelectNodes

System.Xml.Xsl:

    * XsltContext.cs: added 'PreserveWhitespace' abstract method

System.Xml.XPath:

    * XPathNavigator.cs: implement:
        - Compile
        - Evaluate
        - Clone
        - Select
        - ToString
        - some forwarding methods

    * XPathNodeIterator: implement caching Count

    * Tokenizer.cs: new XPath tokenizer
    * Parser.jay: new XPath grammar
    * Parser.cs: new precompiled XPath grammar
    * Expression.cs: new XPath expression objects
    * Iterator.cs: new XPath result/context objects
    * DefaultContext.cs: new XPath function binding context

svn path=/trunk/mcs/; revision=5421
2002-06-23 16:52:58 +00:00

64 lines
923 B
C#

//
// System.Xml.XPath.XPathNodeIterator
//
// Author:
// Jason Diamond ([email protected])
//
// (C) 2002 Jason Diamond http://injektilo.org/
//
using System;
namespace System.Xml.XPath
{
public abstract class XPathNodeIterator : ICloneable
{
private int _count;
#region Constructor
protected XPathNodeIterator ()
{
}
#endregion
#region Properties
public virtual int Count
{
get
{
if (_count == 0)
{
// compute and cache the count
XPathNodeIterator tmp = Clone ();
while (tmp.MoveNext ())
;
_count = tmp.CurrentPosition;
}
return _count;
}
}
public abstract XPathNavigator Current { get; }
public abstract int CurrentPosition { get; }
#endregion
#region Methods
public abstract XPathNodeIterator Clone ();
object ICloneable.Clone ()
{
return Clone ();
}
public abstract bool MoveNext ();
#endregion
}
}