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

◆ MoveLinesFromStringBuilderToMessageQueue()

void System.Diagnostics.AsyncStreamReader.MoveLinesFromStringBuilderToMessageQueue ( )
inlineprivate

Definition at line 110 of file AsyncStreamReader.cs.

111 {
112 int i = _currentLinePos;
113 int num = 0;
114 int length = _sb.Length;
115 if (_bLastCarriageReturn && length > 0 && _sb[0] == '\n')
116 {
117 i = 1;
118 num = 1;
119 _bLastCarriageReturn = false;
120 }
121 for (; i < length; i++)
122 {
123 char c = _sb[i];
124 if (c == '\r' || c == '\n')
125 {
126 string item = _sb.ToString(num, i - num);
127 num = i + 1;
128 if (c == '\r' && num < length && _sb[num] == '\n')
129 {
130 num++;
131 i++;
132 }
134 {
136 }
137 }
138 }
139 if (length > 0 && _sb[length - 1] == '\r')
140 {
142 }
143 if (num < length)
144 {
145 if (num == 0)
146 {
148 return;
149 }
150 _sb.Remove(0, num);
151 _currentLinePos = 0;
152 }
153 else
154 {
155 _sb.Length = 0;
156 _currentLinePos = 0;
157 }
158 }
readonly Queue< string > _messageQueue
StringBuilder Remove(int startIndex, int length)
override string ToString()

References System.Diagnostics.AsyncStreamReader._bLastCarriageReturn, System.Diagnostics.AsyncStreamReader._currentLinePos, System.Diagnostics.AsyncStreamReader._messageQueue, System.Diagnostics.AsyncStreamReader._sb, System.Collections.Generic.Queue< T >.Enqueue(), System.item, System.length, System.Text.StringBuilder.Length, System.Text.StringBuilder.Remove(), and System.Text.StringBuilder.ToString().

Referenced by System.Diagnostics.AsyncStreamReader.ReadBufferAsync().