Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadInit()

bool System.Xml.XmlSqlBinaryReader.ReadInit ( bool skipXmlDecl)
inlineprivate

Definition at line 2366 of file XmlSqlBinaryReader.cs.

2367 {
2368 string text = null;
2369 if (!_sniffed)
2370 {
2371 ushort num = ReadUShort();
2372 if (num != 65503)
2373 {
2375 goto IL_01e6;
2376 }
2377 }
2378 _version = ReadByte();
2379 if (_version != 1 && _version != 2)
2380 {
2382 }
2383 else
2384 {
2385 if (1200 == ReadUShort())
2386 {
2387 _state = ScanState.Doc;
2388 if (BinXmlToken.XmlDecl == PeekToken())
2389 {
2390 _pos++;
2391 _attributes[0].Set(new QName(string.Empty, _xnt.Add("version"), string.Empty), ParseText());
2392 _attrCount = 1;
2393 if (BinXmlToken.Encoding == PeekToken())
2394 {
2395 _pos++;
2396 _attributes[1].Set(new QName(string.Empty, _xnt.Add("encoding"), string.Empty), ParseText());
2397 _attrCount++;
2398 }
2399 byte b = ReadByte();
2400 if (b != 0)
2401 {
2402 if ((uint)(b - 1) > 1u)
2403 {
2405 goto IL_01e6;
2406 }
2407 _attributes[_attrCount].Set(new QName(string.Empty, _xnt.Add("standalone"), string.Empty), (b == 1) ? "yes" : "no");
2408 _attrCount++;
2409 }
2410 if (!skipXmlDecl)
2411 {
2412 QName qnameElement = new QName(string.Empty, _xnt.Add("xml"), string.Empty);
2414 _nodetype = XmlNodeType.XmlDeclaration;
2416 return true;
2417 }
2418 }
2419 return ReadDoc();
2420 }
2422 }
2423 goto IL_01e6;
2424 IL_01e6:
2425 _state = ScanState.Error;
2426 throw new XmlException(text, (string[])null);
2427 }
static string XmlBinary_UnsupportedCodePage
Definition SR.cs:1374
static string XmlBinary_InvalidStandalone
Definition SR.cs:1376
static string XmlBinary_InvalidSignature
Definition SR.cs:1370
static string XmlBinary_InvalidProtocolVersion
Definition SR.cs:1372
Definition SR.cs:7
string Add(char[] array, int offset, int length)

References System.Xml.XmlSqlBinaryReader._attrCount, System.Xml.XmlSqlBinaryReader._attributes, System.Xml.XmlSqlBinaryReader._nodetype, System.Xml.XmlSqlBinaryReader._pos, System.Xml.XmlSqlBinaryReader._posAfterAttrs, System.Xml.XmlSqlBinaryReader._qnameElement, System.Xml.XmlSqlBinaryReader._qnameOther, System.Xml.XmlSqlBinaryReader._sniffed, System.Xml.XmlSqlBinaryReader._state, System.Xml.XmlSqlBinaryReader._version, System.Xml.XmlSqlBinaryReader._xnt, System.Xml.XmlNameTable.Add(), System.Xml.Dictionary, System.Xml.XmlSqlBinaryReader.ParseText(), System.Xml.XmlSqlBinaryReader.PeekToken(), System.Xml.QName, System.Xml.XmlSqlBinaryReader.ReadByte(), System.Xml.XmlSqlBinaryReader.ReadDoc(), System.Xml.XmlSqlBinaryReader.ReadUShort(), System.Xml.XmlSqlBinaryReader.AttrInfo.Set(), System.text, System.SR.XmlBinary_InvalidProtocolVersion, System.SR.XmlBinary_InvalidSignature, System.SR.XmlBinary_InvalidStandalone, System.SR.XmlBinary_UnsupportedCodePage, and System.Xml.XmlException.

Referenced by System.Xml.XmlSqlBinaryReader.Read(), and System.Xml.XmlSqlBinaryReader.ReadDoc().