using System;
using System.IO;
using Volpe.Cafe.IO.DSV;

namespace Volpe.Cafe.Logging
{
    /// <summary>
    /// Provides the class that supports reading of the various diagnostic and debugging logs.
    /// </summary>
    [Serializable]
    public class LogFileReader : DsvReader
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="LogFileReader"/> class for the specified file.
        /// </summary>
        /// <param name="path">The complete file path to read.</param>
        /// <inheritdoc cref="StreamReader(string)" path="/exception"/>
        public LogFileReader(string path) : base(path, LogFile.Delimiter, DsvFile.NullChar)
        {
            base.SkipBlankLines = false;
        }

        /// <summary>
        /// Gets or sets whether to skip blank lines when reading the log file. The default value is <c>false</c>.
        /// </summary>
        /// <remarks>
        /// If this value is <c>true</c>, blank lines will be skipped when reading data from the log file. If this
        /// value is <c>false</c>, blank lines will be parsed as a single element array containing an empty string;
        /// that is, return a value of: <c>string[] { string.Empty }</c>.
        /// </remarks>
        public new bool SkipBlankLines
        {
            get => base.SkipBlankLines;
            set => base.SkipBlankLines = value;
        }

    }
}
