mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-23 09:20:29 +01:00
shared: add nm_utils_escaped_tokens_escape_strbuf*() helpers
This commit is contained in:
parent
a5a5656582
commit
d83908b6a1
1 changed files with 28 additions and 0 deletions
|
|
@ -301,6 +301,34 @@ nm_str_buf_append_required_delimiter (NMStrBuf *strbuf,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Calls nm_utils_escaped_tokens_escape() on @str and appends the
|
||||
* result to @strbuf. */
|
||||
static inline void
|
||||
nm_utils_escaped_tokens_escape_strbuf (const char *str,
|
||||
const char *delimiters,
|
||||
NMStrBuf *strbuf)
|
||||
{
|
||||
gs_free char *str_to_free = NULL;
|
||||
|
||||
nm_assert (str);
|
||||
|
||||
nm_str_buf_append (strbuf,
|
||||
nm_utils_escaped_tokens_escape (str, delimiters, &str_to_free));
|
||||
}
|
||||
|
||||
/* Calls nm_utils_escaped_tokens_escape_unnecessary() on @str and appends the
|
||||
* string to @strbuf. */
|
||||
static inline void
|
||||
nm_utils_escaped_tokens_escape_strbuf_assert (const char *str,
|
||||
const char *delimiters,
|
||||
NMStrBuf *strbuf)
|
||||
{
|
||||
nm_str_buf_append (strbuf,
|
||||
nm_utils_escaped_tokens_escape_unnecessary (str, delimiters));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline gboolean
|
||||
nm_str_buf_is_initalized (NMStrBuf *strbuf)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue