Skip to content

Commit

Permalink
2003-08-13 Piers Haken <piersh@friskit.com>
Browse files Browse the repository at this point in the history
	* Iterator.cs:
		fix MergedIterator.Clone(), now clones other's iterators
		fix DescendantIterator.Clone(), now copies depth
		make iterator cloning constructors more type-specific

svn path=/trunk/mcs/; revision=17310
  • Loading branch information
Piers Haken committed Aug 13, 2003
1 parent 8475a5b commit 67f7f27
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
7 changes: 7 additions & 0 deletions mcs/class/System.XML/System.Xml.XPath/ChangeLog
@@ -1,3 +1,10 @@
2003-08-13 Piers Haken <piersh@friskit.com>

* Iterator.cs:
fix MergedIterator.Clone(), now clones other's iterators
fix DescendantIterator.Clone(), now copies depth
make iterator cloning constructors more type-specific

2003-08-01 Piers Haken <piersh@friskit.com>

* Expression.cs: added NodeNamespaceTest
Expand Down
35 changes: 19 additions & 16 deletions mcs/class/System.XML/System.Xml.XPath/Iterator.cs
Expand Up @@ -52,8 +52,8 @@ internal class MergedIterator : BaseIterator
public MergedIterator (BaseIterator iter ) : base (iter) {}
protected MergedIterator (MergedIterator other) : base (other)
{
foreach (object obj in other._iters)
_iters.Add (obj);
foreach (XPathNodeIterator iter in other._iters)
_iters.Add (iter.Clone ());
_pos = other._pos;
_index = other._index;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ internal class SelfIterator : SimpleIterator
{
public SelfIterator (BaseIterator iter) : base (iter) {}
public SelfIterator (XPathNavigator nav, XmlNamespaceManager nsm) : base (nav, nsm) {}
protected SelfIterator (SimpleIterator other) : base (other) {}
protected SelfIterator (SelfIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new SelfIterator (this); }
public override bool MoveNext ()
{
Expand All @@ -136,7 +136,7 @@ internal class NullIterator : SelfIterator
public NullIterator (BaseIterator iter) : base (iter) {}
public NullIterator (XPathNavigator nav) : this (nav, null) {}
public NullIterator (XPathNavigator nav, XmlNamespaceManager nsm) : base (nav, nsm) {}
protected NullIterator (SimpleIterator other) : base (other) {}
protected NullIterator (NullIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new NullIterator (this); }
public override bool MoveNext ()
{
Expand All @@ -147,7 +147,7 @@ public override bool MoveNext ()
internal class ParentIterator : SimpleIterator
{
public ParentIterator (BaseIterator iter) : base (iter) {}
protected ParentIterator (SimpleIterator other) : base (other) {}
protected ParentIterator (ParentIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new ParentIterator (this); }
public override bool MoveNext ()
{
Expand All @@ -163,7 +163,7 @@ public override bool MoveNext ()
internal class ChildIterator : SimpleIterator
{
public ChildIterator (BaseIterator iter) : base (iter) {}
protected ChildIterator (SimpleIterator other) : base (other) {}
protected ChildIterator (ChildIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new ChildIterator (this); }
public override bool MoveNext ()
{
Expand All @@ -177,7 +177,7 @@ public override bool MoveNext ()
internal class FollowingSiblingIterator : SimpleIterator
{
public FollowingSiblingIterator (BaseIterator iter) : base (iter) {}
protected FollowingSiblingIterator (SimpleIterator other) : base (other) {}
protected FollowingSiblingIterator (FollowingSiblingIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new FollowingSiblingIterator (this); }
public override bool MoveNext ()
{
Expand All @@ -193,7 +193,7 @@ public override bool MoveNext ()
internal class PrecedingSiblingIterator : SimpleIterator
{
public PrecedingSiblingIterator (BaseIterator iter) : base (iter) {}
protected PrecedingSiblingIterator (SimpleIterator other) : base (other) {}
protected PrecedingSiblingIterator (PrecedingIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new PrecedingSiblingIterator (this); }
public override bool MoveNext ()
{
Expand All @@ -209,7 +209,7 @@ public override bool MoveNext ()
internal class AncestorIterator : SimpleIterator
{
public AncestorIterator (BaseIterator iter) : base (iter) {}
protected AncestorIterator (SimpleIterator other) : base (other) {}
protected AncestorIterator (AncestorIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new AncestorIterator (this); }
public override bool MoveNext ()
{
Expand All @@ -229,15 +229,18 @@ public AncestorOrSelfIterator (BaseIterator iter) : base (iter)
Add (new SelfIterator (iter));
Add (new AncestorIterator (iter));
}
protected AncestorOrSelfIterator (MergedIterator other) : base (other) {}
protected AncestorOrSelfIterator (AncestorOrSelfIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new AncestorOrSelfIterator (this); }
}

internal class DescendantIterator : SimpleIterator
{
protected int _depth;
public DescendantIterator (BaseIterator iter) : base (iter) {}
protected DescendantIterator (SimpleIterator other) : base (other) {}
protected DescendantIterator (DescendantIterator other) : base (other)
{
_depth = other._depth;
}
public override XPathNodeIterator Clone () { return new DescendantIterator (this); }
[MonoTODO]
public override bool MoveNext ()
Expand Down Expand Up @@ -270,14 +273,14 @@ public DescendantOrSelfIterator (BaseIterator iter) : base (iter)
Add (new SelfIterator (iter));
Add (new DescendantIterator (iter));
}
protected DescendantOrSelfIterator (MergedIterator other) : base (other) {}
protected DescendantOrSelfIterator (DescendantOrSelfIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new DescendantOrSelfIterator (this); }
}

internal class FollowingIterator : SimpleIterator
{
public FollowingIterator (BaseIterator iter) : base (iter) {}
protected FollowingIterator (SimpleIterator other) : base (other) {}
protected FollowingIterator (FollowingIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new FollowingIterator (this); }
public override bool MoveNext ()
{
Expand Down Expand Up @@ -313,7 +316,7 @@ public override bool MoveNext ()
internal class PrecedingIterator : SimpleIterator
{
public PrecedingIterator (BaseIterator iter) : base (iter) {}
protected PrecedingIterator (SimpleIterator other) : base (other) {}
protected PrecedingIterator (PrecedingIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new PrecedingIterator (this); }
public override bool MoveNext ()
{
Expand Down Expand Up @@ -351,7 +354,7 @@ public override bool MoveNext ()
internal class NamespaceIterator : SimpleIterator
{
public NamespaceIterator (BaseIterator iter) : base (iter) {}
protected NamespaceIterator (SimpleIterator other) : base (other) {}
protected NamespaceIterator (NamespaceIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new NamespaceIterator (this); }
public override bool MoveNext ()
{
Expand All @@ -375,7 +378,7 @@ public override bool MoveNext ()
internal class AttributeIterator : SimpleIterator
{
public AttributeIterator (BaseIterator iter) : base (iter) {}
protected AttributeIterator (SimpleIterator other) : base (other) {}
protected AttributeIterator (AttributeIterator other) : base (other) {}
public override XPathNodeIterator Clone () { return new AttributeIterator (this); }
public override bool MoveNext ()
{
Expand Down

0 comments on commit 67f7f27

Please sign in to comment.