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

◆ ReadAsync()

override Task< bool > System.Xml.XmlTextReaderImpl.ReadAsync ( )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 8668 of file XmlTextReaderImpl.cs.

8669 {
8671 if (_laterInitParam != null)
8672 {
8673 return FinishInitAsync().CallBoolTaskFuncWhenFinishAsync((XmlTextReaderImpl thisRef) => thisRef.ReadAsync(), this);
8674 }
8675 while (true)
8676 {
8677 switch (_parsingFunction)
8678 {
8679 case ParsingFunction.ElementContent:
8680 return ParseElementContentAsync();
8681 case ParsingFunction.DocumentContent:
8683 case ParsingFunction.SwitchToInteractive:
8684 _readState = ReadState.Interactive;
8686 break;
8687 case ParsingFunction.SwitchToInteractiveXmlDecl:
8689 case ParsingFunction.ResetAttributesRootLevel:
8692 _parsingFunction = ((_index == 0) ? ParsingFunction.DocumentContent : ParsingFunction.ElementContent);
8693 break;
8694 case ParsingFunction.MoveToElementContent:
8696 _index++;
8698 _parsingFunction = ParsingFunction.ElementContent;
8699 break;
8700 case ParsingFunction.PopElementContext:
8703 break;
8704 case ParsingFunction.PopEmptyElementContext:
8710 break;
8711 case ParsingFunction.EntityReference:
8713 return ParseEntityReferenceAsync().ReturnTrueTaskWhenFinishAsync();
8714 case ParsingFunction.ReportEndEntity:
8717 return AsyncHelper.DoneTaskTrue;
8718 case ParsingFunction.AfterResolveEntityInContent:
8723 break;
8724 case ParsingFunction.AfterResolveEmptyEntityInContent:
8726 _curNode.SetValueNode(XmlNodeType.Text, string.Empty);
8731 return AsyncHelper.DoneTaskTrue;
8732 case ParsingFunction.InReadAttributeValue:
8735 break;
8736 case ParsingFunction.InIncrementalRead:
8738 return AsyncHelper.DoneTaskTrue;
8739 case ParsingFunction.FragmentAttribute:
8740 return Task.FromResult(ParseFragmentAttribute());
8741 case ParsingFunction.XmlDeclarationFragment:
8743 _parsingFunction = ParsingFunction.GoToEof;
8744 return AsyncHelper.DoneTaskTrue;
8745 case ParsingFunction.GoToEof:
8746 OnEof();
8747 return AsyncHelper.DoneTaskFalse;
8748 case ParsingFunction.Error:
8749 case ParsingFunction.Eof:
8750 case ParsingFunction.ReaderClosed:
8751 return AsyncHelper.DoneTaskFalse;
8752 case ParsingFunction.NoData:
8754 return AsyncHelper.DoneTaskFalse;
8755 case ParsingFunction.PartialTextValue:
8756 return SkipPartialTextValueAsync().CallBoolTaskFuncWhenFinishAsync((XmlTextReaderImpl thisRef) => thisRef.ReadAsync(), this);
8757 case ParsingFunction.InReadValueChunk:
8758 return FinishReadValueChunkAsync().CallBoolTaskFuncWhenFinishAsync((XmlTextReaderImpl thisRef) => thisRef.ReadAsync(), this);
8759 case ParsingFunction.InReadContentAsBinary:
8760 return FinishReadContentAsBinaryAsync().CallBoolTaskFuncWhenFinishAsync((XmlTextReaderImpl thisRef) => thisRef.ReadAsync(), this);
8761 case ParsingFunction.InReadElementContentAsBinary:
8762 return FinishReadElementContentAsBinaryAsync().CallBoolTaskFuncWhenFinishAsync((XmlTextReaderImpl thisRef) => thisRef.ReadAsync(), this);
8763 }
8764 }
8765 }
static string Xml_MissingRoot
Definition SR.cs:78
Definition SR.cs:7
void SetLineInfo(int lineNo, int linePos)
void SetValueNode(XmlNodeType type, string value)
NodeData AddNode(int nodeIndex, int nodeDepth)
Task< bool > ReadAsync_SwitchToInteractiveXmlDecl()

References System.Xml.XmlTextReaderImpl._curNode, System.Xml.XmlTextReaderImpl._index, System.Xml.XmlTextReaderImpl._laterInitParam, System.Xml.XmlTextReaderImpl._nextParsingFunction, System.Xml.XmlTextReaderImpl._nodes, System.Xml.XmlTextReaderImpl._parsingFunction, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl._readState, System.Xml.XmlTextReaderImpl._reportedBaseUri, System.Xml.XmlTextReaderImpl._reportedEncoding, System.Xml.XmlTextReaderImpl.AddNode(), System.Xml.XmlTextReaderImpl.ParsingState.baseUriStr, System.Xml.XmlTextReaderImpl.CheckAsyncCall(), System.Xml.Dictionary, System.Xml.AsyncHelper.DoneTaskFalse, System.Xml.AsyncHelper.DoneTaskTrue, System.Xml.XmlTextReaderImpl.ParsingState.encoding, System.Xml.XmlTextReaderImpl.FinishAttributeValueIterator(), System.Xml.XmlTextReaderImpl.FinishIncrementalRead(), System.Xml.XmlTextReaderImpl.FinishInitAsync(), System.Xml.XmlTextReaderImpl.FinishReadContentAsBinaryAsync(), System.Xml.XmlTextReaderImpl.FinishReadElementContentAsBinaryAsync(), System.Xml.XmlTextReaderImpl.FinishReadValueChunkAsync(), System.Xml.XmlTextReaderImpl.ParsingState.lineNo, System.Xml.XmlTextReaderImpl.ParsingState.LinePos, System.Xml.XmlTextReaderImpl.OnEof(), System.Xml.XmlTextReaderImpl.ParseDocumentContentAsync(), System.Xml.XmlTextReaderImpl.ParseElementContentAsync(), System.Xml.XmlTextReaderImpl.ParseEntityReferenceAsync(), System.Xml.XmlTextReaderImpl.ParseFragmentAttribute(), System.Xml.XmlTextReaderImpl.ParseXmlDeclarationFragment(), System.Xml.XmlTextReaderImpl.PopElementContext(), System.Xml.XmlTextReaderImpl.ReadAsync_SwitchToInteractiveXmlDecl(), System.Xml.XmlTextReaderImpl.ResetAttributes(), System.Xml.XmlTextReaderImpl.NodeData.SetLineInfo(), System.Xml.XmlTextReaderImpl.SetupEndEntityNodeInContent(), System.Xml.XmlTextReaderImpl.NodeData.SetValueNode(), System.Xml.XmlTextReaderImpl.SkipPartialTextValueAsync(), System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(), and System.SR.Xml_MissingRoot.

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