Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / XPath / Internal / ForwardPositionQuery.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="ForwardPositionQuery.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>                                                                
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
7
8 namespace MS.Internal.Xml.XPath {
9     using System;
10     using System.Xml;
11     using System.Xml.XPath;
12     using System.Diagnostics;
13
14     internal class ForwardPositionQuery : CacheOutputQuery {
15         
16         public ForwardPositionQuery(Query input) : base(input) {
17             Debug.Assert(input != null);
18         }
19         protected ForwardPositionQuery(ForwardPositionQuery other) : base(other) { }       
20         
21         public override object Evaluate(XPathNodeIterator context) {
22             base.Evaluate(context);
23
24             XPathNavigator node;
25             while ((node = base.input.Advance()) != null) {
26                 outputBuffer.Add(node.Clone());
27             }
28
29             return this;
30         }
31
32         public override XPathNavigator MatchNode(XPathNavigator context) {
33             return input.MatchNode(context);
34         }
35
36         public override XPathNodeIterator Clone() { return new ForwardPositionQuery(this); }
37     }
38 }
39
40
41
42
43