• 大小: 12KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: 其他
  • 标签: unity3d  Mono  xml  

资源简介

unity3d读取xml插件Mono.Xml,用于读取xml文件

资源截图

代码片段和文件信息

//
// System.Security.Cryptography.MiniParser: Internal xml parser implementation
//
// Authors:
// Sergey Chaban
//
// Copyright (c) 2001 2002 Wild West Software
// Copyright (c) 2002 Sergey Chaban
// Copyright (C) 2004 Novell Inc (http://www.novell.com)
//
// Permission is hereby granted free of charge to any person obtaining
// a copy of this software and associated documentation files (the
// “Software“) to deal in the Software without restriction including
// without limitation the rights to use copy modify merge publish
// distribute sublicense and/or sell copies of the Software and to
// permit persons to whom the Software is furnished to do so subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND
// EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION
// OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

using System;
using System.Text;
using System.Collections;
using System.Globalization;

namespace Mono.xml {

internal class MiniParser {

public interface IReader {
int Read();
}

public interface IAttrList {
int Length {get;}
bool IsEmpty {get;}
string GetName(int i);
string GetValue(int i);
string GetValue(string name);
void ChangeValue(string name string newValue);
string[] Names {get;}
string[] Values {get;}
}

public interface IMutableAttrList : IAttrList {
void Clear();
void Add(string name string value);
void CopyFrom(IAttrList attrs);
void Remove(int i);
void Remove(string name);
}

public interface IHandler {
void onstartParsing(MiniParser parser);
void onstartElement(string name IAttrList attrs);
void OnEndElement(string name);
void OnChars(string ch);
void OnEndParsing(MiniParser parser);
}

public class HandlerAdapter : IHandler {
public HandlerAdapter() {}
public void onstartParsing(MiniParser parser) {}
public void onstartElement(string name IAttrList attrs) {}
public void OnEndElement(string name) {}
public void OnChars(string ch) {}
public void OnEndParsing(MiniParser parser) {}
}

private enum CharKind : byte {
LEFT_BR     = 0
RIGHT_BR    = 1
SLASH       = 2
PI_MARK     = 3
EQ          = 4
AMP         = 5
SQUOTE      = 6
DQUOTE      = 7
BANG        = 8
LEFT_SQBR   = 9
SPACE       = 0xA
RIGHT_SQBR  = 0xB
TAB         = 0xC
CR          = 0xD
EOL         = 0xE
CHARS       = 0xF
UNKNOWN = 0x1F
}

private enum ActionCode : byte {
START_ELEM        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2007-03-23 00:13  Mono.xml\
     文件         823  2005-08-03 13:39  Mono.xml\ChangeLog
     文件       38085  2005-08-03 13:39  Mono.xml\MiniParser.cs
     文件        2864  2005-11-11 15:15  Mono.xml\SecurityParser.cs
     文件       13995  2006-05-20 20:05  Mono.xml\SmallxmlParser.cs

评论

共有 条评论