@@ -266,6 +266,9 @@ G_BEGIN_DECLS
266266 *
267267 * #GArrowDayOfWeekOptions is a class to customize the `day_of_week` function.
268268 *
269+ * #GArrowExtractRegexOptions is a class to customize the `extract_regex`
270+ * function.
271+ *
269272 * There are many functions to compute data on an array.
270273 */
271274
@@ -6992,6 +6995,102 @@ garrow_day_of_week_options_new(void)
69926995 return GARROW_DAY_OF_WEEK_OPTIONS (options);
69936996}
69946997
6998+ enum {
6999+ PROP_EXTRACT_REGEX_OPTIONS_PATTERN = 1 ,
7000+ };
7001+
7002+ G_DEFINE_TYPE (GArrowExtractRegexOptions,
7003+ garrow_extract_regex_options,
7004+ GARROW_TYPE_FUNCTION_OPTIONS)
7005+
7006+ static void
7007+ garrow_extract_regex_options_set_property(GObject *object,
7008+ guint prop_id,
7009+ const GValue *value,
7010+ GParamSpec *pspec)
7011+ {
7012+ auto options =
7013+ garrow_extract_regex_options_get_raw (GARROW_EXTRACT_REGEX_OPTIONS (object));
7014+
7015+ switch (prop_id) {
7016+ case PROP_EXTRACT_REGEX_OPTIONS_PATTERN:
7017+ options->pattern = g_value_get_string (value);
7018+ break ;
7019+ default :
7020+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7021+ break ;
7022+ }
7023+ }
7024+
7025+ static void
7026+ garrow_extract_regex_options_get_property (GObject *object,
7027+ guint prop_id,
7028+ GValue *value,
7029+ GParamSpec *pspec)
7030+ {
7031+ auto options =
7032+ garrow_extract_regex_options_get_raw (GARROW_EXTRACT_REGEX_OPTIONS (object));
7033+
7034+ switch (prop_id) {
7035+ case PROP_EXTRACT_REGEX_OPTIONS_PATTERN:
7036+ g_value_set_string (value, options->pattern .c_str ());
7037+ break ;
7038+ default :
7039+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7040+ break ;
7041+ }
7042+ }
7043+
7044+ static void
7045+ garrow_extract_regex_options_init (GArrowExtractRegexOptions *object)
7046+ {
7047+ auto priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE (object);
7048+ priv->options = static_cast <arrow::compute::FunctionOptions *>(
7049+ new arrow::compute::ExtractRegexOptions ());
7050+ }
7051+
7052+ static void
7053+ garrow_extract_regex_options_class_init (GArrowExtractRegexOptionsClass *klass)
7054+ {
7055+ auto gobject_class = G_OBJECT_CLASS (klass);
7056+
7057+ gobject_class->set_property = garrow_extract_regex_options_set_property;
7058+ gobject_class->get_property = garrow_extract_regex_options_get_property;
7059+
7060+ arrow::compute::ExtractRegexOptions options;
7061+
7062+ GParamSpec *spec;
7063+ /* *
7064+ * GArrowExtractRegexOptions:pattern:
7065+ *
7066+ * Regular expression with named capture fields.
7067+ *
7068+ * Since: 23.0.0
7069+ */
7070+ spec = g_param_spec_string (" pattern" ,
7071+ " Pattern" ,
7072+ " Regular expression with named capture fields" ,
7073+ options.pattern .c_str (),
7074+ static_cast <GParamFlags>(G_PARAM_READWRITE));
7075+ g_object_class_install_property (gobject_class,
7076+ PROP_EXTRACT_REGEX_OPTIONS_PATTERN,
7077+ spec);
7078+ }
7079+
7080+ /* *
7081+ * garrow_extract_regex_options_new:
7082+ *
7083+ * Returns: A newly created #GArrowExtractRegexOptions.
7084+ *
7085+ * Since: 23.0.0
7086+ */
7087+ GArrowExtractRegexOptions *
7088+ garrow_extract_regex_options_new (void )
7089+ {
7090+ auto options = g_object_new (GARROW_TYPE_EXTRACT_REGEX_OPTIONS, NULL );
7091+ return GARROW_EXTRACT_REGEX_OPTIONS (options);
7092+ }
7093+
69957094G_END_DECLS
69967095
69977096arrow::Result<arrow::FieldRef>
@@ -7150,6 +7249,11 @@ garrow_function_options_new_raw(const arrow::compute::FunctionOptions *arrow_opt
71507249 static_cast <const arrow::compute::DayOfWeekOptions *>(arrow_options);
71517250 auto options = garrow_day_of_week_options_new_raw (arrow_day_of_week_options);
71527251 return GARROW_FUNCTION_OPTIONS (options);
7252+ } else if (arrow_type_name == " ExtractRegexOptions" ) {
7253+ const auto arrow_extract_regex_options =
7254+ static_cast <const arrow::compute::ExtractRegexOptions *>(arrow_options);
7255+ auto options = garrow_extract_regex_options_new_raw (arrow_extract_regex_options);
7256+ return GARROW_FUNCTION_OPTIONS (options);
71537257 } else {
71547258 auto options = g_object_new (GARROW_TYPE_FUNCTION_OPTIONS, NULL );
71557259 return GARROW_FUNCTION_OPTIONS (options);
@@ -7772,3 +7876,20 @@ garrow_day_of_week_options_get_raw(GArrowDayOfWeekOptions *options)
77727876 return static_cast <arrow::compute::DayOfWeekOptions *>(
77737877 garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
77747878}
7879+
7880+ GArrowExtractRegexOptions *
7881+ garrow_extract_regex_options_new_raw (
7882+ const arrow::compute::ExtractRegexOptions *arrow_options)
7883+ {
7884+ return GARROW_EXTRACT_REGEX_OPTIONS (g_object_new (GARROW_TYPE_EXTRACT_REGEX_OPTIONS,
7885+ " pattern" ,
7886+ arrow_options->pattern .c_str (),
7887+ NULL ));
7888+ }
7889+
7890+ arrow::compute::ExtractRegexOptions *
7891+ garrow_extract_regex_options_get_raw (GArrowExtractRegexOptions *options)
7892+ {
7893+ return static_cast <arrow::compute::ExtractRegexOptions *>(
7894+ garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
7895+ }
0 commit comments