UNPKG

igniteui-react-core

Version:
1,567 lines (1,566 loc) 97.7 kB
// // System.Xml.XmlTextReader // // Author: // Jason Diamond (jason@injektilo.org) // Adam Treat (manyoso@yahoo.com) // Atsushi Enomoto (ginga@kit.hi-ho.ne.jp) // // (C) 2001, 2002 Jason Diamond http://injektilo.org/ // Copyright (C) 2005-2006 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. // //#define USE_NAME_BUFFER import { __extends } from "tslib"; // // Optimization TODOs: // // - support PushbackChar() which reverts one character read. // - ReadTextReader() should always keep one pushback buffer // as pushback safety net. // - Replace (peek,read) * n -> read * n + pushback // import { Base, markType, Stream, typeCast, enumGetBox } from "./type"; import { DTDObjectModel } from "./DTDObjectModel"; import { Encoding } from "./Encoding"; import { XmlNamespaceManager } from "./XmlNamespaceManager"; import { TextReader } from "./TextReader"; import { arrayListCreate, arrayCopyTo } from "./array"; import { XmlParserContext_ContextItem } from "./XmlParserContext_ContextItem"; import { XmlException } from "./XmlException"; import { stringEmpty, stringCreateFromCharArraySlice, stringReplace, stringIsNullOrEmpty, charMaxValue, stringToLocaleLower, stringCreateFromCharArray, stringConcat } from "./string"; import { XmlReader } from "./XmlReader"; import { XmlNodeType_$type } from "./xml"; import { InvalidOperationException } from "./InvalidOperationException"; import { XmlTextReader_DtdInputStateStack } from "./XmlTextReader_DtdInputStateStack"; import { XmlUrlResolver } from "./XmlUrlResolver"; import { XmlStreamReader } from "./XmlStreamReader"; import { NameTable } from "./NameTable"; import { StringReader } from "./StringReader"; import { Uri } from "./Uri"; import { ArgumentOutOfRangeException } from "./ArgumentOutOfRangeException"; import { IXmlLineInfo_$type } from "./IXmlLineInfo"; import { XmlTextReader_TagName } from "./XmlTextReader_TagName"; import { StringBuilder } from "./StringBuilder"; import { XmlChar } from "./XmlChar"; import { CultureInfo } from "./culture"; import { intDivide } from "./number"; import { stringFormat, stringFormat2, stringCompare1 } from "./stringExtended"; import { arrayCopy1 } from "./arrayExtended"; /** * @hidden */ var XmlParserContext = /** @class */ /*@__PURE__*/ (function (_super) { __extends(XmlParserContext, _super); function XmlParserContext(a) { var _rest = []; for (var _i = 1; _i < arguments.length; _i++) { _rest[_i - 1] = arguments[_i]; } var _this = _super.call(this) || this; _this.c = stringEmpty(); _this.e = stringEmpty(); _this.o = null; _this.g = stringEmpty(); _this.u = null; _this.w = null; _this.i = stringEmpty(); _this.k = stringEmpty(); _this.m = stringEmpty(); _this.y = 0; _this.a = null; _this.b = 0; _this.s = null; a = (a == void 0) ? 0 : a; switch (a) { case 0: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = _rest[3]; var g = [c, d, null, null, null, null, null, e, f, null]; { var i = g[0]; var j = g[1]; var k = g[2]; var l = g[3]; var m = g[4]; var n = g[5]; var o = g[6]; var p = g[7]; var q = g[8]; var r = g[9]; var s = [i, j, (k != null && k != stringEmpty()) ? new XmlTextReader(9, TextReader.e, i).d8(k, l, m, n) : null, o, p, q, r]; { var u = s[0]; var v = s[1]; var w = s[2]; var x = s[3]; var y = s[4]; var z = s[5]; var aa = s[6]; _this.u = v; _this.w = u != null ? u : v != null ? v.ag : null; if (w != null) { _this.f = w.b; _this.j = w.c; _this.l = w.d; _this.h = w.a; _this.s = w; } _this.o = aa; _this.d = x; _this.n = y; _this.y = z; _this.a = arrayListCreate(); } } } break; case 1: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = _rest[3]; var g = _rest[4]; var h = [c, d, null, null, null, null, null, e, f, g]; { var j = h[0]; var k = h[1]; var l = h[2]; var m = h[3]; var n = h[4]; var o = h[5]; var p = h[6]; var q = h[7]; var r = h[8]; var s = h[9]; var t = [j, k, (l != null && l != stringEmpty()) ? new XmlTextReader(9, TextReader.e, j).d8(l, m, n, o) : null, p, q, r, s]; { var v = t[0]; var w = t[1]; var x = t[2]; var y = t[3]; var z = t[4]; var aa = t[5]; var ab = t[6]; _this.u = w; _this.w = v != null ? v : w != null ? w.ag : null; if (x != null) { _this.f = x.b; _this.j = x.c; _this.l = x.d; _this.h = x.a; _this.s = x; } _this.o = ab; _this.d = y; _this.n = z; _this.y = aa; _this.a = arrayListCreate(); } } } break; case 2: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = _rest[3]; var g = _rest[4]; var h = _rest[5]; var i = _rest[6]; var j = _rest[7]; var k = _rest[8]; var l = [c, d, e, f, g, h, i, j, k, null]; { var n = l[0]; var o = l[1]; var p = l[2]; var q = l[3]; var r = l[4]; var s = l[5]; var t = l[6]; var u = l[7]; var v = l[8]; var w = l[9]; var x = [n, o, (p != null && p != stringEmpty()) ? new XmlTextReader(9, TextReader.e, n).d8(p, q, r, s) : null, t, u, v, w]; { var z = x[0]; var aa = x[1]; var ab = x[2]; var ac = x[3]; var ad = x[4]; var ae = x[5]; var af = x[6]; _this.u = aa; _this.w = z != null ? z : aa != null ? aa.ag : null; if (ab != null) { _this.f = ab.b; _this.j = ab.c; _this.l = ab.d; _this.h = ab.a; _this.s = ab; } _this.o = af; _this.d = ac; _this.n = ad; _this.y = ae; _this.a = arrayListCreate(); } } } break; case 3: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = _rest[3]; var g = _rest[4]; var h = _rest[5]; var i = _rest[6]; var j = _rest[7]; var k = _rest[8]; var l = _rest[9]; var m = [c, d, (e != null && e != stringEmpty()) ? new XmlTextReader(9, TextReader.e, c).d8(e, f, g, h) : null, i, j, k, l]; { var o = m[0]; var p = m[1]; var q = m[2]; var r = m[3]; var s = m[4]; var t = m[5]; var u = m[6]; _this.u = p; _this.w = o != null ? o : p != null ? p.ag : null; if (q != null) { _this.f = q.b; _this.j = q.c; _this.l = q.d; _this.h = q.a; _this.s = q; } _this.o = u; _this.d = r; _this.n = s; _this.y = t; _this.a = arrayListCreate(); } } break; case 4: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = _rest[3]; var g = _rest[4]; var h = _rest[5]; var i = _rest[6]; _this.u = d; _this.w = c != null ? c : d != null ? d.ag : null; if (e != null) { _this.f = e.b; _this.j = e.c; _this.l = e.d; _this.h = e.a; _this.s = e; } _this.o = i; _this.d = f; _this.n = g; _this.y = h; _this.a = arrayListCreate(); } break; } return _this; } Object.defineProperty(XmlParserContext.prototype, "d", { get: function () { return this.c; }, set: function (a) { this.c = a != null ? a : stringEmpty(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "f", { get: function () { return this.e != null ? this.e : this.s != null ? this.s.b : null; }, set: function (a) { this.e = a != null ? a : stringEmpty(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "t", { get: function () { return this.s; }, set: function (a) { this.s = a; }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "p", { get: function () { return this.o; }, set: function (a) { this.o = a; }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "h", { get: function () { return this.g != null ? this.g : this.s != null ? this.s.a : null; }, set: function (a) { this.g = a != null ? a : stringEmpty(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "v", { get: function () { return this.u; }, set: function (a) { this.u = a; }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "x", { get: function () { return this.w; }, set: function (a) { this.w = a; }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "j", { get: function () { return this.i != null ? this.i : this.s != null ? this.s.c : null; }, set: function (a) { this.i = a != null ? a : stringEmpty(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "l", { get: function () { return this.k != null ? this.k : this.s != null ? this.s.d : null; }, set: function (a) { this.k = a != null ? a : stringEmpty(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "n", { get: function () { return this.m; }, set: function (a) { this.m = a != null ? a : stringEmpty(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlParserContext.prototype, "z", { get: function () { return this.y; }, set: function (a) { this.y = a; }, enumerable: false, configurable: true }); XmlParserContext.prototype.r = function () { var a = null; if (this.a.count == this.b) { a = new XmlParserContext_ContextItem(); this.a.add(a); } else { a = this.a.item(this.b); } a.a = this.d; a.b = this.n; a.c = this.z; this.b++; }; XmlParserContext.prototype.q = function () { if (this.b == 0) { throw new XmlException(3, "Unexpected end of element scope."); } this.b--; var a = this.a.item(this.b); this.c = a.a; this.m = a.b; this.y = a.c; }; XmlParserContext.$t = markType(XmlParserContext, 'XmlParserContext'); return XmlParserContext; }(Base)); export { XmlParserContext }; /** * @hidden */ var XmlTextReader = /** @class */ /*@__PURE__*/ (function (_super) { __extends(XmlTextReader, _super); function XmlTextReader(a) { var _rest = []; for (var _i = 1; _i < arguments.length; _i++) { _rest[_i - 1] = arguments[_i]; } var _this = _super.call(this) || this; _this.es = null; _this.er = null; _this.ep = null; _this.eq = null; _this.a9 = new Array(10); _this.ba = new Array(10); _this.b6 = 0; _this.b7 = 0; _this.b3 = 0; _this.ej = null; _this.eg = null; _this.ef = null; _this.eb = 0; _this.bk = false; _this.ca = 0; _this.cb = 0; _this.bj = false; _this.bq = false; _this.bb = null; _this.cc = 0; _this.be = false; _this.bl = false; _this.bz = false; _this.c0 = null; _this.c7 = null; _this.cy = null; _this.bc = null; _this.ck = 0; _this.cl = 0; _this.b5 = 0; _this.br = false; _this.ce = 0; _this.b4 = 0; _this.b8 = 0; _this.b9 = 0; _this.b2 = false; _this.ei = 0; _this.eh = 0; _this.ch = 0; _this.bu = false; _this.bm = true; _this.ec = 0; _this.ek = new XmlUrlResolver(); _this.bo = false; _this.bg = false; _this.bs = false; _this.bh = true; _this.d9 = 0; _this.ea = null; _this.bd = null; _this.eo = new XmlTextReader_DtdInputStateStack(); a = (a == void 0) ? 0 : a; switch (a) { case 0: break; case 1: { var c = _rest[0]; var d = [new XmlStreamReader(1, c)]; { var f = d[0]; var g = [f, new NameTable()]; { var i = g[0]; var j = g[1]; var k = [stringEmpty(), i, j]; { var m = k[0]; var n = k[1]; var o = k[2]; var p = [m, n, 9, null]; { var r = p[0]; var s = p[1]; var t = p[2]; var u = p[3]; _this.dn(r, u, s, t); } } } } } break; case 2: { var c = _rest[0]; var d = [c, new NameTable()]; { var f_1 = d[0]; var g = d[1]; var h_1; var i = ((function () { var j = _this.cw(f_1, h_1); h_1 = j.p1; return j.ret; })()); var j = new XmlParserContext(0, g, new XmlNamespaceManager(g), stringEmpty(), 0); _this.dn(h_1, j, new XmlStreamReader(1, i), 9); } } break; case 3: { var c = _rest[0]; var d = [c, new NameTable()]; { var f = d[0]; var g = d[1]; var h = [stringEmpty(), f, g]; { var j = h[0]; var k = h[1]; var l = h[2]; var m = [j, k, 9, null]; { var o = m[0]; var p = m[1]; var q = m[2]; var r = m[3]; _this.dn(o, r, p, q); } } } } break; case 4: { var c = _rest[0]; var d = [stringEmpty(), null, 0, null]; { var f = d[0]; var g = d[1]; var h = d[2]; var i = d[3]; _this.dn(f, i, g, h); } } break; case 5: { var c = _rest[0]; var d = _rest[1]; var e = [new XmlStreamReader(1, c), d]; { var g = e[0]; var h = e[1]; var i = [stringEmpty(), g, h]; { var k = i[0]; var l = i[1]; var m = i[2]; var n = [k, l, 9, null]; { var p = n[0]; var q = n[1]; var r = n[2]; var s = n[3]; _this.dn(p, s, q, r); } } } } break; case 6: { var c = _rest[0]; var d = _rest[1]; var e = [c, new XmlStreamReader(1, d)]; { var g = e[0]; var h = e[1]; var i = [g, h, new NameTable()]; { var k = i[0]; var l = i[1]; var m = i[2]; var n = [k, l, 9, null]; { var p = n[0]; var q = n[1]; var r = n[2]; var s = n[3]; _this.dn(p, s, q, r); } } } } break; case 7: { var c = _rest[0]; var d = _rest[1]; var e = [c, d, new NameTable()]; { var g = e[0]; var h = e[1]; var i = e[2]; var j = [g, h, 9, null]; { var l = j[0]; var m = j[1]; var n = j[2]; var o = j[3]; _this.dn(l, o, m, n); } } } break; case 8: { var c_1 = _rest[0]; var d = _rest[1]; var e_1; var f = ((function () { var g = _this.cw(c_1, e_1); e_1 = g.p1; return g.ret; })()); var g = new XmlParserContext(0, d, new XmlNamespaceManager(d), stringEmpty(), 0); _this.dn(e_1, g, new XmlStreamReader(1, f), 9); } break; case 9: { var c = _rest[0]; var d = _rest[1]; var e = [stringEmpty(), c, d]; { var g = e[0]; var h = e[1]; var i = e[2]; var j = [g, h, 9, null]; { var l = j[0]; var m = j[1]; var n = j[2]; var o = j[3]; _this.dn(l, o, m, n); } } } break; case 10: { var c = _rest[0]; var d = _rest[1]; var e_2 = _rest[2]; var f = _rest[3]; var g = _rest[4]; if (d == null) { d = new XmlUrlResolver(); } _this.em = d; var h_2; var i = ((function () { var j = _this.cw(e_2, h_2); h_2 = j.p1; return j.ret; })()); _this.dn(h_2, g, new XmlStreamReader(1, i), f); } break; case 11: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = [e != null ? e.d : stringEmpty(), new XmlStreamReader(1, c), d, e]; { var h = f[0]; var i = f[1]; var j = f[2]; var k = f[3]; _this.dn(h, k, i, j); } _this.bk = true; } break; case 12: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = [c, d, e, null]; { var h = f[0]; var i = f[1]; var j = f[2]; var k = f[3]; _this.dn(h, k, i, j); } } break; case 13: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = [c, new XmlStreamReader(1, d), e]; { var h = f[0]; var i = f[1]; var j = f[2]; var k = [h, i, 9, null]; { var m = k[0]; var n = k[1]; var o = k[2]; var p = k[3]; _this.dn(m, p, n, o); } } } break; case 14: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = [c, d, 9, null]; { var h = f[0]; var i = f[1]; var j = f[2]; var k = f[3]; _this.dn(h, k, i, j); } } break; case 15: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = [e != null ? e.d : stringEmpty(), new StringReader(c), d, e]; { var h = f[0]; var i = f[1]; var j = f[2]; var k = f[3]; _this.dn(h, k, i, j); } _this.bk = true; } break; case 16: { var c = _rest[0]; var d = _rest[1]; var e = _rest[2]; var f = _rest[3]; _this.dn(c, f, d, e); } break; } return _this; } XmlTextReader.prototype.cw = function (a, b) { var c = this.ek.d(null, a); b = c != null ? c.toString() : stringEmpty(); return { ret: typeCast(Stream.$, this.ek.b(c, null, Stream.$)), p1: b }; }; XmlTextReader.prototype.get_w = function () { return this.b3; }; Object.defineProperty(XmlTextReader.prototype, "w", { get: function () { return this.get_w(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_z = function () { return this.ej.d; }; Object.defineProperty(XmlTextReader.prototype, "z", { get: function () { return this.get_z(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_a = function () { return true; }; XmlTextReader.prototype.get_b = function () { return true; }; Object.defineProperty(XmlTextReader.prototype, "bf", { get: function () { return this.bg; }, set: function (a) { this.bg = a; }, enumerable: false, configurable: true }); Object.defineProperty(XmlTextReader.prototype, "bi", { get: function () { return this.bh; }, set: function (a) { this.bh = a; }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_x = function () { var a = this.er.n == 1 ? 0 : -1; if (this.b7 >= 0) { return a + this.cb + 2; } else if (this.b6 >= 0) { return a + this.cb + 1; } return this.cb; }; Object.defineProperty(XmlTextReader.prototype, "x", { get: function () { return this.get_x(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlTextReader.prototype, "c6", { get: function () { return this.ej.p || Encoding.uTF8; }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_d = function () { return this.eb == 3; }; Object.defineProperty(XmlTextReader.prototype, "d", { get: function () { return this.get_d(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_f = function () { return this.es.k != null; }; Object.defineProperty(XmlTextReader.prototype, "f", { get: function () { return this.get_f(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_h = function () { return false; }; Object.defineProperty(XmlTextReader.prototype, "h", { get: function () { return this.get_h(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_i = function () { return this.es.a; }; Object.defineProperty(XmlTextReader.prototype, "i", { get: function () { return this.get_i(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.item = function (a) { return this.aa(a); }; XmlTextReader.prototype.item1 = function (a) { return this.ab(a); }; XmlTextReader.prototype.item2 = function (a, b) { return this.ac(a, b); }; Object.defineProperty(XmlTextReader.prototype, "cf", { get: function () { if (this.b2) { return this.ce; } else { return this.es.c; } }, enumerable: false, configurable: true }); Object.defineProperty(XmlTextReader.prototype, "cg", { get: function () { if (this.b2) { return this.b4; } else { return this.es.d; } }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_ag = function () { return this.es.g; }; Object.defineProperty(XmlTextReader.prototype, "ag", { get: function () { return this.get_ag(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_ai = function () { return this.es.h; }; Object.defineProperty(XmlTextReader.prototype, "ai", { get: function () { return this.get_ai(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlTextReader.prototype, "bn", { get: function () { return this.bm; }, set: function (a) { if (this.eb != 0) { throw new InvalidOperationException(1, "Namespaces have to be set before reading."); } this.bm = a; }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_aj = function () { return this.es.i; }; Object.defineProperty(XmlTextReader.prototype, "aj", { get: function () { return this.get_aj(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_a5 = function () { return this.eg; }; Object.defineProperty(XmlTextReader.prototype, "a5", { get: function () { return this.get_a5(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_a7 = function () { return this.es.n; }; Object.defineProperty(XmlTextReader.prototype, "a7", { get: function () { return this.get_a7(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlTextReader.prototype, "bp", { get: function () { return this.bo; }, set: function (a) { this.bo = a; }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_ak = function () { return this.es.j; }; Object.defineProperty(XmlTextReader.prototype, "ak", { get: function () { return this.get_ak(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlTextReader.prototype, "bt", { get: function () { return this.bs; }, set: function (a) { this.bs = a; }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_v = function () { return this.es.b; }; Object.defineProperty(XmlTextReader.prototype, "v", { get: function () { return this.get_v(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_a3 = function () { return this.eb; }; Object.defineProperty(XmlTextReader.prototype, "a3", { get: function () { return this.get_a3(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_ar = function () { return this.es.k != null ? this.es.k : stringEmpty(); }; Object.defineProperty(XmlTextReader.prototype, "ar", { get: function () { return this.get_ar(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlTextReader.prototype, "ed", { get: function () { return this.ec; }, set: function (a) { this.ec = a; }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_as = function () { return this.ej.n; }; Object.defineProperty(XmlTextReader.prototype, "as", { get: function () { return this.get_as(); }, enumerable: false, configurable: true }); Object.defineProperty(XmlTextReader.prototype, "em", { set: function (a) { this.ek = a; }, enumerable: false, configurable: true }); XmlTextReader.prototype.get_a8 = function () { return this.ej.z; }; Object.defineProperty(XmlTextReader.prototype, "a8", { get: function () { return this.get_a8(); }, enumerable: false, configurable: true }); XmlTextReader.prototype.au = function () { this.eb = 4; this.es.m(); this.er.m(); this.b3 = 0; if (this.bh && this.cy != null) { this.cy.i(); } }; XmlTextReader.prototype.aa = function (a) { if (a >= this.b3) { throw new ArgumentOutOfRangeException(1, "i is smaller than AttributeCount"); } else { return this.a9[a].k; } }; XmlTextReader.prototype.ab = function (a) { for (var b = 0; b < this.b3; b++) { if (this.a9[b].h == a) { return this.a9[b].k; } } return null; }; XmlTextReader.prototype.cd = function (a, b) { b = b != null ? b : stringEmpty(); for (var c = 0; c < this.b3; c++) { var d = this.a9[c]; if (d.g == a && d.i == b) { return c; } } return -1; }; XmlTextReader.prototype.ac = function (a, b) { var c = this.cd(a, b); if (c < 0) { return null; } return this.a9[c].k; }; XmlTextReader.prototype.cx = function () { if (this.cl < 0) { return this.cy; } return new StringReader(stringCreateFromCharArraySlice(this.bc, this.ck, this.cl - this.ck) + this.cy.h()); }; XmlTextReader.prototype.ah = function (a) { return this.c1(a, false); }; XmlTextReader.prototype.c1 = function (a, b) { var c = this.ef.lookupNamespace1(a, b); return c == stringEmpty() ? null : c; }; XmlTextReader.prototype.aw = function (a) { if (a >= this.b3) { throw new ArgumentOutOfRangeException(1, "attribute index out of range."); } this.b6 = a; this.b7 = -1; this.es = this.a9[a]; }; XmlTextReader.prototype.o = function (a) { for (var b = 0; b < this.b3; b++) { var c = this.a9[b]; if (c.h == a) { this.aw(b); return true; } } return false; }; XmlTextReader.prototype.p = function (a, b) { var c = this.cd(a, b); if (c < 0) { return false; } this.aw(c); return true; }; XmlTextReader.prototype.q = function () { if (this.er == null) { return false; } if (this.es == this.er) { return false; } if (this.b6 >= 0) { this.b6 = -1; this.b7 = -1; this.es = this.er; return true; } else { return false; } }; XmlTextReader.prototype.r = function () { if (this.b3 == 0) { return false; } this.q(); return this.s(); }; XmlTextReader.prototype.s = function () { if (this.b6 == 0 && this.b3 == 0) { return false; } if (this.b6 + 1 < this.b3) { this.b6++; this.b7 = -1; this.es = this.a9[this.b6]; return true; } else { return false; } }; XmlTextReader.prototype.t = function () { if (this.eb == 4) { return false; } this.b5 = this.ck; this.br = true; this.ch = 0; this.df(); if (this.ei == 2) { if (this.b6 == 0) { return false; } this.d6(); this.de(); this.dk(); this.ds('\"'.charCodeAt(0)); this.es = this.a9[0]; this.b7 = -1; this.eb = 1; return true; } if (this.eb == 0 && this.eh == 1) { this.d6(); } var a = false; this.eb = 1; this.b8 = this.ce; this.b9 = this.b4; this.b2 = true; this.es = this.er; this.b3 = 0; this.b6 = this.b7 = -1; this.er.m(); if (this.bj) { ++this.ca; this.bj = false; } if (this.bu) { this.bu = false; return this.bx(); } a = this.bv(); if (!a && this.ei == 9 && this.eh != 15) { throw this.ee("Document element did not appear."); } this.b2 = false; return a; }; XmlTextReader.prototype.u = function () { if (this.eb == 0 && this.ei == 2) { this.t(); } if (this.b6 < 0) { return false; } var a = this.a9[this.b6]; if (this.b7 < 0) { this.b7 = a.q - 1; } if (this.b7 < a.p) { this.b7++; this.es = this.ba[this.b7]; return true; } else { return false; } }; XmlTextReader.prototype.cn = function (a, b, c) { return 0; }; XmlTextReader.prototype.co = function (a, b, c) { return 0; }; XmlTextReader.prototype.cr = function (a, b, c) { if (b < 0) { throw new ArgumentOutOfRangeException(3, "offset", b, "Offset must be non-negative integer."); } else if (c < 0) { throw new ArgumentOutOfRangeException(3, "length", c, "Length must be non-negative integer."); } else if (a.length < b + c) { throw new ArgumentOutOfRangeException(1, "buffer length is smaller than the sum of offset and length."); } if (this.i) { this.t(); return 0; } if (!this.bu && this.a7 != 1) { return 0; } this.br = false; this.bu = true; this.b2 = true; return this.cs(a, b, c); }; XmlTextReader.prototype.d2 = function () { if (this.bk) { throw new InvalidOperationException(1, "Cannot call ResetState when parsing an XML fragment."); } this.dd(); }; XmlTextReader.prototype.a1 = function () { throw new InvalidOperationException(1, "XmlTextReader cannot resolve external entities."); }; Object.defineProperty(XmlTextReader.prototype, "el", { get: function () { return this.ek; }, enumerable: false, configurable: true }); XmlTextReader.prototype.ee = function (a) { return new XmlException(2, typeCast(IXmlLineInfo_$type, this), this.z, a); }; XmlTextReader.prototype.initXmlTextReader = function () { this.be = false; this.bb = new Array(10); this.c7 = new StringBuilder(0); this.bg = true; this.bs = false; this.bh = true; this.d9 = 2; this.ck = 0; if (this.bc == null) { this.bc = new Array(1024); } this.cl = -1; this.b5 = -1; this.ce = 1; this.b4 = 1; this.b8 = this.b9 = 0; this.dd(); }; XmlTextReader.prototype.dd = function () { this.er = new XmlTextReader_XmlTokenInfo(this); this.es = this.er; this.b6 = -1; this.b7 = -1; this.b3 = 0; this.eb = 0; this.ca = 0; this.cb = 0; this.bj = false; this.bq = this.be = false; this.cc = 0; this.bl = false; this.bz = false; this.c0 = stringEmpty(); this.b2 = false; this.eh = 0; this.bu = false; }; XmlTextReader.prototype.dn = function (a, b, c, d) { this.ei = d; this.ej = b; if (b == null) { var e = new NameTable(); this.ej = new XmlParserContext(0, e, new XmlNamespaceManager(e), stringEmpty(), 0); } this.eg = this.ej.x; this.eg = this.eg != null ? this.eg : new NameTable(); this.ef = this.ej.v; this.ef = this.ef != null ? this.ef : new XmlNamespaceManager(this.eg); if (a != null && a.length > 0) { var f = null; try { f = new Uri(0, a); } catch (g) { throw g; } this.ej.d = f.toString(); } this.initXmlTextReader(); this.cy = c; switch (d) { case 2: this.cy = new StringReader(stringReplace(c.h(), "\"", "&quot;")); break; case 1: this.eh = 1; this.be = true; break; case 9: break; default: throw new XmlException(3, stringFormat("NodeType {0} is not allowed to create XmlTextReader.", enumGetBox(XmlNodeType_$type, d))); } }; XmlTextReader.prototype.d4 = function (a, b, c, d, e, f, g) { this.d5(this.er, a, b, c, d, e, f, g); this.er.c = this.b8; this.er.d = this.b9; }; XmlTextReader.prototype.d5 = function (a, b, c, d, e, f, g, h) { a.n = b; a.h = c; a.j = d; a.g = e; a.a = f; a.k = g; this.cb = this.ca; if (h) { this.de(); } }; XmlTextReader.prototype.de = function () { this.b3 = 0; this.b6 = -1; this.b7 = -1; }; XmlTextReader.prototype.cm = function (a) { if (this.cl <= this.ck + 1) { if (!this.bw(a)) { return a; } } var b = this.bc[this.ck].charCodeAt(0); var c = this.bc[this.ck + 1].charCodeAt(0); if (((b & 64512) != 55296) || ((c & 64512) != 56320)) { return b; } return 65536 + (b - 55296) * 1024 + (c - 56320); }; XmlTextReader.prototype.ci = function () { if (this.ck < this.cl) { var a = this.bc[this.ck].charCodeAt(0); if (a == 0) { return -1; } if (a < 55296 || a >= 57343) { return a; } return this.cm(a); } else { if (!this.bw(-1)) { return -1; } return this.ci(); } }; XmlTextReader.prototype.cp = function () { var a = this.ci(); this.ck++; if (a >= 65536) { this.ck++; } if (a == '\n'.charCodeAt(0)) { this.ce++; this.b4 = 1; } else if (a != -1) { this.b4++; } return a; }; XmlTextReader.prototype.c9 = function (a) { this.ck++; if (a >= 65536) { this.ck++; } if (a == '\n'.charCodeAt(0)) { this.ce++; this.b4 = 1; } else if (a != -1) { this.b4++; } }; XmlTextReader.prototype.bw = function (a) { if (this.cl < 0) { this.cl = this.cy.c(this.bc, 0, this.bc.length); return this.cl > 0; } var b = a >= 0 ? 1 : 0; var c = this.cl - this.b5; if (!this.br) { this.b5 = 0; this.ck = 0; } else if (this.cl < this.bc.length) { } else if (this.b5 <= (this.cl >> 1)) { var d = new Array(this.bc.length * 2); arrayCopy1(this.bc, this.b5, d, 0, c); this.bc = d; this.b5 = 0; this.ck = c; } else { arrayCopy1(this.bc, this.b5, this.bc, 0, c); this.b5 = 0; this.ck = c; } if (a >= 0) { this.bc[this.ck] = String.fromCharCode(a); } var e = this.bc.length - this.ck - b; if (e > 1024) { e = 1024; } var f = this.cy.c(this.bc, this.ck + b, e); var g = b + f; this.cl = this.ck + g; return (g != 0); }; XmlTextReader.prototype.bv = function () { if (this.bq) { this.ef.h(); this.ej.q(); this.bq = false; } if (this.bz) { this.d3(); } else { var a = this.ci(); if (a == -1) { this.eb = 3; this.df(); this.d4(0, stringEmpty(), stringEmpty(), stringEmpty(), false, null, true); if (this.ca > 0) { throw this.ee("unexpected end of file. Current depth is " + this.ca); } return false; } else { switch (a) { case 60: this.c9(a); switch (this.ci()) { case 47: this.c9(47); this.dx(); break; case 63: this.c9(63); this.dz(); break; case 33: this.c9(33); this.dv(); break;