Engines/FlatRedBallXNA/FlatRedBall/IO/Csv/CsvReader.cs
/// <summary>
/// Parses a new line delimiter.
/// </summary>
/// <param name="pos">The starting position of the parsing. Will contain the resulting end position.</param>
/// <returns><see langword="true"/> if a new line delimiter was found; otherwise, <see langword="false"/>.</returns>
/// <exception cref="T:System.ComponentModel.ObjectDisposedException">
///	The instance has been disposed of.
/// </exception>
Parses a new line delimiter.
Parses a new line delimiter .
private bool ParseNewLine(ref int pos)
		{
			Debug.Assert(pos <= _bufferLength);
			if (pos == _bufferLength)
			{
				pos = 0;
				if (!ReadBuffer())
					return false;
			}
			char c = _buffer[pos];
			if (c == '\r' && _delimiter != '\r')
			{
				pos++;
				if (pos < _bufferLength)
				{
					if (_buffer[pos] == '\n')
						pos++;
				}
				else
				{
					if (ReadBuffer())
					{
						if (_buffer[0] == '\n')
							pos = 1;
						else
							pos = 0;
					}
				}
				if (pos >= _bufferLength)
				{
					ReadBuffer();
					pos = 0;
				}
				return true;
			}
			else if (c == '\n')
			{
				pos++;
				if (pos >= _bufferLength)
				{
					ReadBuffer();
					pos = 0;
				}
				return true;
			}
			return false;
		}
private bool ParseNewLine ( ref int pos ) { Debug . Assert ( pos <= _bufferLength ) ; if ( pos == _bufferLength ) { pos = 0 ; if ( ! ReadBuffer ( ) ) return false ; } char c = _buffer [ pos ] ; if ( c == ' \r ' && _delimiter != ' \r ' ) { pos ++ ; if ( pos < _bufferLength ) { if ( _buffer [ pos ] == ' \n ' ) pos ++ ; } else { if ( ReadBuffer ( ) ) { if ( _buffer [ 0 ] == ' \n ' ) pos = 1 ; else pos = 0 ; } } if ( pos >= _bufferLength ) { ReadBuffer ( ) ; pos = 0 ; } return true ; } else if ( c == ' \n ' ) { pos ++ ; if ( pos >= _bufferLength ) { ReadBuffer ( ) ; pos = 0 ; } return true ; } return false ; }
Parses a new line delimiter.
Parses a new line delimiter .
// Check if already at the end of the buffer // Treat \r as new line only if it's not the delimiter // Skip following \n (if there is one)
if a new line delimiter was found; otherwise, .
if a new line delimiter was found ; otherwise .
The instance has been disposed of.
The instance has been disposed of .
int
ref
pos
The starting position of the parsing. Will contain the resulting end position.
The starting position of the parsing . Will contain the resulting end position .