An object that provides type class support for rendering data as CSV (Comma-Separated Values).
The CsvRenderer object is designed to define implicit instances of CsvRenderer for specific types, allowing those types to be rendered to a CSV format string. It relies on the Renderer type class, which generalizes rendering objects of type T into objects of type O (in this case, strings).
This object can include predefined implicit renderers (e.g., Row renderer) that leverage attributes (Map[String, String]) to modify the output or handle special behaviors for CSV attributes.
Attributes
- Companion
- trait
- Graph
-
- Supertypes
- Self type
-
CsvRenderer.type
Members list
Type members
Classlikes
Implicit object that provides a CSV rendering implementation for the Row class.
Implicit object that provides a CSV rendering implementation for the Row class.
This object extends the CsvRenderer type class for Row, enabling rows to be rendered as CSV strings. The default behavior concatenates the row elements (ws) into a single string, separated by the delimiter defined in the implicit CsvAttributes.
Attributes
- See also
-
CsvRenderer
Row
- Supertypes
- Self type
-
CsvRendererRow.type
Value members
Concrete methods
Method to derive a CsvRenderer for a case class T, so that case class T(...) derives CsvRenderer works. This replaces the renderer1 ... renderer19 methods of 1.x, and has no limit on the number of fields. A field whose type is itself a case class, and which has no CsvRenderer of its own, is derived in turn.
Method to derive a CsvRenderer for a case class T, so that case class T(...) derives CsvRenderer works. This replaces the renderer1 ... renderer19 methods of 1.x, and has no limit on the number of fields. A field whose type is itself a case class, and which has no CsvRenderer of its own, is derived in turn.
NOTE: for a case class defined inside a method, see the NOTE on CellParser.derived.
Type parameters
- T
-
a case class.
Value parameters
- ca
-
the CsvAttributes.
- m
-
the Mirror of T.
Attributes
- Returns
-
a CsvRenderer[T].
Inherited methods
Method to return a CsvRenderer[Option[T]] for a T which has several columns (e.g. a case class). None is rendered as the right number of empty cells, so that the columns which follow stay aligned. Use this together with CsvGenerators.optionProductGenerator. (optionRenderer renders None as just one cell.)
Method to return a CsvRenderer[Option[T]] for a T which has several columns (e.g. a case class). None is rendered as the right number of empty cells, so that the columns which follow stay aligned. Use this together with CsvGenerators.optionProductGenerator. (optionRenderer renders None as just one cell.)
Type parameters
- T
-
the underlying type.
Value parameters
- ca
-
the CsvAttributes.
- g
-
the CsvGenerator[T], which determines how many columns a T has.
- r
-
the CsvRenderer[T].
Attributes
- Returns
-
a CsvRenderer[Option[T]].
- Inherited from:
- CsvRenderers
Method to return a CsvRenderer[ Option[T] ].
Method to return a CsvRenderer[ Option[T] ].
Type parameters
- T
-
the underlying type of the first parameter of the input to the render method.
Value parameters
- ca
-
the (implicit) CsvAttributes.
Attributes
- Returns
-
a CsvRenderer[ Option[T] ].
- Inherited from:
- CsvRenderers
Method to return a CsvRenderer[RawRow].
Method to return a CsvRenderer[RawRow].
Value parameters
- ca
-
the (implicit) CsvAttributes.
Attributes
- Returns
-
a CsvRenderer[RawRow].
- Inherited from:
- CsvRenderers
Method to return a CsvRenderer[ Seq[T] ].
Method to return a CsvRenderer[ Seq[T] ].
Type parameters
- T
-
the underlying type of the first parameter of the input to the render method.
Value parameters
- ca
-
the (implicit) CsvAttributes.
Attributes
- Returns
-
a CsvRenderer[ Seq[T] ]
- Inherited from:
- CsvRenderers
Method to return a CsvRenderer[T] which does not output a T at all, only a number of delimiters according to the value of alignment.
Method to return a CsvRenderer[T] which does not output a T at all, only a number of delimiters according to the value of alignment.
Type parameters
- T
-
the type of the parameter to the render method.
Value parameters
- alignment
-
(defaults to 1): one more than the number of delimiters to output. If you are skipping a Product (such as a case class instance), then you should carefully count up how many (nested) elements to skip. So, for example, if you are skipping a Product with three members, you would set alignment = 3, even though you only want to output 2 delimiters.
- ca
-
the (implicit) CsvAttributes.
Attributes
- Returns
-
a CsvRenderer[T].
- Inherited from:
- CsvRenderers
Givens
Givens
Implicit object that provides a CSV rendering implementation for the Row class.
Implicit object that provides a CSV rendering implementation for the Row class.
This object extends the CsvRenderer type class for Row, enabling rows to be rendered as CSV strings. The default behavior concatenates the row elements (ws) into a single string, separated by the delimiter defined in the implicit CsvAttributes.
Attributes
- See also
-
CsvRenderer
Row