-// add reference to string that we're modifying
-void
-RuleImpl::Attribute::setString(CFMutableDictionaryRef config, CFStringRef key, string &value)
-{
- CFStringRef cfstringValue = CFStringCreateWithCString(NULL /*allocator*/, value.c_str(), kCFStringEncodingUTF8);
-
- if (cfstringValue)
- {
- CFDictionarySetValue(config, key, cfstringValue);
- CFRelease(cfstringValue);
- }
- else
- MacOSError::throwMe(errAuthorizationInternal); // XXX/cs invalid attribute
-}
-
-void
-RuleImpl::Attribute::setDouble(CFMutableDictionaryRef config, CFStringRef key, double value)
-{
- CFNumberRef doubleValue = CFNumberCreate(NULL /*allocator*/, kCFNumberDoubleType, doubleValue);
-
- if (doubleValue)
- {
- CFDictionarySetValue(config, key, doubleValue);
- CFRelease(doubleValue);
- }
- else
- MacOSError::throwMe(errAuthorizationInternal); // XXX/cs invalid attribute
-}
-
-void
-RuleImpl::Attribute::setBool(CFMutableDictionaryRef config, CFStringRef key, bool value)
-{
- if (value)
- CFDictionarySetValue(config, key, kCFBooleanTrue);
- else
- CFDictionarySetValue(config, key, kCFBooleanFalse);
-}
-