package ops
- Source
- package.scala
- Alphabetic
- By Inheritance
- ops
- ToCsvRowReadingOps
- ToCsvRowWritingOps
- ToCsvCellDecoderOps
- ToCsvCellEncoderOps
- ToCsvRowDecoderOps
- ToCsvRowEncoderOps
- ToCsvRowsOps
- ToCsvSourceOps
- ToCsvSinkOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class CsvCellDecoderOps extends AnyRef
Provides syntax for decoding CSV cells as values.
Provides syntax for decoding CSV cells as values.
Importing
kantan.csv.ops._
will add the following methods toString
: - final class CsvCellEncoderOps[A] extends AnyRef
Provides syntax for encoding values as CSV cells.
Provides syntax for encoding values as CSV cells.
Importing
kantan.csv.ops._
will add asCsvCell to any typeA
such that there exists an implicitCellDecoder[A]
in scope. - final class CsvRowDecoderOps extends AnyRef
Provides syntax for decoding CSV rows as values.
Provides syntax for decoding CSV rows as values.
Importing
kantan.csv.ops._
will add the following methods toSeq[String]
: - final class CsvRowEncoderOps[A] extends AnyRef
Provides syntax for encoding values as CSV rows.
Provides syntax for encoding values as CSV rows.
Importing
kantan.csv.ops._
will add asCsvRow to any typeA
such that there exists an implicitRowEncoder[A]
in scope. - final class CsvRowReadingOps[A] extends AnyRef
Provides syntax for decoding a string as a CSV row.
- final class CsvRowWritingOps[A] extends AnyRef
Provides syntax for encoding single CSV rows as a string.
Provides syntax for encoding single CSV rows as a string.
Writing a single row as a
String
is a surprisingly recurrent feature request. This is how to do it:scala> import kantan.csv.rfc scala> (1, 2, 3).writeCsvRow(rfc) res0: String = 1,2,3
- final class CsvRowsOps[A] extends AnyRef
Provides syntax for turning collections into CSV strings.
- final class CsvSinkOps[A] extends VersionSpecificCsvSinkOps[A]
Provides useful syntax for types that have implicit instances of CsvSink in scope.
Provides useful syntax for types that have implicit instances of CsvSink in scope.
The most common use case is to turn a value into a CsvWriter:
val f: java.io.File = ??? f.asCsvWriter[List[Int]](',', true)
A slightly less common use case is encode an entire collection to CSV:
val f: java.io.File = ??? f.writeCsv[List[Int]](List(List(1, 2, 3), List(4, 5, 6)), ',', true)
- final class CsvSourceOps[A] extends AnyRef
Provides useful syntax for types that have implicit instances of CsvSource in scope.
Provides useful syntax for types that have implicit instances of CsvSource in scope.
The most common use case is to turn a value into a CsvReader:
scala> import kantan.csv._ scala> "1,2,3\n4,5,6".asCsvReader[List[Int]](rfc).toList res0: List[ReadResult[List[Int]]] = List(Right(List(1, 2, 3)), Right(List(4, 5, 6)))
A slightly less common use case is to load an entire CSV file in memory:
scala> "1,2,3\n4,5,6".readCsv[List, List[Int]](rfc) res1: List[ReadResult[List[Int]]] = List(Right(List(1, 2, 3)), Right(List(4, 5, 6)))
Unsafe versions of these methods are also available, even if usually advised against.
- trait ToCsvCellDecoderOps extends AnyRef
- trait ToCsvCellEncoderOps extends AnyRef
- trait ToCsvRowDecoderOps extends AnyRef
- trait ToCsvRowEncoderOps extends AnyRef
- trait ToCsvRowReadingOps extends AnyRef
- trait ToCsvRowWritingOps extends AnyRef
- trait ToCsvRowsOps extends AnyRef
- trait ToCsvSinkOps extends AnyRef
- trait ToCsvSourceOps extends AnyRef
- trait VersionSpecificCsvSinkOps[A] extends AnyRef
Value Members
- implicit def toCsvCellDecoderOps(s: String): CsvCellDecoderOps
- Definition Classes
- ToCsvCellDecoderOps
- implicit def toCsvCellEncoderOps[A](a: A)(implicit arg0: CellEncoder[A]): CsvCellEncoderOps[A]
- Definition Classes
- ToCsvCellEncoderOps
- implicit def toCsvInputOps[A](a: A)(implicit arg0: CsvSource[A]): CsvSourceOps[A]
- Definition Classes
- ToCsvSourceOps
- implicit def toCsvOutputOps[A](a: A)(implicit arg0: CsvSink[A]): CsvSinkOps[A]
- Definition Classes
- ToCsvSinkOps
- implicit def toCsvRowDecoderOps(ss: Seq[String]): CsvRowDecoderOps
- Definition Classes
- ToCsvRowDecoderOps
- implicit def toCsvRowEncoderOps[A](a: A)(implicit arg0: HeaderEncoder[A]): CsvRowEncoderOps[A]
- Definition Classes
- ToCsvRowEncoderOps
- implicit def toCsvRowReadingOps[A](a: A)(implicit arg0: CsvSource[A]): CsvRowReadingOps[A]
- Definition Classes
- ToCsvRowReadingOps
- implicit def toCsvRowWritingOps[A](a: A)(implicit arg0: RowEncoder[A]): CsvRowWritingOps[A]
- Definition Classes
- ToCsvRowWritingOps
- implicit def toCsvRowsOps[A](as: IterableOnce[A])(implicit arg0: HeaderEncoder[A]): CsvRowsOps[A]
- Definition Classes
- ToCsvRowsOps
- object cellDecoder extends ToCsvCellDecoderOps
- object cellEncoder extends ToCsvCellEncoderOps
- object csvRows extends ToCsvRowsOps
- object rowDecoder extends ToCsvRowDecoderOps
- object rowEncoder extends ToCsvRowEncoderOps
- object sink extends ToCsvSinkOps
- object source extends ToCsvSourceOps