C# 클래스 Kajabity.Tools.Csv.CsvWriter

A class for writing a table of data to an output stream using the Comma Separated Value (CSV) format.
파일 보기 프로젝트 열기: Kajabity/Kajabity-Tools 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
QuoteLimit int

공개 메소드들

메소드 설명
CsvWriter ( Stream stream ) : System.IO

Construct a new to output CSV data to the stream provided.

WriteAll ( string records ) : void

Write all records to the output CSV stream.

WriteField ( string field ) : void

Write a single field to the output stream appending a separator if it is not the first field on the line.

WriteRecord ( string record ) : void

Writes a single record to the output stream appending a new line to the end of the previous line if this is not the first record.

비공개 메소드들

메소드 설명
WriteFieldEscaped ( string field ) : void

This is the worker method that writes fields to the file and quotes them if necessary. If the field is null or an empty string, nothing is written (not even quoted).

메소드 상세

CsvWriter() 공개 메소드

Construct a new to output CSV data to the stream provided.
public CsvWriter ( Stream stream ) : System.IO
stream System.IO.Stream CSV data will be written to this stream.
리턴 System.IO

WriteAll() 공개 메소드

Write all records to the output CSV stream.
public WriteAll ( string records ) : void
records string an array of string arrays containing the /// records to be written. Each string becomes a single comma separated /// field, each array of strings becomes a record.
리턴 void

WriteField() 공개 메소드

Write a single field to the output stream appending a separator if it is not the first field on the line.
public WriteField ( string field ) : void
field string
리턴 void

WriteRecord() 공개 메소드

Writes a single record to the output stream appending a new line to the end of the previous line if this is not the first record.
public WriteRecord ( string record ) : void
record string The record to be written - an array of string fields.
리턴 void

프로퍼티 상세

QuoteLimit 공개적으로 프로퍼티

The class checks each field to see if it needs to be quoted - unless the string is longer than quoteLimit. Used for performance. Set to 0 to ensure all except empty or null fields are quoted.
public int QuoteLimit
리턴 int