Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RegionIterator.cs
Go to the documentation of this file.
2using System.Text;
3
4namespace System.Xml;
5
6internal sealed class RegionIterator : BaseRegionIterator
7{
8 private readonly XmlBoundElement _rowElement;
9
11
12 internal override XmlNode CurrentNode => _currentNode;
13
20
21 [MemberNotNullWhen(true, "CurrentNode")]
22 internal override bool Next()
23 {
26 if (firstChild != null)
27 {
30 return true;
31 }
32 return NextRight();
33 }
34
35 [MemberNotNullWhen(true, "CurrentNode")]
36 internal override bool NextRight()
37 {
39 {
40 _currentNode = null;
41 return false;
42 }
45 if (nextSibling != null)
46 {
49 return true;
50 }
53 {
55 }
57 {
58 _currentNode = null;
60 return false;
61 }
64 return true;
65 }
66
67 [MemberNotNullWhen(true, "CurrentNode")]
82
83 private static string GetInitialTextFromNodes(ref XmlNode n)
84 {
85 string text = null;
86 if (n != null)
87 {
88 while (n.NodeType == XmlNodeType.Whitespace)
89 {
90 n = n.NextSibling;
91 if (n == null)
92 {
93 return string.Empty;
94 }
95 }
96 if (XmlDataDocument.IsTextLikeNode(n) && (n.NextSibling == null || !XmlDataDocument.IsTextLikeNode(n.NextSibling)))
97 {
98 text = n.Value;
99 n = n.NextSibling;
100 }
101 else
102 {
104 while (n != null && XmlDataDocument.IsTextLikeNode(n))
105 {
106 if (n.NodeType != XmlNodeType.Whitespace)
107 {
108 stringBuilder.Append(n.Value);
109 }
110 n = n.NextSibling;
111 }
112 text = stringBuilder.ToString();
113 }
114 }
115 return text ?? string.Empty;
116 }
117}
static string GetInitialTextFromNodes(ref XmlNode n)
RegionIterator(XmlBoundElement rowElement)
bool NextInitialTextLikeNodes(out string value)
readonly XmlBoundElement _rowElement
override XmlNode CurrentNode
static bool IsTextLikeNode(XmlNode n)
virtual ? XmlNode ParentNode
Definition XmlNode.cs:76
virtual ? XmlNode NextSibling
Definition XmlNode.cs:104
virtual ? XmlNode FirstChild
Definition XmlNode.cs:120