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

◆ ReadValueChunk()

override int System.Xml.XmlTextReaderImpl.ReadValueChunk ( char[] buffer,
int index,
int count )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 2474 of file XmlTextReaderImpl.cs.

2475 {
2476 if (!XmlReader.HasValueInternal(_curNode.type))
2477 {
2479 }
2480 if (buffer == null)
2481 {
2482 throw new ArgumentNullException("buffer");
2483 }
2484 if (count < 0)
2485 {
2486 throw new ArgumentOutOfRangeException("count");
2487 }
2488 if (index < 0)
2489 {
2490 throw new ArgumentOutOfRangeException("index");
2491 }
2492 if (buffer.Length - index < count)
2493 {
2494 throw new ArgumentOutOfRangeException("count");
2495 }
2496 if (_parsingFunction != ParsingFunction.InReadValueChunk)
2497 {
2498 if (_readState != ReadState.Interactive)
2499 {
2500 return 0;
2501 }
2502 if (_parsingFunction == ParsingFunction.PartialTextValue)
2503 {
2504 _incReadState = IncrementalReadState.ReadValueChunk_OnPartialValue;
2505 }
2506 else
2507 {
2508 _incReadState = IncrementalReadState.ReadValueChunk_OnCachedValue;
2511 }
2512 _parsingFunction = ParsingFunction.InReadValueChunk;
2513 _readValueOffset = 0;
2514 }
2515 if (count == 0)
2516 {
2517 return 0;
2518 }
2519 int num = 0;
2520 int num2 = _curNode.CopyTo(_readValueOffset, buffer, index + num, count - num);
2521 num += num2;
2523 if (num == count)
2524 {
2525 char ch = buffer[index + count - 1];
2526 if (XmlCharType.IsHighSurrogate(ch))
2527 {
2528 num--;
2530 if (num == 0)
2531 {
2533 }
2534 }
2535 return num;
2536 }
2537 if (_incReadState == IncrementalReadState.ReadValueChunk_OnPartialValue)
2538 {
2539 _curNode.SetValue(string.Empty);
2540 bool flag = false;
2541 int startPos = 0;
2542 int endPos = 0;
2543 while (num < count && !flag)
2544 {
2545 int outOrChars = 0;
2546 flag = ParseText(out startPos, out endPos, ref outOrChars);
2547 int num3 = count - num;
2548 if (num3 > endPos - startPos)
2549 {
2550 num3 = endPos - startPos;
2551 }
2553 num += num3;
2554 startPos += num3;
2555 }
2556 _incReadState = (flag ? IncrementalReadState.ReadValueChunk_OnCachedValue : IncrementalReadState.ReadValueChunk_OnPartialValue);
2557 if (num == count)
2558 {
2559 char ch2 = buffer[index + count - 1];
2560 if (XmlCharType.IsHighSurrogate(ch2))
2561 {
2562 num--;
2563 startPos--;
2564 if (num == 0)
2565 {
2567 }
2568 }
2569 }
2570 _readValueOffset = 0;
2572 }
2573 return num;
2574 }
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
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.NodeData.CopyTo(), System.count, System.Xml.Dictionary, System.SR.Format(), System.Xml.XmlReader.HasValueInternal(), System.index, System.Xml.XmlCharType.IsHighSurrogate(), System.Xml.XmlTextReaderImpl.ParseText(), System.Xml.XmlTextReaderImpl.NodeData.SetValue(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.NodeData.type, System.SR.Xml_InvalidReadValueChunk, and System.SR.Xml_NotEnoughSpaceForSurrogatePair.