Core Foundation: add to_string

Signed-off-by: Simon Rozman simon@rozman.si
This commit is contained in:
Simon Rozman 2025-07-02 16:16:58 +02:00
parent 5f951247aa
commit c014480acb

View File

@ -75,6 +75,14 @@ namespace macstd {
strcat(str, h, encoding);
}
template <typename TR = std::char_traits<char>, typename A = std::allocator<char>>
std::basic_string<char, TR, A> to_string(CFStringRef h, CFStringEncoding encoding = kCFStringEncodingUTF8)
{
std::basic_string<char, TR, A> str;
strcat(str, h, encoding);
return str;
}
///
/// Core Foundation string
///