Class

kantan.csv.ops

CsvSourceOps

Related Doc: package ops

Permalink

final class CsvSourceOps[A] extends AnyRef

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(Success(List(1, 2, 3)), Success(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(Success(List(1, 2, 3)), Success(List(4, 5, 6)))

Unsafe versions of these methods are also available, even if usually advised against.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CsvSourceOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CsvSourceOps(a: A)(implicit arg0: CsvSource[A])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val a: A

    Permalink
  5. def asCsvReader[B](conf: CsvConfiguration)(implicit arg0: HeaderDecoder[B], e: ReaderEngine): CsvReader[ReadResult[B]]

    Permalink

    Opens a CsvReader on the underlying resource.

    Opens a CsvReader on the underlying resource.

    For example:

    scala> import kantan.csv._
    
    scala> "1,2,3\n4,5,6".asCsvReader[List[Int]](rfc).toList
    res0: List[ReadResult[List[Int]]] = List(Success(List(1, 2, 3)), Success(List(4, 5, 6)))

    This is a convenience method only, and strictly equivalent to:

    scala> CsvSource[String].reader[List[Int]]("1,2,3\n4,5,6", rfc).toList
    res1: List[ReadResult[List[Int]]] = List(Success(List(1, 2, 3)), Success(List(4, 5, 6)))
    B

    type each row will be decoded as.

    conf

    CSV parsing behaviour.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def asUnsafeCsvReader[B](conf: CsvConfiguration)(implicit arg0: HeaderDecoder[B], e: ReaderEngine): CsvReader[B]

    Permalink

    Opens an unsafe CsvReader on the underlying resource.

    Opens an unsafe CsvReader on the underlying resource.

    For example:

    scala> import kantan.csv._
    
    scala> "1,2,3\n4,5,6".asUnsafeCsvReader[List[Int]](rfc).toList
    res0: List[List[Int]] = List(List(1, 2, 3), List(4, 5, 6))

    This is a convenience method only, and strictly equivalent to:

    scala> CsvSource[String].unsafeReader[List[Int]]("1,2,3\n4,5,6", rfc).toList
    res1: List[List[Int]] = List(List(1, 2, 3), List(4, 5, 6))
    B

    type each row will be decoded as.

    conf

    CSV parsing behaviour.

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def readCsv[C[_], B](conf: CsvConfiguration)(implicit arg0: HeaderDecoder[B], e: ReaderEngine, cbf: CanBuildFrom[Nothing, ReadResult[B], C[ReadResult[B]]]): C[ReadResult[B]]

    Permalink

    Reads the underlying resource as a CSV stream.

    Reads the underlying resource as a CSV stream.

    For example:

    scala> import kantan.csv._
    
    scala> "1,2,3\n4,5,6".readCsv[List, List[Int]](rfc)
    res0: List[ReadResult[List[Int]]] = List(Success(List(1, 2, 3)), Success(List(4, 5, 6)))

    This is a convenience method only, and strictly equivalent to:

    scala> CsvSource[String].read[List, List[Int]]("1,2,3\n4,5,6", rfc)
    res1: List[ReadResult[List[Int]]] = List(Success(List(1, 2, 3)), Success(List(4, 5, 6)))
    C

    type of the collection in which the decoded CSV data will be stored.

    B

    type each row will be decoded as.

    conf

    CSV parsing behaviour.

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. def unsafeReadCsv[C[_], B](conf: CsvConfiguration)(implicit arg0: HeaderDecoder[B], e: ReaderEngine, cbf: CanBuildFrom[Nothing, B, C[B]]): C[B]

    Permalink

    Reads the underlying resource as a CSV stream (unsafely).

    Reads the underlying resource as a CSV stream (unsafely).

    For example:

    scala> import kantan.csv._
    
    scala> "1,2,3\n4,5,6".unsafeReadCsv[List, List[Int]](rfc)
    res0: List[List[Int]] = List(List(1, 2, 3), List(4, 5, 6))

    This is a convenience method only, and strictly equivalent to:

    scala> CsvSource[String].unsafeRead[List, List[Int]]("1,2,3\n4,5,6", rfc)
    res1: List[List[Int]] = List(List(1, 2, 3), List(4, 5, 6))
    C

    type of the collection in which the decoded CSV data will be stored.

    B

    type each row will be decoded as.

    conf

    CSV parsing behaviour.

  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def asCsvReader[B](sep: Char, header: Boolean)(implicit arg0: HeaderDecoder[B], e: ReaderEngine): CsvReader[ReadResult[B]]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.1.18) use asCsvReader(CsvConfiguration) instead

  2. def asUnsafeCsvReader[B](sep: Char, header: Boolean)(implicit arg0: HeaderDecoder[B], e: ReaderEngine): CsvReader[B]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.1.18) use asUnsafeCsvReader(CsvConfiguration) instead

  3. def readCsv[C[_], B](sep: Char, header: Boolean)(implicit arg0: HeaderDecoder[B], e: ReaderEngine, cbf: CanBuildFrom[Nothing, ReadResult[B], C[ReadResult[B]]]): C[ReadResult[B]]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.1.18) use readCsv(CsvConfiguration) instead

  4. def unsafeReadCsv[C[_], B](sep: Char, header: Boolean)(e: ReaderEngine, cbf: CanBuildFrom[Nothing, B, C[B]])(implicit arg0: HeaderDecoder[B]): C[B]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.1.18) use unsafeReadCsv(CsvConfiguration) instead

Inherited from AnyRef

Inherited from Any

Ungrouped