Private
Public Access
1
0

osx: implements quicklook

This commit is contained in:
2025-09-12 18:17:58 -07:00
parent 87e986707d
commit 1a5f13f2b8
5 changed files with 143 additions and 14 deletions

View File

@@ -76,6 +76,22 @@ extension Array: XPCConvertible where Element: XPCConvertible
}
}
extension Bool: XPCConvertible
{
static func fromXPC(_ value: xpc_object_t) -> Bool? {
if xpc_get_type(value) == XPC_TYPE_BOOL {
return xpc_bool_get_value(value)
}
if xpc_get_type(value) == XPC_TYPE_STRING {
guard let cstr = xpc_string_get_string_ptr(value) else { return nil }
return strcmp(cstr, "true") == 0
}
return nil
}
}
extension xpc_object_t
{
func getObject(_ key: String) -> xpc_object_t? {