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

◆ HandleEntityReferenceAsync()

async Task<(int, EntityType)> System.Xml.XmlTextReaderImpl.HandleEntityReferenceAsync ( bool isInAttributeValue,
EntityExpandType expandType )
inlineprivate

Definition at line 11569 of file XmlTextReaderImpl.cs.

11570 {
11571 if (_ps.charPos + 1 == _ps.charsUsed && await ReadDataAsync().ConfigureAwait(continueOnCapturedContext: false) == 0)
11572 {
11574 }
11575 int charRefEndPos;
11576 if (_ps.chars[_ps.charPos + 1] == '#')
11577 {
11580 return (charRefEndPos, item);
11581 }
11583 if (charRefEndPos >= 0)
11584 {
11585 return (charRefEndPos, EntityType.CharacterNamed);
11586 }
11587 if (expandType == EntityExpandType.OnlyCharacter || (_entityHandling != EntityHandling.ExpandEntities && (!isInAttributeValue || !_validatingReaderCompatFlag)))
11588 {
11589 return (charRefEndPos, EntityType.Unexpanded);
11590 }
11591 _ps.charPos++;
11592 int savedLinePos = _ps.LinePos;
11593 int num;
11594 try
11595 {
11596 num = await ParseNameAsync().ConfigureAwait(continueOnCapturedContext: false);
11597 }
11598 catch (XmlException)
11599 {
11601 return (charRefEndPos, EntityType.Skipped);
11602 }
11603 if (_ps.chars[num] != ';')
11604 {
11605 ThrowUnexpectedToken(num, ";");
11606 }
11607 int linePos = _ps.LinePos;
11608 string name = _nameTable.Add(_ps.chars, _ps.charPos, num - _ps.charPos);
11609 _ps.charPos = num + 1;
11610 charRefEndPos = -1;
11614 return (charRefEndPos, item2);
11615 }
static string Xml_UnexpectedEOF1
Definition SR.cs:38
static string Xml_ErrorParsingEntityName
Definition SR.cs:136
Definition SR.cs:7
string Add(char[] array, int offset, int length)
async Task< EntityType > HandleGeneralEntityReferenceAsync(string name, bool isInAttributeValue, bool pushFakeEntityIfNullResolver, int entityStartLinePos)
async Task<(EntityType, int)> ParseNumericCharRefAsync(bool expand, StringBuilder internalSubsetBuilder)
async Task< int > ParseNamedCharRefAsync(bool expand, StringBuilder internalSubsetBuilder)
void Throw(int pos, string res, string arg)
void ThrowUnexpectedToken(int pos, string expectedToken)

References System.Xml.XmlTextReaderImpl._entityHandling, System.Xml.XmlTextReaderImpl._nameTable, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl._reportedBaseUri, System.Xml.XmlTextReaderImpl._reportedEncoding, System.Xml.XmlTextReaderImpl._validatingReaderCompatFlag, System.Xml.XmlNameTable.Add(), System.Xml.XmlTextReaderImpl.ParsingState.baseUriStr, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.ParsingState.encoding, System.Xml.XmlTextReaderImpl.HandleGeneralEntityReferenceAsync(), System.item, System.Xml.XmlTextReaderImpl.ParsingState.LineNo, System.Xml.XmlTextReaderImpl.ParsingState.LinePos, System.Xml.XmlTextReaderImpl.ParseNameAsync(), System.Xml.XmlTextReaderImpl.ParseNamedCharRefAsync(), System.Xml.XmlTextReaderImpl.ParseNumericCharRefAsync(), System.Xml.XmlTextReaderImpl.ReadDataAsync(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(), System.SR.Xml_ErrorParsingEntityName, and System.SR.Xml_UnexpectedEOF1.

Referenced by System.Xml.XmlTextReaderImpl.ParseAttributeValueSlowAsync(), System.Xml.XmlTextReaderImpl.ParseDocumentContentAsync_ParseEntity(), and System.Xml.XmlTextReaderImpl.ParseTextAsync_ParseEntity().