base: Implement appended-error concat

This commit is contained in:
Nicolas Williams
2025-10-27 18:19:40 -05:00
parent e74f785367
commit a7bba71ab8
2 changed files with 41 additions and 2 deletions

View File

@@ -189,6 +189,25 @@ heim_string_create_with_format(const char *fmt, ...)
return s;
}
/**
* Concatenate two strings
*
* @param left
* @param sep
* @param right
*
* @return string object
*/
heim_string_t
heim_string_concat(heim_string_t left, const char *sep, heim_string_t right)
{
const char *sleft = heim_string_get_utf8(left);
const char *sright = heim_string_get_utf8(right);
return heim_string_create_with_format("%s%s%s", sleft, sep, sright);
}
/**
* Return the type ID of string objects
*