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

Bug #616967.
This commit is contained in:
Christian Persch 2010-04-28 12:36:30 +02:00
parent 3d5ce40624
commit 4c10cad661
5 changed files with 61 additions and 0 deletions

View File

@ -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

View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -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,