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

◆ ReadLine()

override? string System.IO.StringReader.ReadLine ( )
inlinevirtual

Reimplemented from System.IO.TextReader.

Definition at line 137 of file StringReader.cs.

138 {
139 if (_s == null)
140 {
141 throw new ObjectDisposedException(null, SR.ObjectDisposed_ReaderClosed);
142 }
143 int i;
144 for (i = _pos; i < _length; i++)
145 {
146 char c = _s[i];
147 if (c == '\r' || c == '\n')
148 {
149 string result = _s.Substring(_pos, i - _pos);
150 _pos = i + 1;
151 if (c == '\r' && _pos < _length && _s[_pos] == '\n')
152 {
153 _pos++;
154 }
155 return result;
156 }
157 }
158 if (i > _pos)
159 {
160 string result2 = _s.Substring(_pos, i - _pos);
161 _pos = i;
162 return result2;
163 }
164 return null;
165 }

References System.IO.StringReader._length, System.IO.StringReader._pos, System.IO.StringReader._s, and System.SR.ObjectDisposed_ReaderClosed.

Referenced by System.IO.StringReader.ReadLineAsync().