/// <summary> /// Initializes a new instance of the <see cref="CsvWriter" /> class. /// </summary> /// <param name="stringWriter">The string writer.</param> /// <param name="columnSeparator">The column separator.</param> /// <param name="rowSeparator">The row separator.</param> /// <param name="fieldDelimiter">The field delimiter.</param> /// <param name="writeChunkSize"> /// Size of the write chunk. (minimal and /// default value is 1) /// </param> /// <param name="quotingBehavior">The quoting behavior.</param> public CsvWriter(StringWriter stringWriter, char columnSeparator, string rowSeparator, char?fieldDelimiter, int writeChunkSize, QuotingBehavior quotingBehavior) : this((TextWriter)stringWriter, columnSeparator, rowSeparator, fieldDelimiter, writeChunkSize, quotingBehavior) { }
/// <summary> /// Initializes the CsvWriter. /// </summary> /// <param name="textWriter">The text writer.</param> /// <param name="columnSeparator">Delimiter e.g. ';'</param> /// <param name="rowSeparator"> /// Row Delimiter, e.g. Environment.NewLine /// </param> /// <param name="fieldDelimiter">e.g. " or just NULL</param> /// <param name="writeChunkSize"> /// Size of the write chunk. (minimal and /// default value is 1) /// </param> /// <param name="quotingBehavior">The quoting behavior.</param> public CsvWriter(TextWriter textWriter, char columnSeparator, string rowSeparator, char?fieldDelimiter, int writeChunkSize, QuotingBehavior quotingBehavior) : this(textWriter, columnSeparator, rowSeparator, fieldDelimiter) { SetChunkAndBufferSize(writeChunkSize); this.quotingBehavior = quotingBehavior; }
/// <summary> /// Initializes a new instance of the <see cref="CsvWriter" /> class. /// </summary> /// <param name="stringBuilder">The string builder.</param> /// <param name="columnSeparator">The column separator.</param> /// <param name="rowSeparator">The row separator.</param> /// <param name="fieldDelimiter">The field delimiter.</param> /// <param name="writeChunkSize"> /// Size of the write chunk. (minimal and /// default value is 1) /// </param> /// <param name="quotingBehavior">The quoting behavior.</param> public CsvWriter(StringBuilder stringBuilder, char columnSeparator, string rowSeparator, char?fieldDelimiter, int writeChunkSize, QuotingBehavior quotingBehavior) : this(new StringWriter(stringBuilder), columnSeparator, rowSeparator, fieldDelimiter, writeChunkSize, quotingBehavior) { closeStream = true; }
/// <summary> /// Initializes the CsvWriter. /// Use CsvWriter in using(){} block if possible (otherwise the dispose method (which closes the file handle) is only /// called by the garbage collector which may take a while). /// </summary> /// <param name="filePathAndName">The path and name of the file.</param> /// <param name="columnSeparator">Delimiter e.g. ';'</param> /// <param name="rowSeparator"> /// Row Delimiter, e.g. Environment.NewLine /// </param> /// <param name="fieldDelimiter">e.g. " or just NULL</param> /// <param name="writeChunkSize"> /// Size of the read chunk. (minimal value /// is <paramref name="rowSeparator" />.length and is automatically /// assigned if the given value was too small). The bufferSize is /// automatically allocated in any case. It will be /// <paramref name="writeChunkSize" />Size of the write chunk. (minimal /// and default value is 1) /// </param> /// <param name="isAppendMode"> /// if set to <c>true</c> [is append mode]. /// </param> /// <param name="encoding">The encoding.</param> /// <param name="quotingBehavior">The quoting behavior.</param> public CsvWriter(string filePathAndName, char columnSeparator, string rowSeparator, char?fieldDelimiter, int writeChunkSize, bool isAppendMode, Encoding encoding, QuotingBehavior quotingBehavior) : this( filePathAndName, columnSeparator, rowSeparator, fieldDelimiter, isAppendMode, encoding) { SetChunkAndBufferSize(writeChunkSize); this.quotingBehavior = quotingBehavior; }
public CsvWriterBuilder QuotingBehavior(QuotingBehavior behavior) { quotingBehavior = behavior; return(this); }