util: Wrap g_regex_escape_string()
This commit is contained in:
parent
150252391f
commit
bcec9f35d5
@ -240,6 +240,21 @@ shell_util_translate_time_string (const char *str)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* shell_util_regex_escape:
|
||||||
|
* @str: a UTF-8 string to escape
|
||||||
|
*
|
||||||
|
* A wrapper around g_regex_escape_string() that takes its argument as
|
||||||
|
* \0-terminated string rather than a byte-array the confuses gjs.
|
||||||
|
*
|
||||||
|
* Returns: @str with all regex-special characters escaped
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
shell_util_regex_escape (const char *str)
|
||||||
|
{
|
||||||
|
return g_regex_escape_string (str, -1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* shell_write_string_to_stream:
|
* shell_write_string_to_stream:
|
||||||
* @stream: a #GOutputStream
|
* @stream: a #GOutputStream
|
||||||
|
@ -24,6 +24,8 @@ char *shell_util_format_date (const char *format,
|
|||||||
gint64 time_ms);
|
gint64 time_ms);
|
||||||
const char *shell_util_translate_time_string (const char *str);
|
const char *shell_util_translate_time_string (const char *str);
|
||||||
|
|
||||||
|
char *shell_util_regex_escape (const char *str);
|
||||||
|
|
||||||
gboolean shell_write_string_to_stream (GOutputStream *stream,
|
gboolean shell_write_string_to_stream (GOutputStream *stream,
|
||||||
const char *str,
|
const char *str,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
Loading…
Reference in New Issue
Block a user