Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PreSiblingQuery.cs
Go to the documentation of this file.
3
5
6internal sealed class PreSiblingQuery : CacheAxisQuery
7{
8 public override QueryProps Properties => base.Properties | QueryProps.Reverse;
9
10 public PreSiblingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest)
11 : base(qyInput, name, prefix, typeTest)
12 {
13 }
14
16 : base(other)
17 {
18 }
19
21 {
23 xPathNavigator.MoveToParent();
24 for (int i = 0; i < parentStk.Count; i++)
25 {
26 if (xPathNavigator.IsSamePosition(parentStk[i]))
27 {
28 return false;
29 }
30 }
32 return true;
33 }
34
35 public override object Evaluate(XPathNodeIterator context)
36 {
37 base.Evaluate(context);
40 while ((currentNode = qyInput.Advance()) != null)
41 {
42 stack.Push(currentNode.Clone());
43 }
44 while (stack.Count != 0)
45 {
46 XPathNavigator xPathNavigator = stack.Pop();
47 if (xPathNavigator.NodeType == XPathNodeType.Attribute || xPathNavigator.NodeType == XPathNodeType.Namespace || !NotVisited(xPathNavigator, parentStk))
48 {
49 continue;
50 }
52 if (!xPathNavigator2.MoveToParent())
53 {
54 continue;
55 }
56 bool flag = xPathNavigator2.MoveToFirstChild();
57 while (!xPathNavigator2.IsSamePosition(xPathNavigator))
58 {
60 {
62 }
63 if (!xPathNavigator2.MoveToNext())
64 {
65 break;
66 }
67 }
68 }
69 return this;
70 }
71
72 public override XPathNodeIterator Clone()
73 {
74 return new PreSiblingQuery(this);
75 }
76}
virtual bool matches(XPathNavigator e)
List< XPathNavigator > outputBuffer
PreSiblingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest)
static bool NotVisited(XPathNavigator nav, List< XPathNavigator > parentStk)
override object Evaluate(XPathNodeIterator context)
override XPathNodeIterator Clone()
XPathNavigator Advance()
static bool Insert(List< XPathNavigator > buffer, XPathNavigator nav)
Definition Query.cs:87
void Add(TKey key, TValue value)