public static IndentedWriter Indented(this TextWriter writer) { writer.AssertNotNull(); var indented = writer as IndentedWriter; return(indented ?? new IndentedWriter(writer)); }
/// <summary> /// Constructs and initialises an instance of <c>CsvWriter</c> based on the information provided. /// </summary> /// <param name="writer"> /// The <see cref="TextWriter"/> to which CSV data will be written. /// </param> public CsvWriter(TextWriter writer) { writer.AssertNotNull("writer"); m_writer = writer; m_valueSeparator = CsvParser.DefaultValueSeparator; m_valueDelimiter = CsvParser.DefaultValueDelimiter; m_valueBuffer = new char[128]; }
/// <summary> /// Initializes a new instance of the CsvWriter class. /// </summary> /// <param name="textWriter"> /// The target for the CSV data. /// </param> /// <param name="leaveOpen"> /// If <see langword="true"/>, <paramref name="textWriter"/> will not be disposed when this <c>CsvWriter</c> is disposed. /// </param> public CsvWriter(TextWriter textWriter, bool leaveOpen) { textWriter.AssertNotNull("textWriter"); this.textWriter = textWriter; this.leaveOpen = leaveOpen; this.valueBuilder = new StringBuilder(128); this.bufferBuilder = new StringBuilder(2048); this.valueSeparator = Constants.DefaultValueSeparator; this.valueDelimiter = Constants.DefaultValueDelimiter; }
public Eavesdropper(TextWriter channel, TextWriter sink) : base(CultureInfo.InvariantCulture) { Channel = channel.AssertNotNull(); Sink = sink.AssertNotNull(); }