Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
OutputScopeManager.cs
Go to the documentation of this file.
1
namespace
System.Xml.Xsl.Xslt
;
2
3
internal
sealed
class
OutputScopeManager
4
{
5
public
struct
ScopeReord
6
{
7
public
int
scopeCount
;
8
9
public
string
prefix
;
10
11
public
string
nsUri
;
12
}
13
14
private
ScopeReord
[]
_records
=
new
ScopeReord
[32];
15
16
private
int
_lastRecord
;
17
18
private
int
_lastScopes
;
19
20
public
OutputScopeManager
()
21
{
22
Reset
();
23
}
24
25
public
void
Reset
()
26
{
27
_records
[0].
prefix
=
null
;
28
_records
[0].
nsUri
=
null
;
29
PushScope
();
30
}
31
32
public
void
PushScope
()
33
{
34
_lastScopes
++;
35
}
36
37
public
void
PopScope
()
38
{
39
if
(0 <
_lastScopes
)
40
{
41
_lastScopes
--;
42
return
;
43
}
44
while
(
_records
[--
_lastRecord
].scopeCount == 0)
45
{
46
}
47
_lastScopes
=
_records
[
_lastRecord
].
scopeCount
;
48
_lastScopes
--;
49
}
50
51
public
void
AddNamespace
(
string
prefix
,
string
uri)
52
{
53
AddRecord
(
prefix
, uri);
54
}
55
56
private
void
AddRecord
(
string
prefix
,
string
uri)
57
{
58
_records
[
_lastRecord
].
scopeCount
=
_lastScopes
;
59
_lastRecord
++;
60
if
(
_lastRecord
==
_records
.Length)
61
{
62
ScopeReord
[]
array
=
new
ScopeReord
[
_lastRecord
* 2];
63
Array
.
Copy
(
_records
,
array
,
_lastRecord
);
64
_records
=
array
;
65
}
66
_lastScopes
= 0;
67
_records
[
_lastRecord
].
prefix
=
prefix
;
68
_records
[
_lastRecord
].
nsUri
= uri;
69
}
70
71
public
void
InvalidateAllPrefixes
()
72
{
73
if
(
_records
[
_lastRecord
].
prefix
!=
null
)
74
{
75
AddRecord
(
null
,
null
);
76
}
77
}
78
79
public
void
InvalidateNonDefaultPrefixes
()
80
{
81
string
text
=
LookupNamespace
(
string
.
Empty
);
82
if
(
text
==
null
)
83
{
84
InvalidateAllPrefixes
();
85
}
86
else
if
(
_records
[
_lastRecord
].
prefix
.Length != 0 ||
_records
[
_lastRecord
- 1].
prefix
!=
null
)
87
{
88
AddRecord
(
null
,
null
);
89
AddRecord
(
string
.
Empty
,
text
);
90
}
91
}
92
93
public
string
LookupNamespace
(
string
prefix
)
94
{
95
int
num =
_lastRecord
;
96
while
(
_records
[num].
prefix
!=
null
)
97
{
98
if
(
_records
[num].
prefix
==
prefix
)
99
{
100
return
_records
[num].
nsUri
;
101
}
102
num--;
103
}
104
return
null
;
105
}
106
}
System.Array.Copy
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition
Array.cs:624
System.Array
Definition
Array.cs:16
System.Empty
Definition
Empty.cs:4
System.Xml.Xsl.Xslt.OutputScopeManager.Reset
void Reset()
Definition
OutputScopeManager.cs:25
System.Xml.Xsl.Xslt.OutputScopeManager.LookupNamespace
string LookupNamespace(string prefix)
Definition
OutputScopeManager.cs:93
System.Xml.Xsl.Xslt.OutputScopeManager.PopScope
void PopScope()
Definition
OutputScopeManager.cs:37
System.Xml.Xsl.Xslt.OutputScopeManager.AddNamespace
void AddNamespace(string prefix, string uri)
Definition
OutputScopeManager.cs:51
System.Xml.Xsl.Xslt.OutputScopeManager.OutputScopeManager
OutputScopeManager()
Definition
OutputScopeManager.cs:20
System.Xml.Xsl.Xslt.OutputScopeManager.AddRecord
void AddRecord(string prefix, string uri)
Definition
OutputScopeManager.cs:56
System.Xml.Xsl.Xslt.OutputScopeManager.InvalidateNonDefaultPrefixes
void InvalidateNonDefaultPrefixes()
Definition
OutputScopeManager.cs:79
System.Xml.Xsl.Xslt.OutputScopeManager._lastRecord
int _lastRecord
Definition
OutputScopeManager.cs:16
System.Xml.Xsl.Xslt.OutputScopeManager.InvalidateAllPrefixes
void InvalidateAllPrefixes()
Definition
OutputScopeManager.cs:71
System.Xml.Xsl.Xslt.OutputScopeManager._records
ScopeReord[] _records
Definition
OutputScopeManager.cs:14
System.Xml.Xsl.Xslt.OutputScopeManager.PushScope
void PushScope()
Definition
OutputScopeManager.cs:32
System.Xml.Xsl.Xslt.OutputScopeManager._lastScopes
int _lastScopes
Definition
OutputScopeManager.cs:18
System.Xml.Xsl.Xslt.OutputScopeManager
Definition
OutputScopeManager.cs:4
System.Xml.Xsl.Xslt
Definition
AstFactory.cs:3
System.ExceptionArgument.text
@ text
System.ExceptionArgument.prefix
@ prefix
System.ExceptionArgument.array
@ array
System.Xml.Xsl.Xslt.OutputScopeManager.ScopeReord.prefix
string prefix
Definition
OutputScopeManager.cs:9
System.Xml.Xsl.Xslt.OutputScopeManager.ScopeReord.nsUri
string nsUri
Definition
OutputScopeManager.cs:11
System.Xml.Xsl.Xslt.OutputScopeManager.ScopeReord.scopeCount
int scopeCount
Definition
OutputScopeManager.cs:7
System.Xml.Xsl.Xslt.OutputScopeManager.ScopeReord
Definition
OutputScopeManager.cs:6
source
System.Private.Xml
System.Xml.Xsl.Xslt
OutputScopeManager.cs
Generated by
1.10.0