Commit 4c10cad6 authored by Christian Persch's avatar Christian Persch

Add API to get the compile and match flags from a GRegex

Bug #616967.
parent 3d5ce406
......@@ -942,6 +942,8 @@ g_regex_get_pattern
g_regex_get_max_backref
g_regex_get_capture_count
g_regex_get_string_number
g_regex_get_compile_flags
g_regex_get_match_flags
g_regex_escape_string
g_regex_match_simple
g_regex_match
......
......@@ -326,6 +326,24 @@ need the #GRegex or the matched string.
@Returns:
<!-- ##### FUNCTION g_regex_get_compile_flags ##### -->
<para>
</para>
@regex:
@Returns:
<!-- ##### FUNCTION g_regex_get_match_flags ##### -->
<para>
</para>
@regex:
@Returns:
<!-- ##### FUNCTION g_regex_escape_string ##### -->
<para>
......
......@@ -1631,6 +1631,8 @@ g_regex_get_pattern
g_regex_get_max_backref
g_regex_get_capture_count
g_regex_get_string_number
g_regex_get_compile_flags
g_regex_get_match_flags
g_regex_escape_string
g_regex_match_simple
g_regex_match
......
......@@ -1267,6 +1267,42 @@ g_regex_get_capture_count (const GRegex *regex)
return value;
}
/**
* g_regex_get_compile_flags:
* @regex: a #GRegex
*
* Returns the compile options that @regex was created with.
*
* Returns: flags from #GRegexCompileFlags
*
* Since: 2.26
*/
GRegexCompileFlags
g_regex_get_compile_flags (GRegex *regex)
{
g_return_val_if_fail (regex != NULL, 0);
return regex->compile_opts;
}
/**
* g_regex_get_match_flags:
* @regex: a #GRegex
*
* Returns the match options that @regex was created with.
*
* Returns: flags from #GRegexMatchFlags
*
* Since: 2.26
*/
GRegexMatchFlags
g_regex_get_match_flags (GRegex *regex)
{
g_return_val_if_fail (regex != NULL, 0);
return regex->match_opts;
}
/**
* g_regex_match_simple:
* @pattern: the regular expression
......
......@@ -140,6 +140,9 @@ gint g_regex_get_string_number (const GRegex *regex,
gchar *g_regex_escape_string (const gchar *string,
gint length);
GRegexCompileFlags g_regex_get_compile_flags (GRegex *regex);
GRegexMatchFlags g_regex_get_match_flags (GRegex *regex);
/* Matching. */
gboolean g_regex_match_simple (const gchar *pattern,
const gchar *string,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment