* garrow_csv_writer_new: * @sink: The output of the writer. * @schema: The schema of the writer. * @options: (nullable): Options for serialization. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable): A newly created #GArrowCSVWriter * or %NULL on error. * * Since: 23.0.0 */
| 627 | * Since: 23.0.0 |
| 628 | */ |
| 629 | GArrowCSVWriter * |
| 630 | garrow_csv_writer_new(GArrowOutputStream *sink, |
| 631 | GArrowSchema *schema, |
| 632 | GArrowCSVWriteOptions *options, |
| 633 | GError **error) |
| 634 | { |
| 635 | auto arrow_sink = garrow_output_stream_get_raw(sink); |
| 636 | auto arrow_schema = garrow_schema_get_raw(schema); |
| 637 | arrow::csv::WriteOptions arrow_write_options; |
| 638 | if (options) { |
| 639 | auto arrow_write_options_ptr = garrow_csv_write_options_get_raw(options); |
| 640 | arrow_write_options = *arrow_write_options_ptr; |
| 641 | } else { |
| 642 | arrow_write_options = arrow::csv::WriteOptions::Defaults(); |
| 643 | } |
| 644 | auto arrow_writer_result = |
| 645 | arrow::csv::MakeCSVWriter(arrow_sink, arrow_schema, arrow_write_options); |
| 646 | if (garrow::check(error, arrow_writer_result, "[csv-writer][new]")) { |
| 647 | auto arrow_writer = *arrow_writer_result; |
| 648 | return garrow_csv_writer_new_raw(&arrow_writer); |
| 649 | } else { |
| 650 | return nullptr; |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | G_END_DECLS |
| 655 |
nothing calls this directly
no test coverage detected