From c014480acb8a8555696220cb92e563c16fa3677e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 2 Jul 2025 16:16:58 +0200 Subject: [PATCH] Core Foundation: add to_string Signed-off-by: Simon Rozman simon@rozman.si --- include/MacStd/CoreFoundation.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/MacStd/CoreFoundation.hpp b/include/MacStd/CoreFoundation.hpp index f9f76f1..c98d561 100644 --- a/include/MacStd/CoreFoundation.hpp +++ b/include/MacStd/CoreFoundation.hpp @@ -75,6 +75,14 @@ namespace macstd { strcat(str, h, encoding); } + template , typename A = std::allocator> + std::basic_string to_string(CFStringRef h, CFStringEncoding encoding = kCFStringEncodingUTF8) + { + std::basic_string str; + strcat(str, h, encoding); + return str; + } + /// /// Core Foundation string ///