Example #1
0
        /// <summary>
        ///     Constructs a new instance of the <see cref="NeatParser" /> using a
        ///     <see cref="LayoutDecider" /> instance.
        /// </summary>
        /// <param name="reader">Reader</param>
        /// <param name="layoutDecider">Layout decider</param>
        /// <param name="options">Parser options</param>
        public NeatParser(TextReader reader, LayoutDecider layoutDecider,
                          NeatParserOptions options)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            if (layoutDecider == null)
            {
                throw new ArgumentNullException(nameof(layoutDecider));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            this.reader        = reader;
            this.layoutDecider = layoutDecider;
            this.options       = options;

            for (int i = 1; i <= options.SkipFirst; i++)
            {
                SkipRecord();
            }
        }
Example #2
0
 /// <summary>
 ///     Constructs a new instance of the <see cref="NeatParser" /> using a
 ///     <see cref="LayoutDecider" /> instance using the default options.
 /// </summary>
 /// <param name="reader">Reader</param>
 /// <param name="layoutDecider">layout decider</param>
 public NeatParser(TextReader reader, LayoutDecider layoutDecider)
     : this(reader, layoutDecider, new NeatParserOptions())
 {
 }