Engines/FlatRedBallXNA/FlatRedBall/IO/Csv/CsvReader.cs
/// <summary>
/// Handles a missing field error.
/// </summary>
/// <param name="value">The partially parsed value, if available.</param>
/// <param name="fieldIndex">The missing field index.</param>
/// <param name="currentPosition">The current position in the raw data.</param>
/// <returns>
/// The resulting value according to <see cref="M:MissingFieldAction"/>.
/// If the action is set to <see cref="T:MissingFieldAction.TreatAsParseError"/>,
/// then the parse error will be handled according to <see cref="DefaultParseErrorAction"/>.
/// </returns>
Handles a missing field error.
Handles a missing field error .
private string HandleMissingField(string value, int fieldIndex, ref int currentPosition)
		{
			if (fieldIndex < 0 || fieldIndex >= _fieldCount)
				throw new ArgumentOutOfRangeException("fieldIndex is wrong: " + fieldIndex);
			_missingFieldsFlag = true;
			for (int i = fieldIndex + 1; i < _fieldCount; i++)
				_fields[i] = null;
			if (value != null)
				return value;
			else
			{
				switch (_missingFieldAction)
				{
					case MissingFieldAction.ParseError:
                        HandleParseError(new Exception(), ref currentPosition);
                        return value;
					case MissingFieldAction.ReplaceByEmpty:
						return string.Empty;
					case MissingFieldAction.ReplaceByNull:
						return null;
					default:
						throw new NotSupportedException(
                            "Missing field action not supported");
				}
			}
		}
private string HandleMissingField ( string value , int fieldIndex , ref int currentPosition ) { if ( fieldIndex < 0 || fieldIndex >= _fieldCount ) throw new ArgumentOutOfRangeException ( " " + fieldIndex ) ; _missingFieldsFlag = true ; for ( int i = fieldIndex + 1 ; i < _fieldCount ; i ++ ) _fields [ i ] = null ; if ( value != null ) return value ; else { switch ( _missingFieldAction ) { case MissingFieldAction . ParseError : HandleParseError ( new Exception ( ) , ref currentPosition ) ; return value ; case MissingFieldAction . ReplaceByEmpty : return string . Empty ; case MissingFieldAction . ReplaceByNull : return null ; default : throw new NotSupportedException ( " " ) ; } } }
Handles a missing field error.
Handles a missing field error .
//string.Format(CultureInfo.InvariantCulture, ExceptionMessage.MissingFieldActionNotSupported, _missingFieldAction));
The resulting value according to .
If the action is set to ,
then the parse error will be handled according to .
The resulting value according to . If the action is set to then the parse error will be handled according to .
value
string
The partially parsed value, if available.
The partially parsed value if available .
fieldIndex
int
The missing field index.
The missing field index .
int
ref
currentPosition
The current position in the raw data.
The current position in the raw data .