virtual class util::CsvOutStream

sys::Obj
  std::OutStream
    std::ProxyOutStream
      util::CsvOutStream

@Js

CsvOutStream is used to write delimiter-separated values as specified by RFC 4180. Format details:

Also see CsvInStream.

delimiter

Int delimiter := 44

Delimiter character; defaults to comma.

isQuoteRequired

Bool isQuoteRequired(Str cell)

Return if the given cell string contains:

  • the configured delimiter
  • double quote " char
  • leading/trailing whitespace
  • newlines
make

new make(OutStream out)

Wrap the underlying output stream.

writeCell

virtual This writeCell(Str cell)

Write a single cell. If isQuoteRequired returns true, then quote it.

writeRow

virtual This writeRow(List<Str> row)

Write the row of cells with the configured delimiter. Also see writeCell.