示例#1
0
 protected XmlBaseReader()
 {
     _bufferReader = new XmlBufferReader(this);
     _nsMgr = new NamespaceManager(_bufferReader);
     _quotas = XmlDictionaryReaderQuotas.Max;
     _rootElementNode = new XmlElementNode(_bufferReader);
     _atomicTextNode = new XmlAtomicTextNode(_bufferReader);
     _node = s_closedNode;
 }
 protected XmlBaseReader()
 {
     this.bufferReader = new XmlBufferReader(this);
     this.nsMgr = new NamespaceManager(bufferReader);
     this.quotas = new XmlDictionaryReaderQuotas();
     this.rootElementNode = new XmlElementNode(bufferReader);
     this.atomicTextNode = new XmlAtomicTextNode(bufferReader);
     this.node = closedNode;
 }
示例#3
0
 public bool Equals2(int key1, int key2, XmlBufferReader bufferReader2)
 {
     // If the keys aren't from the same dictionary, they still might be the same
     if (key1 == key2)
     {
         return(true);
     }
     else
     {
         return(GetDictionaryString(key1).Value == bufferReader2.GetDictionaryString(key2).Value);
     }
 }
示例#4
0
        private bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2)
        {
            switch (this.type)
            {
            case StringHandleType.Dictionary:
                return(bufferReader2.Equals2(offset2, length2, this.bufferReader.GetDictionaryString(this.key).Value));

            case StringHandleType.UTF8:
                return(this.bufferReader.Equals2(this.offset, this.length, bufferReader2, offset2, length2));
            }
            return(this.GetString() == this.bufferReader.GetString(offset2, length2));
        }
        private bool Equals2(int key2, XmlBufferReader bufferReader2)
        {
            switch (this.type)
            {
                case StringHandleType.Dictionary:
                    return this.bufferReader.Equals2(this.key, key2, bufferReader2);

                case StringHandleType.UTF8:
                    return this.bufferReader.Equals2(this.offset, this.length, bufferReader2.GetDictionaryString(key2).Value);
            }
            return (this.GetString() == this.bufferReader.GetDictionaryString(key2).Value);
        }
示例#6
0
        private bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2)
        {
            StringHandleType type = _type;

            if (type == StringHandleType.Dictionary)
            {
                return(bufferReader2.Equals2(offset2, length2, _bufferReader.GetDictionaryString(_key).Value));
            }
            if (type == StringHandleType.UTF8)
            {
                return(_bufferReader.Equals2(_offset, _length, bufferReader2, offset2, length2));
            }
            DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, "");
            return(GetString() == _bufferReader.GetString(offset2, length2));
        }
        bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2)
        {
            StringHandleType type = this.type;

            if (type == StringHandleType.Dictionary)
            {
                return(bufferReader2.Equals2(offset2, length2, bufferReader.GetDictionaryString(this.key).Value));
            }
            if (type == StringHandleType.UTF8)
            {
                return(bufferReader.Equals2(this.offset, this.length, bufferReader2, offset2, length2));
            }
            Fx.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, "");
            return(GetString() == bufferReader.GetString(offset2, length2));
        }
示例#8
0
 public bool Equals2(int offset1, int length1, XmlBufferReader bufferReader2, int offset2, int length2)
 {
     if (length1 != length2)
     {
         return(false);
     }
     byte[] buffer1 = _buffer;
     byte[] buffer2 = bufferReader2._buffer;
     for (int i = 0; i < length1; i++)
     {
         if (buffer1[offset1 + i] != buffer2[offset2 + i])
         {
             return(false);
         }
     }
     return(true);
 }
示例#9
0
 public ValueHandle(XmlBufferReader bufferReader)
 {
     _bufferReader = bufferReader;
     _type = ValueHandleType.Empty;
 }
 public bool Equals2(int key1, int key2, XmlBufferReader bufferReader2)
 {
     return ((key1 == key2) || (this.GetDictionaryString(key1).Value == bufferReader2.GetDictionaryString(key2).Value));
 }
示例#11
0
 public PrefixHandle(XmlBufferReader bufferReader)
 {
     this.bufferReader = bufferReader;
 }
示例#12
0
 public XmlCommentNode(XmlBufferReader bufferReader)
     : base(XmlNodeType.Comment,
            new PrefixHandle(bufferReader),
            new StringHandle(bufferReader),
            new ValueHandle(bufferReader),
            XmlNodeFlags.HasValue,
            ReadState.Interactive,
            null,
            0)
 {
 }
示例#13
0
 public NamespaceManager(XmlBufferReader bufferReader)
 {
     _bufferReader = bufferReader;
     _shortPrefixUri = new Namespace[(int)PrefixHandleType.Max];
     _shortPrefixUri[(int)PrefixHandleType.Empty] = s_emptyNamespace;
     _namespaces = null;
     _nsCount = 0;
     _attributes = null;
     _attributeCount = 0;
     _space = XmlSpace.None;
     _lang = string.Empty;
     _depth = 0;
 }
示例#14
0
 public XmlAtomicTextNode(XmlBufferReader bufferReader)
     : base(XmlNodeType.Text,
            new PrefixHandle(bufferReader),
            new StringHandle(bufferReader),
            new ValueHandle(bufferReader),
            XmlNodeFlags.HasValue | XmlNodeFlags.AtomicValue | XmlNodeFlags.SkipValue | XmlNodeFlags.HasContent,
            ReadState.Interactive,
            null,
            0)
 {
 }
示例#15
0
 public XmlCDataNode(XmlBufferReader bufferReader)
     : base(XmlNodeType.CDATA,
            new PrefixHandle(bufferReader),
            new StringHandle(bufferReader),
            new ValueHandle(bufferReader),
            XmlNodeFlags.HasValue | XmlNodeFlags.HasContent,
            ReadState.Interactive,
            null,
            0)
 {
 }
示例#16
0
 public StringHandle(XmlBufferReader bufferReader)
 {
     _bufferReader = bufferReader;
     SetValue(0, 0);
 }
 bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2)
 {
     StringHandleType type = this.type;
     if (type == StringHandleType.Dictionary)
         return bufferReader2.Equals2(offset2, length2, bufferReader.GetDictionaryString(this.key).Value);
     if (type == StringHandleType.UTF8)
         return bufferReader.Equals2(this.offset, this.length, bufferReader2, offset2, length2);
     Fx.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, "");
     return GetString() == bufferReader.GetString(offset2, length2);
 }
示例#18
0
 public PrefixHandle(XmlBufferReader bufferReader)
 {
     _bufferReader = bufferReader;
 }
 public Namespace(XmlBufferReader bufferReader)
 {
     this.prefix = new PrefixHandle(bufferReader);
     this.uri = new StringHandle(bufferReader);
     this.outerUri = null;
     this.uriString = null;
 }
 public bool Equals2(int offset1, int length1, XmlBufferReader bufferReader2, int offset2, int length2)
 {
     if (length1 != length2)
         return false;
     byte[] buffer1 = this.buffer;
     byte[] buffer2 = bufferReader2.buffer;
     for (int i = 0; i < length1; i++)
     {
         if (buffer1[offset1 + i] != buffer2[offset2 + i])
             return false;
     }
     return true;
 }
 public bool Equals2(int key1, int key2, XmlBufferReader bufferReader2)
 {
     // If the keys aren't from the same dictionary, they still might be the same
     if (key1 == key2)
         return true;
     else
         return GetDictionaryString(key1).Value == bufferReader2.GetDictionaryString(key2).Value;
 }
 public ValueHandle(XmlBufferReader bufferReader)
 {
     this.bufferReader = bufferReader;
     this.type         = ValueHandleType.Empty;
 }
示例#23
0
 public XmlElementNode(XmlBufferReader bufferReader)
     : this(new PrefixHandle(bufferReader),
            new StringHandle(bufferReader),
            new ValueHandle(bufferReader))
 {
 }
 public StringHandle(XmlBufferReader bufferReader)
 {
     this.bufferReader = bufferReader;
     SetValue(0, 0);
 }
示例#25
0
 public XmlAttributeNode(XmlBufferReader bufferReader)
     : this(new PrefixHandle(bufferReader), new StringHandle(bufferReader), new ValueHandle(bufferReader))
 {
 }
 public bool Equals2(int key1, int key2, XmlBufferReader bufferReader2)
 {
     return((key1 == key2) || (this.GetDictionaryString(key1).Value == bufferReader2.GetDictionaryString(key2).Value));
 }
示例#27
0
 public XmlWhitespaceTextNode(XmlBufferReader bufferReader)
     : base(XmlNodeType.Whitespace,
            new PrefixHandle(bufferReader),
            new StringHandle(bufferReader),
            new ValueHandle(bufferReader),
            XmlNodeFlags.HasValue,
            ReadState.Interactive,
            null,
            0)
 {
 }
 public NamespaceManager(XmlBufferReader bufferReader)
 {
     this.bufferReader = bufferReader;
     this.shortPrefixUri = new Namespace[(int)PrefixHandleType.Max];
     this.shortPrefixUri[(int)PrefixHandleType.Empty] = emptyNamespace;
     this.namespaces = null;
     this.nsCount = 0;
     this.attributes = null;
     this.attributeCount = 0;
     this.space = XmlSpace.None;
     this.lang = string.Empty;
     this.depth = 0;
 }
示例#29
0
 public XmlDeclarationNode(XmlBufferReader bufferReader)
     : base(XmlNodeType.XmlDeclaration,
            new PrefixHandle(bufferReader),
            new StringHandle(bufferReader),
            new ValueHandle(bufferReader),
            XmlNodeFlags.CanGetAttribute,
            ReadState.Interactive,
            null,
            0)
 {
 }
示例#30
0
 public ValueHandle(XmlBufferReader bufferReader)
 {
     _bufferReader = bufferReader;
     _type         = ValueHandleType.Empty;
 }
示例#31
0
 public XmlClosedNode(XmlBufferReader bufferReader)
     : base(XmlNodeType.None,
            new PrefixHandle(bufferReader),
            new StringHandle(bufferReader),
            new ValueHandle(bufferReader),
            XmlNodeFlags.None,
            ReadState.Closed,
            null,
            0)
 {
 }
示例#32
0
 public StringHandle(XmlBufferReader bufferReader)
 {
     this.bufferReader = bufferReader;
     this.SetValue(0, 0);
 }
示例#33
0
 public Namespace(XmlBufferReader bufferReader)
 {
     _prefix = new PrefixHandle(bufferReader);
     _uri = new StringHandle(bufferReader);
     _outerUri = null;
     _uriString = null;
 }
        private bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2)
        {
            switch (this.type)
            {
                case StringHandleType.Dictionary:
                    return bufferReader2.Equals2(offset2, length2, this.bufferReader.GetDictionaryString(this.key).Value);

                case StringHandleType.UTF8:
                    return this.bufferReader.Equals2(this.offset, this.length, bufferReader2, offset2, length2);
            }
            return (this.GetString() == this.bufferReader.GetString(offset2, length2));
        }
示例#35
0
 public ValueHandle(XmlBufferReader bufferReader)
 {
     this.bufferReader = bufferReader;
     this.type = ValueHandleType.Empty;
 }
示例#36
0
 private bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2)
 {
     StringHandleType type = _type;
     if (type == StringHandleType.Dictionary)
         return bufferReader2.Equals2(offset2, length2, _bufferReader.GetDictionaryString(_key).Value);
     if (type == StringHandleType.UTF8)
         return _bufferReader.Equals2(_offset, _length, bufferReader2, offset2, length2);
     DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, "");
     return GetString() == _bufferReader.GetString(offset2, length2);
 }