96 lines
2.4 KiB
C#
96 lines
2.4 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using System.Security;
|
|
|
|
namespace Mono.Xml
|
|
{
|
|
// Token: 0x020000ED RID: 237
|
|
internal class SecurityParser : SmallXmlParser, SmallXmlParser.IContentHandler
|
|
{
|
|
// Token: 0x06000BD1 RID: 3025 RVA: 0x00035998 File Offset: 0x00033B98
|
|
public SecurityParser()
|
|
{
|
|
this.stack = new Stack();
|
|
}
|
|
|
|
// Token: 0x06000BD2 RID: 3026 RVA: 0x000359AC File Offset: 0x00033BAC
|
|
public void LoadXml(string xml)
|
|
{
|
|
this.root = null;
|
|
this.stack.Clear();
|
|
base.Parse(new StringReader(xml), this);
|
|
}
|
|
|
|
// Token: 0x06000BD3 RID: 3027 RVA: 0x000359D0 File Offset: 0x00033BD0
|
|
public SecurityElement ToXml()
|
|
{
|
|
return this.root;
|
|
}
|
|
|
|
// Token: 0x06000BD4 RID: 3028 RVA: 0x000359D8 File Offset: 0x00033BD8
|
|
public void OnStartParsing(SmallXmlParser parser)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06000BD5 RID: 3029 RVA: 0x000359DC File Offset: 0x00033BDC
|
|
public void OnProcessingInstruction(string name, string text)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06000BD6 RID: 3030 RVA: 0x000359E0 File Offset: 0x00033BE0
|
|
public void OnIgnorableWhitespace(string s)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06000BD7 RID: 3031 RVA: 0x000359E4 File Offset: 0x00033BE4
|
|
public void OnStartElement(string name, SmallXmlParser.IAttrList attrs)
|
|
{
|
|
SecurityElement securityElement = new SecurityElement(name);
|
|
if (this.root == null)
|
|
{
|
|
this.root = securityElement;
|
|
this.current = securityElement;
|
|
}
|
|
else
|
|
{
|
|
SecurityElement securityElement2 = (SecurityElement)this.stack.Peek();
|
|
securityElement2.AddChild(securityElement);
|
|
}
|
|
this.stack.Push(securityElement);
|
|
this.current = securityElement;
|
|
int length = attrs.Length;
|
|
for (int i = 0; i < length; i++)
|
|
{
|
|
this.current.AddAttribute(attrs.GetName(i), SecurityElement.Escape(attrs.GetValue(i)));
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000BD8 RID: 3032 RVA: 0x00035A78 File Offset: 0x00033C78
|
|
public void OnEndElement(string name)
|
|
{
|
|
this.current = (SecurityElement)this.stack.Pop();
|
|
}
|
|
|
|
// Token: 0x06000BD9 RID: 3033 RVA: 0x00035A90 File Offset: 0x00033C90
|
|
public void OnChars(string ch)
|
|
{
|
|
this.current.Text = SecurityElement.Escape(ch);
|
|
}
|
|
|
|
// Token: 0x06000BDA RID: 3034 RVA: 0x00035AA4 File Offset: 0x00033CA4
|
|
public void OnEndParsing(SmallXmlParser parser)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0400033F RID: 831
|
|
private SecurityElement root;
|
|
|
|
// Token: 0x04000340 RID: 832
|
|
private SecurityElement current;
|
|
|
|
// Token: 0x04000341 RID: 833
|
|
private Stack stack;
|
|
}
|
|
}
|