// Copyright 2009-2022 Josh Close // This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. // See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. // https://github.com/JoshClose/CsvHelper using System; using System.Globalization; using CsvHelper.TypeConversion; using System.Reflection; using System.Collections.Generic; using System.IO; namespace CsvHelper.Configuration { /// /// Configuration used for the . /// public interface IReaderConfiguration : IParserConfiguration { /// /// Gets a value indicating if the /// CSV file has a header record. /// Default is true. /// bool HasHeaderRecord { get; } /// /// Gets the function that is called when a header validation check is ran. The default function /// will throw a if there is no header for a given member mapping. /// You can supply your own function to do other things like logging the issue instead of throwing an exception. /// HeaderValidated HeaderValidated { get; } /// /// Gets the function that is called when a missing field is found. The default function will /// throw a . You can supply your own function to do other things /// like logging the issue instead of throwing an exception. /// MissingFieldFound MissingFieldFound { get; } /// /// Gets the function that is called when a reading exception occurs. /// The default function will re-throw the given exception. If you want to ignore /// reading exceptions, you can supply your own function to do other things like /// logging the issue. /// ReadingExceptionOccurred ReadingExceptionOccurred { get; } /// /// Prepares the header field for matching against a member name. /// The header field and the member name are both ran through this function. /// You should do things like trimming, removing whitespace, removing underscores, /// and making casing changes to ignore case. /// PrepareHeaderForMatch PrepareHeaderForMatch { get; } /// /// Determines if constructor parameters should be used to create /// the class instead of the default constructor and members. /// ShouldUseConstructorParameters ShouldUseConstructorParameters { get; } /// /// Chooses the constructor to use for constructor mapping. /// GetConstructor GetConstructor { get; } /// /// Gets the name to use for the property of the dynamic object. /// GetDynamicPropertyName GetDynamicPropertyName { get; } /// /// Gets a value indicating whether references /// should be ignored when auto mapping. true to ignore /// references, otherwise false. Default is false. /// bool IgnoreReferences { get; } /// /// Gets the callback that will be called to /// determine whether to skip the given record or not. /// ShouldSkipRecord? ShouldSkipRecord { get; } /// /// Gets a value indicating if private /// member should be read from and written to. /// true to include private member, otherwise false. Default is false. /// bool IncludePrivateMembers { get; } /// /// Gets a callback that will return the prefix for a reference header. /// ReferenceHeaderPrefix ReferenceHeaderPrefix { get; } /// /// Gets a value indicating whether changes in the column /// count should be detected. If true, a /// will be thrown if a different column count is detected. /// bool DetectColumnCountChanges { get; } /// /// Gets the member types that are used when auto mapping. /// MemberTypes are flags, so you can choose more than one. /// Default is Properties. /// MemberTypes MemberTypes { get; } } }