Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ChildrenQuery.cs
Go to the documentation of this file.
2
4
6{
8
9 public ChildrenQuery(Query qyInput, string name, string prefix, XPathNodeType type)
10 : base(qyInput, name, prefix, type)
11 {
12 }
13
15 : base(other)
16 {
17 _iterator = Query.Clone(other._iterator);
18 }
19
20 public override void Reset()
21 {
23 base.Reset();
24 }
25
26 public override XPathNavigator Advance()
27 {
28 while (!_iterator.MoveNext())
29 {
30 XPathNavigator xPathNavigator = qyInput.Advance();
31 if (xPathNavigator == null)
32 {
33 return null;
34 }
35 if (base.NameTest)
36 {
37 if (base.TypeTest == XPathNodeType.ProcessingInstruction)
38 {
39 _iterator = new IteratorFilter(xPathNavigator.SelectChildren(base.TypeTest), base.Name);
40 }
41 else
42 {
43 _iterator = xPathNavigator.SelectChildren(base.Name, base.Namespace);
44 }
45 }
46 else
47 {
48 _iterator = xPathNavigator.SelectChildren(base.TypeTest);
49 }
50 position = 0;
51 }
52 position++;
54 return currentNode;
55 }
56
57 public sealed override XPathNavigator MatchNode(XPathNavigator context)
58 {
59 if (context != null && matches(context))
60 {
61 XPathNavigator xPathNavigator = context.Clone();
62 if (xPathNavigator.NodeType != XPathNodeType.Attribute && xPathNavigator.MoveToParent())
63 {
64 return qyInput.MatchNode(xPathNavigator);
65 }
66 return null;
67 }
68 return null;
69 }
70
71 public override XPathNodeIterator Clone()
72 {
73 return new ChildrenQuery(this);
74 }
75}
virtual bool matches(XPathNavigator e)
override XPathNodeIterator Clone()
ChildrenQuery(Query qyInput, string name, string prefix, XPathNodeType type)
override XPathNavigator MatchNode(XPathNavigator context)
override XPathNavigator Advance()
virtual XPathNavigator MatchNode(XPathNavigator current)
Definition Query.cs:60
XPathNavigator Advance()
static Query Clone(Query input)
Definition Query.cs:66
virtual XPathNodeIterator SelectChildren(XPathNodeType type)