mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 10:20:14 +01:00
glib-aux: add nm_str_buf_append_unichar() helper
This commit is contained in:
parent
7065d75b91
commit
1556732ef0
1 changed files with 11 additions and 0 deletions
|
|
@ -207,6 +207,17 @@ nm_str_buf_append_c_hex(NMStrBuf *strbuf, char ch, gboolean upper_case)
|
|||
strbuf->_priv_str[strbuf->_priv_len++] = nm_hexchar((guchar) ch, upper_case);
|
||||
}
|
||||
|
||||
static inline void
|
||||
nm_str_buf_append_unichar(NMStrBuf *strbuf, gunichar wc)
|
||||
{
|
||||
int l;
|
||||
|
||||
nm_str_buf_maybe_expand(strbuf, 6 + 1, FALSE);
|
||||
l = g_unichar_to_utf8(wc, &strbuf->_priv_str[strbuf->_priv_len]);
|
||||
nm_assert(l > 0 && l <= 6);
|
||||
strbuf->_priv_len += (gsize) l;
|
||||
}
|
||||
|
||||
static inline void
|
||||
nm_str_buf_append_len(NMStrBuf *strbuf, const char *str, gsize len)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue