* garrow_codec_new: * @type: A #GArrowCompressionType. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: A newly created #GArrowCodec on success, %NULL on error. * * Since: 0.12.0 */
| 126 | * Since: 0.12.0 |
| 127 | */ |
| 128 | GArrowCodec * |
| 129 | garrow_codec_new(GArrowCompressionType type, GError **error) |
| 130 | { |
| 131 | auto arrow_type = garrow_compression_type_to_raw(type); |
| 132 | auto arrow_codec = arrow::util::Codec::Create(arrow_type); |
| 133 | if (garrow::check(error, arrow_codec, "[codec][new]")) { |
| 134 | std::shared_ptr<arrow::util::Codec> arrow_codec_shared = std::move(*arrow_codec); |
| 135 | return garrow_codec_new_raw(&arrow_codec_shared); |
| 136 | } else { |
| 137 | return NULL; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * garrow_codec_get_name: |
nothing calls this directly
no test coverage detected