osx: implements quicklook
This commit is contained in:
@@ -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? {
|
||||
|
||||
Reference in New Issue
Block a user