Amazon.KinesisTap.Core/Parsers/DelimitedLogParserBase.cs
/// <summary>
/// Get field index map from a stream up to the position
/// </summary>
/// <param name="fs"></param>
/// <param name="position"></param>
/// <returns></returns>
Get field index map from a stream up to the position
Get field index map from a stream up to the position
protected IDictionary<string, int> GetFieldIndexMap(StreamReader sr, DelimitedLogContext context)
        {
            IDictionary<string, int> fieldIndexMap = null;
            while (!sr.EndOfStream && sr.BaseStream.Position < context.Position)
            {
                string line = sr.ReadLine();
                context.LineNumber++;
                if (IsHeader(line))
                {
                    fieldIndexMap = GetFieldIndexMap(line);
                }
            }
            return fieldIndexMap;
        }
protected IDictionary < string , int > GetFieldIndexMap ( StreamReader sr , DelimitedLogContext context ) { IDictionary < string , int > fieldIndexMap = null ; while ( ! sr . EndOfStream && sr . BaseStream . Position < context . Position ) { string line = sr . ReadLine ( ) ; context . LineNumber ++ ; if ( IsHeader ( line ) ) { fieldIndexMap = GetFieldIndexMap ( line ) ; } } return fieldIndexMap ; }
Get field index map from a stream up to the position
Get field index map from a stream up to the position
None
sr
StreamReader
context
DelimitedLogContext
fs
None
position
None