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

◆ ParseDoctypeDeclAsync()

async Task< bool > System.Xml.XmlTextReaderImpl.ParseDoctypeDeclAsync ( )
inlineprivate

Definition at line 12136 of file XmlTextReaderImpl.cs.

12137 {
12138 if (_dtdProcessing == DtdProcessing.Prohibit)
12139 {
12140 ThrowWithoutLineInfo(_v1Compat ? System.SR.Xml_DtdIsProhibited : System.SR.Xml_DtdIsProhibitedEx);
12141 }
12142 while (_ps.charsUsed - _ps.charPos < 8)
12143 {
12144 if (await ReadDataAsync().ConfigureAwait(continueOnCapturedContext: false) == 0)
12145 {
12146 Throw(System.SR.Xml_UnexpectedEOF, "DOCTYPE");
12147 }
12148 }
12149 if (!XmlConvert.StrEqual(_ps.chars, _ps.charPos, 7, "DOCTYPE"))
12150 {
12151 ThrowUnexpectedToken((!_rootElementParsed && _dtdInfo == null) ? "DOCTYPE" : "<!--");
12152 }
12153 if (!XmlCharType.IsWhiteSpace(_ps.chars[_ps.charPos + 7]))
12154 {
12156 }
12157 if (_dtdInfo != null)
12158 {
12160 }
12162 {
12164 }
12165 _ps.charPos += 8;
12167 if (_dtdProcessing == DtdProcessing.Parse)
12168 {
12172 _parsingFunction = ParsingFunction.ResetAttributesRootLevel;
12173 return true;
12174 }
12176 return false;
12177 }
static string Xml_DtdIsProhibited
Definition SR.cs:158
static string Xml_MultipleDTDsProvided
Definition SR.cs:106
static string Xml_UnexpectedEOF
Definition SR.cs:36
static string Xml_DtdAfterRootElement
Definition SR.cs:154
Definition SR.cs:7
void SetLineInfo(int lineNo, int linePos)
async Task< int > EatWhitespacesAsync(StringBuilder sb)
void Throw(int pos, string res, string arg)
void ThrowUnexpectedToken(int pos, string expectedToken)

References System.Xml.XmlTextReaderImpl._curNode, System.Xml.XmlTextReaderImpl._dtdInfo, System.Xml.XmlTextReaderImpl._dtdProcessing, System.Xml.XmlTextReaderImpl._nextParsingFunction, System.Xml.XmlTextReaderImpl._parsingFunction, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl._rootElementParsed, System.Xml.XmlTextReaderImpl._v1Compat, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.EatWhitespacesAsync(), System.Xml.XmlCharType.IsWhiteSpace(), System.Xml.XmlTextReaderImpl.ParsingState.LineNo, System.Xml.XmlTextReaderImpl.ParsingState.LinePos, System.Xml.XmlTextReaderImpl.ParseDtdAsync(), System.Xml.XmlTextReaderImpl.ReadDataAsync(), System.Xml.XmlTextReaderImpl.NodeData.SetLineInfo(), System.Xml.XmlTextReaderImpl.SkipDtdAsync(), System.Xml.XmlConvert.StrEqual(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.ThrowExpectingWhitespace(), System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(), System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(), System.SR.Xml_DtdAfterRootElement, System.SR.Xml_DtdIsProhibited, System.SR.Xml_DtdIsProhibitedEx, System.SR.Xml_MultipleDTDsProvided, and System.SR.Xml_UnexpectedEOF.

Referenced by System.Xml.XmlTextReaderImpl.ParseDocumentContentAsync().