// 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.Globalization; using System.Collections.Generic; using System.IO; namespace CsvHelper.Configuration { /// /// Configuration used for the . /// public interface IWriterConfiguration { /// /// Gets the size of the buffer /// used for parsing and writing CSV files. /// Default is 0x1000. /// int BufferSize { get; } /// /// The mode. /// See for more details. /// CsvMode Mode { get; } /// /// Gets the delimiter used to separate fields. /// Default is ','; /// string Delimiter { get; } /// /// Gets the character used to quote fields. /// Default is '"'. /// char Quote { get; } /// /// The character used to escape characters. /// Default is '"'. /// char Escape { get; } /// /// Gets the field trimming options. /// TrimOptions TrimOptions { get; } /// /// Gets the injection options. /// InjectionOptions InjectionOptions { get; } /// /// Gets the characters that are used for injection attacks. /// char[] InjectionCharacters { get; } /// /// Gets the character used to escape a detected injection. /// char InjectionEscapeCharacter { get; } /// /// The newline string to use. Default is \r\n (CRLF). /// When writing, this value is always used. /// When reading, this value is only used if explicitly set. If not set, /// the parser uses one of \r\n, \r, or \n. /// string NewLine { get; } /// /// A value indicating if was set. /// /// /// true if was set. false if is the default. /// bool IsNewLineSet { get; } /// /// Gets a function that is used to determine if a field should get quoted /// when writing. /// ShouldQuote ShouldQuote { get; } /// /// Gets the culture info used to read and write CSV files. /// CultureInfo CultureInfo { get; } /// /// Gets a value indicating if comments are allowed. /// True to allow commented out lines, otherwise false. /// bool AllowComments { get; } /// /// Gets the character used to denote /// a line that is commented out. Default is '#'. /// char Comment { get; } /// /// Gets a value indicating if the /// CSV file has a header record. /// Default is true. /// bool HasHeaderRecord { 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 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 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; } /// /// Gets a value indicating that during writing if a new /// object should be created when a reference member is null. /// True to create a new object and use it's defaults for the /// fields, or false to leave the fields empty for all the /// reference member's member. /// bool UseNewObjectForNullReferenceMembers { get; } /// /// Gets the comparer used to order the properties /// of dynamic objects when writing. The default is null, /// which will preserve the order the object properties /// were created with. /// IComparer DynamicPropertySort { get; } /// /// A value indicating if exception messages contain raw CSV data. /// true if exception contain raw CSV data, otherwise false. /// Default is true. /// bool ExceptionMessagesContainRawData { get; } /// /// Validates the configuration. /// void Validate(); } }