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

◆ ReadValueChunkAsync()

override async Task< int > System.Xml.XmlTextReaderImpl.ReadValueChunkAsync ( char[] buffer,
int index,
int count )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 9077 of file XmlTextReaderImpl.cs.

9078 {
9080 if (!XmlReader.HasValueInternal(_curNode.type))
9081 {
9083 }
9084 if (buffer == null)
9085 {
9086 throw new ArgumentNullException("buffer");
9087 }
9088 if (count < 0)
9089 {
9090 throw new ArgumentOutOfRangeException("count");
9091 }
9092 if (index < 0)
9093 {
9094 throw new ArgumentOutOfRangeException("index");
9095 }
9096 if (buffer.Length - index < count)
9097 {
9098 throw new ArgumentOutOfRangeException("count");
9099 }
9100 if (_parsingFunction != ParsingFunction.InReadValueChunk)
9101 {
9102 if (_readState != ReadState.Interactive)
9103 {
9104 return 0;
9105 }
9106 if (_parsingFunction == ParsingFunction.PartialTextValue)
9107 {
9108 _incReadState = IncrementalReadState.ReadValueChunk_OnPartialValue;
9109 }
9110 else
9111 {
9112 _incReadState = IncrementalReadState.ReadValueChunk_OnCachedValue;
9115 }
9116 _parsingFunction = ParsingFunction.InReadValueChunk;
9117 _readValueOffset = 0;
9118 }
9119 if (count == 0)
9120 {
9121 return 0;
9122 }
9123 int readCount2 = 0;
9125 readCount2 += num;
9126 _readValueOffset += num;
9127 if (readCount2 == count)
9128 {
9129 char ch = buffer[index + count - 1];
9130 if (XmlCharType.IsHighSurrogate(ch))
9131 {
9132 readCount2--;
9134 if (readCount2 == 0)
9135 {
9137 }
9138 }
9139 return readCount2;
9140 }
9141 if (_incReadState == IncrementalReadState.ReadValueChunk_OnPartialValue)
9142 {
9143 _curNode.SetValue(string.Empty);
9144 bool flag = false;
9145 int num2 = 0;
9146 int num3 = 0;
9147 while (readCount2 < count && !flag)
9148 {
9149 int outOrChars = 0;
9151 (num2, num3, _, _) = tuple;
9152 _ = tuple.Item3;
9153 flag = tuple.Item4;
9154 int num4 = count - readCount2;
9155 if (num4 > num3 - num2)
9156 {
9157 num4 = num3 - num2;
9158 }
9160 readCount2 += num4;
9161 num2 += num4;
9162 }
9163 _incReadState = (flag ? IncrementalReadState.ReadValueChunk_OnCachedValue : IncrementalReadState.ReadValueChunk_OnPartialValue);
9164 if (readCount2 == count)
9165 {
9166 char ch2 = buffer[index + count - 1];
9167 if (XmlCharType.IsHighSurrogate(ch2))
9168 {
9169 readCount2--;
9170 num2--;
9171 if (readCount2 == 0)
9172 {
9174 }
9175 }
9176 }
9177 _readValueOffset = 0;
9179 }
9180 return readCount2;
9181 }
static string Xml_NotEnoughSpaceForSurrogatePair
Definition SR.cs:194
static string Xml_InvalidReadValueChunk
Definition SR.cs:188
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
void CopyTo(int valueOffset, StringBuilder sb)
void Throw(int pos, string res, string arg)
static void BlockCopyChars(char[] src, int srcOffset, char[] dst, int dstOffset, int count)
IncrementalReadState _incReadState

References System.Xml.XmlTextReaderImpl._curNode, System.Xml.XmlTextReaderImpl._incReadState, System.Xml.XmlTextReaderImpl._nextNextParsingFunction, System.Xml.XmlTextReaderImpl._nextParsingFunction, System.Xml.XmlTextReaderImpl._parsingFunction, System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl._readState, System.Xml.XmlTextReaderImpl._readValueOffset, System.Xml.XmlTextReaderImpl.BlockCopyChars(), System.buffer, System.ch, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.CheckAsyncCall(), System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Xml.XmlTextReaderImpl.NodeData.CopyTo(), System.count, System.Xml.Dictionary, System.SR.Format(), System.Xml.XmlReader.HasValueInternal(), System.index, System.Xml.XmlTextReaderImpl.int, System.Xml.XmlCharType.IsHighSurrogate(), System.Xml.XmlTextReaderImpl.ParseTextAsync(), System.Xml.XmlTextReaderImpl.NodeData.SetValue(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.NodeData.type, System.SR.Xml_InvalidReadValueChunk, and System.SR.Xml_NotEnoughSpaceForSurrogatePair.