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

namespace Volpe.Cafe.IO.CSV
{
    /// <summary>
    /// Represents a reader that can read data from a comma-separated values (CSV) file.
    /// </summary>
    /// <inheritdoc cref="CsvFile" path="/remarks"/>
    [Serializable]
    public class CsvReader : DsvReader
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CsvReader"/> class for the specified file.
        /// </summary>
        /// <param name="path">The complete file path to read.</param>
        /// <inheritdoc cref="StreamReader(string)" path="/exception"/>
        public CsvReader(string path) : base(path, CsvFile.Delimiter) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="CsvReader"/> class for the specified file.
        /// </summary>
        /// <param name="path">The complete file path to read.</param>
        /// <param name="escapeChar">
        ///     An escape character used for enclosing fields that include special characters.
        /// </param>
        /// <inheritdoc cref="StreamReader(string)" path="/exception"/>
        protected CsvReader(string path, char escapeChar) : base(path, CsvFile.Delimiter, escapeChar) { }

    }
}
