您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CFDictionaryCreateMutableCopy函数代码示例

51自学网 2021-06-01 19:58:39
  C++
这篇教程C++ CFDictionaryCreateMutableCopy函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CFDictionaryCreateMutableCopy函数的典型用法代码示例。如果您正苦于以下问题:C++ CFDictionaryCreateMutableCopy函数的具体用法?C++ CFDictionaryCreateMutableCopy怎么用?C++ CFDictionaryCreateMutableCopy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CFDictionaryCreateMutableCopy函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: copyIF

static CFMutableDictionaryRefcopyIF(CFStringRef key, CFMutableDictionaryRef oldIFs, CFMutableDictionaryRef newIFs){	CFDictionaryRef		dict		= NULL;	CFMutableDictionaryRef	newDict		= NULL;	if (CFDictionaryGetValueIfPresent(newIFs, key, (const void **)&dict)) {		newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);	} else {		dict = cache_SCDynamicStoreCopyValue(store, key);		if (dict) {			CFDictionarySetValue(oldIFs, key, dict);			if (isA_CFDictionary(dict)) {				newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6Addresses);				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6DestAddresses);				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6Flags);				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6PrefixLength);#ifdef	NOTYET				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6ScopeID);#endif	/* NOTYET */			}			CFRelease(dict);		}	}	if (!newDict) {		newDict = CFDictionaryCreateMutable(NULL,						    0,						    &kCFTypeDictionaryKeyCallBacks,						    &kCFTypeDictionaryValueCallBacks);	}	return newDict;}
开发者ID:010001111,项目名称:darling,代码行数:35,


示例2: CFDictionaryCreateMutableCopy

CFDictionaryRef SFB::Audio::Metadata::CreateDictionaryRepresentation() const{	CFMutableDictionaryRef dictionaryRepresentation = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, mMetadata);	CFIndex count = CFDictionaryGetCount(mChangedMetadata);	CFTypeRef *keys = (CFTypeRef *)malloc(sizeof(CFTypeRef) * (size_t)count);	CFTypeRef *values = (CFTypeRef *)malloc(sizeof(CFTypeRef) * (size_t)count);	CFDictionaryGetKeysAndValues(mChangedMetadata, keys, values);	for(CFIndex i = 0; i < count; ++i) {		if(kCFNull == values[i])			CFDictionaryRemoveValue(dictionaryRepresentation, keys[i]);		else			CFDictionarySetValue(dictionaryRepresentation, keys[i], values[i]);	}	free(keys), keys = nullptr;	free(values), values = nullptr;	CFMutableArray pictureArray = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);	for(auto picture : GetAttachedPictures()) {		CFDictionary pictureRepresentation = picture->CreateDictionaryRepresentation();		CFArrayAppendValue(pictureArray, pictureRepresentation);	}	if(0 < CFArrayGetCount(pictureArray)) {		CFDictionarySetValue(dictionaryRepresentation, kAttachedPicturesKey, pictureArray);	}	return dictionaryRepresentation;}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:34,


示例3: _loadXMLDomainIfStale

// Assumes the domain has already been lockedstatic void _loadXMLDomainIfStale(CFURLRef url, _CFXMLPreferencesDomain *domain) {    CFAllocatorRef alloc = __CFPreferencesAllocator();    int idx;    if (domain->_domainDict) {        CFDateRef modDate;        CFAbsoluteTime modTime;    	CFURLRef testURL = url;        if (CFDictionaryGetCount(domain->_domainDict) == 0) {            // domain never existed; check the parent directory, not the child            testURL = CFURLCreateWithFileSystemPathRelativeToBase(alloc, CFSTR(".."), kCFURLPOSIXPathStyle, true, url);        }        modDate = (CFDateRef )CFURLCreatePropertyFromResource(alloc, testURL, kCFURLFileLastModificationTime, NULL);        modTime = modDate ? CFDateGetAbsoluteTime(modDate) : 0.0;        // free before possible return. we can test non-NULL of modDate but don't depend on contents after this.        if (testURL != url) CFRelease(testURL);        if (modDate) CFRelease(modDate);                if (modDate != NULL && modTime < domain->_lastReadTime) {            // We're up-to-date            return;        }    }	    // We're out-of-date; destroy domainDict and reload    if (domain->_domainDict) {        CFRelease(domain->_domainDict);        domain->_domainDict = NULL;    }    // We no longer lock on read; instead, we assume parse failures are because someone else is writing the file, and just try to parse again.  If we fail 3 times in a row, we assume the file is corrupted.  REW, 7/13/99    for (idx = 0; idx < 3; idx ++) {        CFDataRef data;        if (!CFURLCreateDataAndPropertiesFromResource(alloc, url, &data, NULL, NULL, NULL) || !data) {            // Either a file system error (so we can't read the file), or an empty (or perhaps non-existant) file            domain->_domainDict = CFDictionaryCreateMutable(alloc, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);            break;        } else {            CFTypeRef pList = CFPropertyListCreateFromXMLData(alloc, data, kCFPropertyListImmutable, NULL);            CFRelease(data);            if (pList && CFGetTypeID(pList) == CFDictionaryGetTypeID()) {                domain->_domainDict = CFDictionaryCreateMutableCopy(alloc, 0, (CFDictionaryRef)pList);                CFRelease(pList);                break;            } else if (pList) {                CFRelease(pList);            }            // Assume the file is being written; sleep for a short time (to allow the write to complete) then re-read            __CFMilliSleep(150);        }    }    if (!domain->_domainDict) {        // Failed to ever load        domain->_domainDict = CFDictionaryCreateMutable(alloc, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);    }    domain->_lastReadTime = CFAbsoluteTimeGetCurrent();}
开发者ID:JGiola,项目名称:swift-corelibs-foundation,代码行数:61,


示例4: CFLocaleCreateComponentsFromLocaleIdentifier

CF_PRIVATE UCalendar *__CFCalendarCreateUCalendar(CFStringRef calendarID, CFStringRef localeID, CFTimeZoneRef tz) {    if (calendarID) {	CFDictionaryRef components = CFLocaleCreateComponentsFromLocaleIdentifier(kCFAllocatorSystemDefault, localeID);	CFMutableDictionaryRef mcomponents = CFDictionaryCreateMutableCopy(kCFAllocatorSystemDefault, 0, components);	CFDictionarySetValue(mcomponents, kCFLocaleCalendarIdentifier, calendarID);	localeID = CFLocaleCreateLocaleIdentifierFromComponents(kCFAllocatorSystemDefault, mcomponents);	CFRelease(mcomponents);	CFRelease(components);    }    char buffer[BUFFER_SIZE];    const char *cstr = CFStringGetCStringPtr(localeID, kCFStringEncodingASCII);    if (NULL == cstr) {	if (CFStringGetCString(localeID, buffer, BUFFER_SIZE, kCFStringEncodingASCII)) cstr = buffer;    }    if (NULL == cstr) {	if (calendarID) CFRelease(localeID);	return NULL;    }        UChar ubuffer[BUFFER_SIZE];    CFStringRef tznam = CFTimeZoneGetName(tz);    CFIndex cnt = CFStringGetLength(tznam);    if (BUFFER_SIZE < cnt) cnt = BUFFER_SIZE;    CFStringGetCharacters(tznam, CFRangeMake(0, cnt), (UniChar *)ubuffer);    UErrorCode status = U_ZERO_ERROR;    UCalendar *cal = ucal_open(ubuffer, cnt, cstr, UCAL_DEFAULT, &status);    if (calendarID) CFRelease(localeID);    return cal;}
开发者ID:0oneo,项目名称:CF-855.11,代码行数:31,


示例5: rb_singleton_class_clone

VALUErb_singleton_class_clone(VALUE obj){    VALUE klass = RBASIC(obj)->klass;    if (!RCLASS_SINGLETON(klass)) {	return klass;    }    // Create new singleton class.    VALUE clone = rb_objc_create_class(NULL, RCLASS_SUPER(klass));    // Copy ivars.    CFMutableDictionaryRef ivar_dict = rb_class_ivar_dict(klass);    if (ivar_dict != NULL) {	CFMutableDictionaryRef cloned_ivar_dict =	    CFDictionaryCreateMutableCopy(NULL, 0, (CFDictionaryRef)ivar_dict);	rb_class_ivar_set_dict(clone, cloned_ivar_dict);	CFMakeCollectable(cloned_ivar_dict);    }    // Copy methods.    rb_vm_copy_methods((Class)klass, (Class)clone);	    rb_singleton_class_attached(clone, obj);    if (RCLASS_SUPER(clone) == rb_cRubyObject) {	long v = RCLASS_VERSION(clone) ^ RCLASS_IS_OBJECT_SUBCLASS;	RCLASS_SET_VERSION(clone, v);    }    RCLASS_SET_VERSION_FLAG(clone, RCLASS_IS_SINGLETON);    return clone;}
开发者ID:MSch,项目名称:MacRuby,代码行数:31,


示例6: SRCopyItems

CFArrayRef SRCopyItems(CFArrayRef keychains, CFArrayRef classes) {  CFMutableArrayRef allItems = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);  CFMutableDictionaryRef query = CFDictionaryCreateMutable(NULL, 0,                                                           &kCFTypeDictionaryKeyCallBacks,                                                           &kCFTypeDictionaryValueCallBacks);  CFDictionarySetValue(query, kSecMatchSearchList, keychains);  CFDictionarySetValue(query, kSecReturnRef, kCFBooleanTrue);  CFDictionarySetValue(query, kSecReturnAttributes, kCFBooleanTrue);  CFDictionarySetValue(query, kSecMatchLimit, kSecMatchLimitAll);  for (int i = 0; i < CFArrayGetCount(classes); i++) {    CFTypeRef class = CFArrayGetValueAtIndex(classes, i);    CFDictionarySetValue(query, kSecClass, class);    CFArrayRef items = NULL;    OSStatus status = SecItemCopyMatching(query, (CFTypeRef *)&items);    // If there are not results, that's fine; this class is just empty    if (errSecItemNotFound != status) {      SRHandleError(status, true);      for (int j = 0; j < CFArrayGetCount(items); j++) {        CFDictionaryRef properties = CFArrayGetValueAtIndex(items, j);        CFMutableDictionaryRef newProperties = CFDictionaryCreateMutableCopy(NULL, 0, properties);        CFDictionarySetValue(newProperties, kSRAttrClass, class);        CFArrayAppendValue(allItems, newProperties);        CFRelease(newProperties);      }      CFRelease(items);    }  }
开发者ID:pnc,项目名称:splitring,代码行数:30,


示例7: SecItemCopyAttributeDictionary

static CFDictionaryRefSecItemCopyAttributeDictionary(CFTypeRef ref) {	CFDictionaryRef refDictionary = NULL;	CFTypeID typeID = CFGetTypeID(ref);	if (typeID == SecKeyGetTypeID()) {		refDictionary = SecKeyCopyAttributeDictionary((SecKeyRef)ref);	} else if (typeID == SecCertificateGetTypeID()) {		refDictionary =			SecCertificateCopyAttributeDictionary((SecCertificateRef)ref);	} else if (typeID == SecIdentityGetTypeID()) {        assert(false);        SecIdentityRef identity = (SecIdentityRef)ref;        SecCertificateRef cert = NULL;        SecKeyRef key = NULL;        if (!SecIdentityCopyCertificate(identity, &cert) &&            !SecIdentityCopyPrivateKey(identity, &key))         {            CFDataRef data = SecCertificateCopyData(cert);            CFDictionaryRef key_dict = SecKeyCopyAttributeDictionary(key);                        if (key_dict && data) {                refDictionary = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, key_dict);                CFDictionarySetValue((CFMutableDictionaryRef)refDictionary,                     CFSTR(CERTIFICATE_DATA_COLUMN_LABEL), data);            }            CFReleaseNull(key_dict);            CFReleaseNull(data);        }        CFReleaseNull(cert);        CFReleaseNull(key);    } else {		refDictionary = NULL;	}	return refDictionary;}
开发者ID:Apple-FOSS-Mirror,项目名称:Security,代码行数:35,


示例8: do_dictRemoveKey

__private_extern__voiddo_dictRemoveKey(int argc, char **argv){	CFStringRef		key;	CFMutableDictionaryRef	val;	if (value == NULL) {		SCPrint(TRUE, stdout, CFSTR("d.remove: dictionary must be initialized./n"));		return;	}	if (!isA_CFDictionary(value)) {		SCPrint(TRUE, stdout, CFSTR("d.remove: data (fetched from configuration server) is not a dictionary./n"));		return;	}	val = CFDictionaryCreateMutableCopy(NULL, 0, value);	CFRelease(value);	value = val;	key = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);	CFDictionaryRemoveValue((CFMutableDictionaryRef)value, key);	CFRelease(key);	return;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:27,


示例9: WorkaroundNetworkPrefsBug

static OSStatus WorkaroundNetworkPrefsBug(CFDictionaryRef *entitiesDictPtr)	// If this is an Ethernet interface and LCPEchoEnabled is false, 	// set it to true.  This works around what I think is a bug in 	// the Network preferences panel <rdar://problem/3182846> where the 	// LCPEchoEnabled flag is mysteriously set to false for PCI Ethernet 	// interfaces.{	OSStatus 	err;	CFStringRef hardwarePath[2];	CFStringRef lcpPath[2];	CFStringRef	hardwareStr;	CFNumberRef lcpValue;	long		enabled;		hardwarePath[0] = kSCEntNetInterface;	hardwarePath[1] = kSCPropNetInterfaceHardware;	lcpPath[0] = kSCEntNetPPP;	lcpPath[1] = kSCPropNetPPPLCPEchoEnabled;		hardwareStr = NULL;			// just to make debugging easier	lcpValue = NULL;		err = noErr;	if (    CFQDictionaryGetValueAtPath(*entitiesDictPtr, (const void **) hardwarePath, 2, (const void **) &hardwareStr) == noErr		 && CFEqual(hardwareStr, kSCEntNetEthernet)		 && CFQDictionaryGetValueAtPath(*entitiesDictPtr, (const void **) lcpPath, 2, (const void **) &lcpValue) == noErr		 && CFNumberGetValue(lcpValue, kCFNumberLongType, &enabled)		 && (enabled == 0) ) {		CFMutableDictionaryRef 	newDict;		CFNumberRef 			numRef;				if ( ! gRunQuiet ) {			fprintf(stderr, "Applied workaround/n");		}				numRef = NULL;		newDict = CFDictionaryCreateMutableCopy(NULL, 0, *entitiesDictPtr);		err = CFQError(newDict);		if (err == noErr) {			enabled = true;			numRef = CFNumberCreate(NULL, kCFNumberLongType, &enabled);			err = CFQError(numRef);		}		if (err == noErr) {			err = CFQDictionarySetValueAtPath(newDict, (const void **) lcpPath, 2, numRef);		}		if (err == noErr) {			CFQRelease(*entitiesDictPtr);			*entitiesDictPtr = newDict;			newDict = NULL;		}				CFQRelease(newDict);		CFQRelease(numRef);	}	return err;	}
开发者ID:fruitsamples,项目名称:MoreIsBetter,代码行数:59,


示例10: _SCBondInterfaceSetMode

static Boolean_SCBondInterfaceSetMode(SCBondInterfaceRef bond, CFNumberRef mode){	SCNetworkInterfacePrivateRef	interfacePrivate	= (SCNetworkInterfacePrivateRef)bond;	Boolean				needs_release 		= FALSE;	Boolean				ok			= TRUE;	assert(bond != NULL);	if (mode == NULL) {		int	mode_num	= IF_BOND_MODE_LACP;		mode = CFNumberCreate(NULL, kCFNumberIntType, &mode_num);		needs_release = TRUE;	}	// set mode in the stored preferences	if (interfacePrivate->prefs != NULL) {		CFDictionaryRef		dict;		CFMutableDictionaryRef	newDict;		CFStringRef		path;		path = CFStringCreateWithFormat(NULL,						NULL,						CFSTR("/%@/%@/%@"),						kSCPrefVirtualNetworkInterfaces,						kSCNetworkInterfaceTypeBond,						interfacePrivate->entity_device);		dict = SCPreferencesPathGetValue(interfacePrivate->prefs, path);		if (!isA_CFDictionary(dict)) {			// if the prefs are confused			CFRelease(path);			_SCErrorSet(kSCStatusFailed);			ok = FALSE;			goto done;		}		newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);		CFDictionarySetValue(newDict, kSCPropVirtualNetworkInterfacesBondMode, mode);		if (!CFEqual(dict, newDict)) {			ok = SCPreferencesPathSetValue(interfacePrivate->prefs, path, newDict);		}		CFRelease(newDict);		CFRelease(path);	}	if (ok) {		CFRetain(mode);		if (interfacePrivate->bond.mode != NULL) {			CFRelease(interfacePrivate->bond.mode);		}		interfacePrivate->bond.mode = mode;	}    done :	if (needs_release) CFRelease(mode);	return ok;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:58,


示例11: link_add

__private_extern__voidlink_add(const char *if_name){	CFStringRef		interface;	CFStringRef		cacheKey;	CFDictionaryRef		dict;	CFMutableDictionaryRef	newDict		= NULL;	CFArrayRef		ifList;	CFMutableArrayRef	newIFList	= NULL;	interface = CFStringCreateWithCString(NULL, if_name, kCFStringEncodingMacRoman);	cacheKey  = SCDynamicStoreKeyCreateNetworkInterface(NULL,							    kSCDynamicStoreDomainState);	dict = cache_SCDynamicStoreCopyValue(store, cacheKey);	if (dict) {		if (isA_CFDictionary(dict)) {			newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);			ifList  = CFDictionaryGetValue(newDict, kSCPropNetInterfaces);			if (isA_CFArray(ifList)) {				newIFList = CFArrayCreateMutableCopy(NULL, 0, ifList);			}		}		CFRelease(dict);	}	if (!newDict) {		newDict = CFDictionaryCreateMutable(NULL,						    0,						    &kCFTypeDictionaryKeyCallBacks,						    &kCFTypeDictionaryValueCallBacks);	}	if (!newIFList) {		newIFList = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);	}	if (CFArrayContainsValue(newIFList,				 CFRangeMake(0, CFArrayGetCount(newIFList)),				 interface) == FALSE) {		CFArrayAppendValue(newIFList, interface);		CFDictionarySetValue(newDict, kSCPropNetInterfaces, newIFList);	}	cache_SCDynamicStoreSetValue(store, cacheKey, newDict);	link_update_status(if_name, TRUE);#ifdef KEV_DL_LINK_QUALITY_METRIC_CHANGED	link_update_quality_metric(if_name);#endif /* KEV_DL_LINK_QUALITY_METRIC_CHANGED */	CFRelease(cacheKey);	CFRelease(interface);	if (newDict)	CFRelease(newDict);	if (newIFList)	CFRelease(newIFList);	return;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:56,


示例12: __setPrefsConfiguration

__private_extern__ Boolean__setPrefsConfiguration(SCPreferencesRef	prefs,			CFStringRef		path,			CFDictionaryRef		config,			Boolean			keepInactive){	CFDictionaryRef		curConfig;	CFMutableDictionaryRef	newConfig	= NULL;	Boolean			ok;	if ((config != NULL) && !isA_CFDictionary(config)) {		_SCErrorSet(kSCStatusInvalidArgument);		return FALSE;	}	curConfig = SCPreferencesPathGetValue(prefs, path);	if (config != NULL) {		newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);	}	if (keepInactive) {		if (config == NULL) {			newConfig = CFDictionaryCreateMutable(NULL,							      0,							      &kCFTypeDictionaryKeyCallBacks,							      &kCFTypeDictionaryValueCallBacks);		}		if (isA_CFDictionary(curConfig) && CFDictionaryContainsKey(curConfig, kSCResvInactive)) {			// if currently disabled			CFDictionarySetValue(newConfig, kSCResvInactive, kCFBooleanTrue);		} else {			// if currently enabled			CFDictionaryRemoveValue(newConfig, kSCResvInactive);		}	}	// set new configuration	if (_SC_CFEqual(curConfig, newConfig)) {		// if no change		if (newConfig != NULL) CFRelease(newConfig);		ok = TRUE;	} else if (newConfig != NULL) {		// if new configuration (or we are preserving a disabled state)		ok = SCPreferencesPathSetValue(prefs, path, newConfig);		CFRelease(newConfig);	} else {		ok = SCPreferencesPathRemoveValue(prefs, path);		if (!ok && (SCError() == kSCStatusNoKey)) {			ok = TRUE;		}	}	return ok;}
开发者ID:010001111,项目名称:darling,代码行数:56,


示例13: rb_mod_init_copy

VALUErb_mod_init_copy(VALUE clone, SEL sel, VALUE orig){    rb_obj_init_copy(clone, 0, orig);    VALUE super;    if (!RCLASS_RUBY(orig)) {	super = orig;	rb_warn("cloning class `%s' is not supported, creating a " /		"subclass instead", rb_class2name(orig));    }    else {	super = RCLASS_SUPER(orig);    }    RCLASS_SET_SUPER(clone, super);    // Copy flags.    unsigned long version_flag = RCLASS_IS_RUBY_CLASS;    if ((RCLASS_VERSION(super) & RCLASS_IS_OBJECT_SUBCLASS)	    == RCLASS_IS_OBJECT_SUBCLASS) {	version_flag |= RCLASS_IS_OBJECT_SUBCLASS;    }    if (RCLASS_MODULE(orig)) {	version_flag |= RCLASS_IS_MODULE;    }    RCLASS_SET_VERSION(clone, version_flag);    if (!class_isMetaClass((Class)clone)) {	// Clear type info.	RCLASS_SET_VERSION(*(Class *)clone, RCLASS_VERSION(*(Class *)clone));    }    // Copy methods.    rb_vm_copy_methods((Class)orig, (Class)clone);    if (!class_isMetaClass((Class)orig)) {	rb_vm_copy_methods(*(Class *)orig, *(Class *)clone);    }    // Copy ivars.    CFMutableDictionaryRef orig_dict = rb_class_ivar_dict(orig);    CFMutableDictionaryRef clone_dict;    if (orig_dict != NULL) {	clone_dict = CFDictionaryCreateMutableCopy(NULL, 0, orig_dict);	rb_class_ivar_set_dict(clone, clone_dict);	CFMakeCollectable(clone_dict);    }    else {	clone_dict = rb_class_ivar_dict_or_create(clone);    }    // Remove the classpath & classid (name) so that they are not    // copied over the new module / class.    CFDictionaryRemoveValue(clone_dict, (const void *)id_classpath);    CFDictionaryRemoveValue(clone_dict, (const void *)id_classid);    return clone;}
开发者ID:Watson1978,项目名称:MacRuby,代码行数:55,


示例14: __remove_password

__private_extern__Boolean__remove_password(SCPreferencesRef	prefs,		  CFDictionaryRef	config,		  CFStringRef		passwordKey,		  CFStringRef		encryptionKey,		  CFStringRef		encryptionKeyChainValue,		  CFStringRef		unique_id,		  CFDictionaryRef	*newConfig){	CFStringRef		encryption	= NULL;	Boolean			ok		= FALSE;	// check for keychain password	if (config != NULL) {		encryption = CFDictionaryGetValue(config, encryptionKey);	}	if ((encryption == NULL) ||	    (isA_CFString(encryption) &&	     CFEqual(encryption, encryptionKeyChainValue))) {		    // remove keychain password		    if (prefs != NULL) {			    ok = _SCPreferencesSystemKeychainPasswordItemRemove(prefs, unique_id);		    } else {			    ok = _SCSecKeychainPasswordItemRemove(NULL, unique_id);		    }	    }	// as needed, check if we have an in-line password that we can remove	if (!ok && (encryption == NULL) && (config != NULL)) {		CFDataRef	inline_password;		inline_password = CFDictionaryGetValue(config, passwordKey);		inline_password = __copy_legacy_password(inline_password);		if (inline_password != NULL) {			CFRelease(inline_password);			ok = TRUE;		}	}	if (newConfig != NULL) {		if (ok && (config != NULL)) {			CFMutableDictionaryRef	temp;			temp = CFDictionaryCreateMutableCopy(NULL, 0, config);			CFDictionaryRemoveValue(temp, passwordKey);			CFDictionaryRemoveValue(temp, encryptionKey);			*newConfig = (CFDictionaryRef)temp;		} else {			*newConfig = NULL;		}	}	return ok;}
开发者ID:010001111,项目名称:darling,代码行数:55,


示例15: SetHibernateMode

int SetHibernateMode(int mode, CFStringRef ps) {	CFNumberRef            target_hm;	CFDictionaryRef        tmp_settings = 0;	CFMutableDictionaryRef settings = 0;	CFDictionaryRef        tmp_node = 0;    CFMutableDictionaryRef node = 0;	IOReturn               ret;	int                    result = 0;		target_hm = CFNumberCreate(kCFAllocatorDefault, hm_type, &mode);                                                       /* Create a CFNumber with the mode value */	tmp_settings = IOPMCopyPMPreferences();                                                                                /* Get the power management preferences */	if(!tmp_settings) {                                                                                                       /* On failure, quit */		CFRelease(tmp_settings);		CFRelease(target_hm);		return 1;	}	settings = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, tmp_settings);                                        /* Copy the preferences to a mutable dictionary */	CFRelease(tmp_settings);	tmp_node = isA_CFDictionary(CFDictionaryGetValue(settings, ps));								                       /* Get the power source dictionary */    if(tmp_node) {        node = CFDictionaryCreateMutableCopy(0, 0, tmp_node);                                                              /* On success, copy it to a mutable dictionary */        if(node) {			CFDictionarySetValue(node, CFSTR("Hibernate Mode"), target_hm);                                                   /* Set the hibernate mode to its new value */            CFDictionarySetValue(settings, ps, node);                                                                         /* link the new power source dictionary to the pm preferences*/            CFRelease(node);        }    }		if(kIOReturnSuccess != (ret = IOPMSetPMPreferences(settings))) {                                                       /* Set the new pm preferences */		if(ret == kIOReturnNotPrivileged) {                                                                                   /* On failure, quit */			printf("deepsleep must be run as root.../n");		} else {			printf("Error 0x%08x writing Energy Saver preferences to disk/n", ret);		}	result = 1;	}		CFRelease(settings);                                                                                                  /* Cleanup */	CFRelease(target_hm);	return result;}
开发者ID:toshiya240,项目名称:DeepSleep,代码行数:42,


示例16: TearOffSignatureAndHashManifest

static int TearOffSignatureAndHashManifest(CFDictionaryRef manifestDict, CFDataRef* signature, CFDataRef* manifest_data){	int result = -1;	CFMutableDictionaryRef new_manifest_dict = NULL;    CFStringRef sig_data_str = NULL;	CFDataRef sig_data = NULL;	CFDataRef prop_list = NULL;    CFDataRef decoded_sig_data = NULL;		if (NULL == manifestDict || NULL == signature || NULL == manifest_data)	{		return result;	}	*signature = NULL;	*manifest_data = NULL;		new_manifest_dict = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, CFDictionaryGetCount(manifestDict), manifestDict);	sig_data_str = (CFStringRef)CFDictionaryGetValue(new_manifest_dict, CFSTR("Signature"));	if (NULL == sig_data_str)	{		CFRelease(new_manifest_dict);		return result; 	}        sig_data = CFStringCreateExternalRepresentation(kCFAllocatorDefault, sig_data_str, kCFStringEncodingUTF8, 0);    if (NULL == sig_data)    {        CFRelease(sig_data_str);        CFRelease(new_manifest_dict);		return result;    }        if (Base64Data(sig_data, 0, &decoded_sig_data))    {        CFRelease(sig_data);        CFRelease(new_manifest_dict);		return result;    }        	*signature = decoded_sig_data;		CFDictionaryRemoveValue(new_manifest_dict, CFSTR("Signature"));	prop_list = CFPropertyListCreateXMLData (kCFAllocatorDefault, new_manifest_dict);	CFRelease(new_manifest_dict);	if (NULL == prop_list)	{		return result; 	}        (void)CreateHashForData(prop_list, 1, manifest_data);	    result = (NULL == *manifest_data) ? -1 : 0;	return result;	}
开发者ID:unofficial-opensource-apple,项目名称:Security,代码行数:54,


示例17: SCNetworkSetSetServiceOrder

BooleanSCNetworkSetSetServiceOrder(SCNetworkSetRef set, CFArrayRef newOrder){	CFDictionaryRef		dict;	CFMutableDictionaryRef  newDict;	Boolean			ok;	CFStringRef		path;	SCNetworkSetPrivateRef	setPrivate	= (SCNetworkSetPrivateRef)set;	if (!isA_SCNetworkSet(set)) {		_SCErrorSet(kSCStatusInvalidArgument);		return FALSE;	}	if (isA_CFArray(newOrder)) {		CFIndex	i;		CFIndex	n	= CFArrayGetCount(newOrder);		for (i = 0; i < n; i++) {			CFStringRef	serviceID;			serviceID = CFArrayGetValueAtIndex(newOrder, i);			if (!isA_CFString(serviceID)) {				_SCErrorSet(kSCStatusInvalidArgument);				return FALSE;			}		}	} else {		_SCErrorSet(kSCStatusInvalidArgument);		return FALSE;	}	path = SCPreferencesPathKeyCreateSetNetworkGlobalEntity(NULL, setPrivate->setID, kSCEntNetIPv4);	if (path == NULL) {		return FALSE;	}	dict = SCPreferencesPathGetValue(setPrivate->prefs, path);	if (dict != NULL) {		newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);	} else {		newDict = CFDictionaryCreateMutable(NULL,						    0,						    &kCFTypeDictionaryKeyCallBacks,						    &kCFTypeDictionaryValueCallBacks);	}	CFDictionarySetValue(newDict, kSCPropNetServiceOrder, newOrder);	ok = SCPreferencesPathSetValue(setPrivate->prefs, path, newDict);	CFRelease(newDict);	CFRelease(path);	return ok;}
开发者ID:carriercomm,项目名称:osx-2,代码行数:54,


示例18: merge_params

/* Create a mutable dictionary that is based on the subdictionary for key with any attributes from the top level dict merged in. */static CFMutableDictionaryRef merge_params(CFDictionaryRef dict,                                           CFStringRef key) {	CFDictionaryRef subdict = CFDictionaryGetValue(dict, key);	CFMutableDictionaryRef result;    	if (subdict) {		result = CFDictionaryCreateMutableCopy(NULL, 0, subdict);		/* Add everything in dict not already in result to result. */		CFDictionaryApplyFunction(dict, merge_params_applier, result);	} else {		result = CFDictionaryCreateMutableCopy(NULL, 0, dict);	}    	/* Remove values that only belong in the top level dict. */	CFDictionaryRemoveValue(result, kSecPublicKeyAttrs);	CFDictionaryRemoveValue(result, kSecPrivateKeyAttrs);	CFDictionaryRemoveValue(result, kSecAttrKeyType);	CFDictionaryRemoveValue(result, kSecAttrKeySizeInBits);    	return result;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:23,


示例19: link_remove

__private_extern__voidlink_remove(const char *if_name){	CFStringRef		interface;	CFStringRef		cacheKey;	CFDictionaryRef		dict;	CFMutableDictionaryRef	newDict		= NULL;	CFArrayRef		ifList;	CFMutableArrayRef	newIFList	= NULL;	CFIndex			i;	interface = CFStringCreateWithCString(NULL, if_name, kCFStringEncodingMacRoman);	cacheKey  = SCDynamicStoreKeyCreateNetworkInterface(NULL,							    kSCDynamicStoreDomainState);	dict = cache_SCDynamicStoreCopyValue(store, cacheKey);	if (dict) {		if (isA_CFDictionary(dict)) {			newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);			ifList  = CFDictionaryGetValue(newDict, kSCPropNetInterfaces);			if (isA_CFArray(ifList)) {				newIFList = CFArrayCreateMutableCopy(NULL, 0, ifList);			}		}		CFRelease(dict);	}	if (!newIFList ||	    ((i = CFArrayGetFirstIndexOfValue(newIFList,					     CFRangeMake(0, CFArrayGetCount(newIFList)),					     interface)) == kCFNotFound)	   ) {		/* we're not tracking this interface */		goto done;	}	CFArrayRemoveValueAtIndex(newIFList, i);	CFDictionarySetValue(newDict, kSCPropNetInterfaces, newIFList);	cache_SCDynamicStoreSetValue(store, cacheKey, newDict);	interface_remove(if_name);    done:	CFRelease(cacheKey);	CFRelease(interface);	if (newDict)	CFRelease(newDict);	if (newIFList)	CFRelease(newIFList);	return;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:52,


示例20: rb_mod_init_copy

/* :nodoc: */VALUErb_mod_init_copy(VALUE clone, SEL sel, VALUE orig){    static ID classpath = 0;    static ID classid = 0;    rb_obj_init_copy(clone, 0, orig);    {	VALUE super;	unsigned long version_flag;	if (!RCLASS_RUBY(orig)) {	    super = orig;	    rb_warn("cloning class `%s' is not supported, creating a " /		    "subclass instead", rb_class2name(orig));	}	else {	    super = RCLASS_SUPER(orig);	}	RCLASS_SET_SUPER(clone, super);	version_flag = RCLASS_IS_RUBY_CLASS;	if ((RCLASS_VERSION(super) & RCLASS_IS_OBJECT_SUBCLASS) == RCLASS_IS_OBJECT_SUBCLASS) {	    version_flag |= RCLASS_IS_OBJECT_SUBCLASS;	}	RCLASS_SET_VERSION(clone, version_flag);	rb_vm_copy_methods((Class)orig, (Class)clone);	CFMutableDictionaryRef ivar_dict = rb_class_ivar_dict(orig);	if (ivar_dict != NULL) {	    CFMutableDictionaryRef cloned_ivar_dict;	    if (classpath == 0) {		classpath = rb_intern("__classpath__");	    }	    if (classid == 0) {		classid = rb_intern("__classid__");	    }	    cloned_ivar_dict = CFDictionaryCreateMutableCopy(NULL, 0,		(CFDictionaryRef)ivar_dict);	    // Remove the classpath & classid (name) so that they are not	    // copied over the new module / class	    CFDictionaryRemoveValue(cloned_ivar_dict, (const void *)classpath);	    CFDictionaryRemoveValue(cloned_ivar_dict, (const void *)classid);	    CFMakeCollectable(cloned_ivar_dict);	    rb_class_ivar_set_dict(clone, cloned_ivar_dict);	}    }    return clone;}
开发者ID:MSch,项目名称:MacRuby,代码行数:53,


示例21: __DAFileSystemProbeListAppendValue

static void __DAFileSystemProbeListAppendValue( const void * key, const void * value, void * context ){    CFMutableDictionaryRef probe;    probe = CFDictionaryCreateMutableCopy( kCFAllocatorDefault, 0, value );    if ( probe )    {        CFDictionarySetValue( probe, kDAFileSystemKey, context );        CFArrayAppendValue( gDAFileSystemProbeList, probe );        CFRelease( probe );    }}
开发者ID:carriercomm,项目名称:osx-2,代码行数:13,


示例22: __setPrefsEnabled

__private_extern__ Boolean__setPrefsEnabled(SCPreferencesRef      prefs,		  CFStringRef		path,		  Boolean		enabled){	CFDictionaryRef		curConfig;	CFMutableDictionaryRef  newConfig       = NULL;	Boolean			ok		= FALSE;	// preserve current configuration	curConfig = SCPreferencesPathGetValue(prefs, path);	if (curConfig != NULL) {		if (!isA_CFDictionary(curConfig)) {			_SCErrorSet(kSCStatusFailed);			return FALSE;		}		newConfig = CFDictionaryCreateMutableCopy(NULL, 0, curConfig);		if (enabled) {			// enable			CFDictionaryRemoveValue(newConfig, kSCResvInactive);		} else {			// disable			CFDictionarySetValue(newConfig, kSCResvInactive, kCFBooleanTrue);		}	} else {		if (!enabled) {			// disable			newConfig = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);			CFDictionarySetValue(newConfig, kSCResvInactive, kCFBooleanTrue);		}	}	// set new configuration	if (_SC_CFEqual(curConfig, newConfig)) {		// if no change		if (newConfig != NULL) CFRelease(newConfig);		ok = TRUE;	} else if (newConfig != NULL) {		// if updated configuration (or we are establishing as disabled)		ok = SCPreferencesPathSetValue(prefs, path, newConfig);		CFRelease(newConfig);	} else {		ok = SCPreferencesPathRemoveValue(prefs, path);		if (!ok && (SCError() == kSCStatusNoKey)) {			ok = TRUE;		}	}	return ok;}
开发者ID:010001111,项目名称:darling,代码行数:51,


示例23: PortBurn_StartErasing

/* Erase the media in the currently opened device */int PortBurn_StartErasing(void *handle, int type){   CFMutableDictionaryRef props;   PBHandle *h = (PBHandle *)handle;   if (h == NULL) {      return pbErrNoHandle;   }   if (h->device == NULL) {      return pbErrDeviceNotOpen;   }   if (h->burn != NULL || h->erase != NULL) {      return pbErrCannotStartErasing;   }   h->erase = DREraseCreate(h->device);   if (h->erase == NULL) {      return pbErrCannotPrepareToErase;   }   props = CFDictionaryCreateMutableCopy(NULL, 0, DREraseGetProperties(h->erase));   if (props == NULL) {      CFRelease(h->erase);      h->erase = NULL;      return pbErrCannotPrepareToErase;   }   CFDictionaryAddValue(props,                        kDREraseTypeKey,                        type ? kDREraseTypeComplete : kDREraseTypeQuick);   DREraseSetProperties(h->erase, props);   CFRelease(props);   h->frac = 0.0;   h->err = DREraseStart(h->erase);   if (h->err != noErr) {      CFRelease(h->erase);      h->erase = NULL;      return pbErrCannotStartErasing;   }   return pbSuccess;}
开发者ID:AkiraShirase,项目名称:audacity,代码行数:50,


示例24: copyScheduledRepeatPowerEvents

/*  * Copy Events from on-disk file. We should be doing this only * once, at start of the powerd. */static voidcopyScheduledRepeatPowerEvents(void){    SCPreferencesRef        prefs;    CFDictionaryRef         tmp;       prefs = SCPreferencesCreate(0,                                CFSTR("PM-configd-AutoWake"),                                CFSTR(kIOPMAutoWakePrefsPath));    if(!prefs) return;    if (repeatingPowerOff) CFRelease(repeatingPowerOff);    if (repeatingPowerOn) CFRelease(repeatingPowerOn);    tmp = (CFDictionaryRef)SCPreferencesGetValue(prefs, CFSTR(kIOPMRepeatingPowerOffKey));    if (tmp && isA_CFDictionary(tmp))        repeatingPowerOff = CFDictionaryCreateMutableCopy(0,0,tmp);    tmp = (CFDictionaryRef)SCPreferencesGetValue(prefs, CFSTR(kIOPMRepeatingPowerOnKey));    if (tmp && isA_CFDictionary(tmp))        repeatingPowerOn = CFDictionaryCreateMutableCopy(0,0,tmp);    CFRelease(prefs);}
开发者ID:hashier,项目名称:caffeinate_fix,代码行数:28,


示例25: SOSItemUpdateOrAdd

bool SOSItemUpdateOrAdd(CFStringRef service, CFStringRef accessibility, CFDataRef data, CFErrorRef *error){    CFDictionaryRef query = SOSItemCopyQueryForSyncItems(service, false);    CFDictionaryRef update = CFDictionaryCreateForCFTypes(kCFAllocatorDefault,                                                          kSecValueData,         data,                                                          kSecAttrAccessible,    accessibility,                                                          NULL);    OSStatus saveStatus = SecItemUpdate(query, update);    if (errSecItemNotFound == saveStatus) {        CFMutableDictionaryRef add = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, query);        CFDictionaryForEach(update, ^(const void *key, const void *value) {            CFDictionaryAddValue(add, key, value);        });
开发者ID:unofficial-opensource-apple,项目名称:Security,代码行数:15,


示例26: createLocaleIDFromLocaleAndCalendar

static CFStringRef createLocaleIDFromLocaleAndCalendar(CFLocaleRef locale, CFCalendarRef calendar) {    CFMutableDictionaryRef dict;        {        CFDictionaryRef immutableDict = CFLocaleCreateComponentsFromLocaleIdentifier(kCFAllocatorSystemDefault, CFLocaleGetIdentifier(locale));        dict = CFDictionaryCreateMutableCopy(kCFAllocatorSystemDefault, 0, immutableDict);        CFRelease(immutableDict);    }        if (calendar) {        CFDictionarySetValue(dict, kCFLocaleCalendar, calendar);    }    CFStringRef localeID = CFLocaleCreateLocaleIdentifierFromComponents(kCFAllocatorSystemDefault, dict);    CFRelease(dict);        return localeID;}
开发者ID:saiHemak,项目名称:swift-corelibs-foundation,代码行数:17,


示例27: SetActiveProfile

/* Set the active power profile */int SetActiveProfile(int nb, CFStringRef ps, CFDictionaryRef profile) {	CFNumberRef            target_nb;	CFMutableDictionaryRef custom_profile;	IOReturn               ret;	int                    result = 0;		target_nb = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &nb);                                              /* Create a CFNumber with the active profile value */	custom_profile = CFDictionaryCreateMutableCopy(0, 0, profile);                                                       /* Copy the preferences to a mutable dictionary */	CFDictionarySetValue(custom_profile, ps, target_nb);                                                                 /* Set the active profile to its new value */	if(kIOReturnSuccess != (ret = IOPMSetActivePowerProfiles(custom_profile))) {                                         /* Set the new profile */		printf("Error 0x%08x writing Energy Saver preferences to disk/n", ret);                                             /* On failure, quit */		result = 1;	}		CFRelease(custom_profile);	CFRelease(target_nb);	return result;}
开发者ID:toshiya240,项目名称:DeepSleep,代码行数:19,


示例28: writeFontDatabaseToPlist

static void writeFontDatabaseToPlist(CFPropertyListRef cgFontDBPropertyList, CFPropertyListRef filenamesFromRegistry){    if (!cgFontDBPropertyList)        return;    RetainPtr<CFDataRef> data;    if (!filenamesFromRegistry || CFGetTypeID(cgFontDBPropertyList) != CFDictionaryGetTypeID())        data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, cgFontDBPropertyList));    else {        RetainPtr<CFMutableDictionaryRef> dictionary(AdoptCF, CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 2, static_cast<CFDictionaryRef>(cgFontDBPropertyList)));        CFDictionarySetValue(dictionary.get(), fontFilenamesFromRegistryKey(), filenamesFromRegistry);        data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, dictionary.get()));    }    if (!data)        return;    safeCreateFile(fontsPlistPath(), data.get());}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:20,


示例29: createConnectionProperties

static CFDictionaryRef createConnectionProperties(bool shouldUseCredentialStorage, CFDictionaryRef clientProperties){    static const CFStringRef webKitPrivateSessionCF = CFSTR("WebKitPrivateSession");    static const CFStringRef _kCFURLConnectionSessionID = CFSTR("_kCFURLConnectionSessionID");    static const CFStringRef kCFURLConnectionSocketStreamProperties = CFSTR("kCFURLConnectionSocketStreamProperties");    CFDictionaryRef sessionID = shouldUseCredentialStorage ?        CFDictionaryCreate(0, 0, 0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks) :        CFDictionaryCreate(0, (const void**)&_kCFURLConnectionSessionID, (const void**)&webKitPrivateSessionCF, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);    CFMutableDictionaryRef propertiesDictionary;    if (clientProperties)        propertiesDictionary = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, clientProperties);    else        propertiesDictionary = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);    CFDictionaryAddValue(propertiesDictionary, (const void*)kCFURLConnectionSocketStreamProperties, (const void*)sessionID);    CFRelease(sessionID);    return propertiesDictionary;}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:20,


示例30: convertWebResourceResponseToDictionary

static void convertWebResourceResponseToDictionary(CFMutableDictionaryRef propertyList){    CFDataRef responseData = static_cast<CFDataRef>(CFDictionaryGetValue(propertyList, CFSTR("WebResourceResponse"))); // WebResourceResponseKey in WebResource.m    if (CFGetTypeID(responseData) != CFDataGetTypeID())        return;    RetainPtr<CFURLResponseRef> response = adoptCF(createCFURLResponseFromResponseData(responseData));    if (!response)        return;    RetainPtr<CFMutableDictionaryRef> responseDictionary = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));    RetainPtr<CFMutableStringRef> urlString = adoptCF(CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFURLGetString(CFURLResponseGetURL(response.get()))));    normalizeWebResourceURL(urlString.get());    CFDictionarySetValue(responseDictionary.get(), CFSTR("URL"), urlString.get());    RetainPtr<CFMutableStringRef> mimeTypeString = adoptCF(CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFURLResponseGetMIMEType(response.get())));    convertMIMEType(mimeTypeString.get());    CFDictionarySetValue(responseDictionary.get(), CFSTR("MIMEType"), mimeTypeString.get());    CFStringRef textEncodingName = CFURLResponseGetTextEncodingName(response.get());    if (textEncodingName)        CFDictionarySetValue(responseDictionary.get(), CFSTR("textEncodingName"), textEncodingName);    SInt64 expectedContentLength = CFURLResponseGetExpectedContentLength(response.get());    RetainPtr<CFNumberRef> expectedContentLengthNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &expectedContentLength));    CFDictionarySetValue(responseDictionary.get(), CFSTR("expectedContentLength"), expectedContentLengthNumber.get());    if (CFHTTPMessageRef httpMessage = CFURLResponseGetHTTPResponse(response.get())) {        RetainPtr<CFDictionaryRef> allHeaders = adoptCF(CFHTTPMessageCopyAllHeaderFields(httpMessage));        RetainPtr<CFMutableDictionaryRef> allHeaderFields = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, allHeaders.get()));        normalizeHTTPResponseHeaderFields(allHeaderFields.get());        CFDictionarySetValue(responseDictionary.get(), CFSTR("allHeaderFields"), allHeaderFields.get());        CFIndex statusCode = CFHTTPMessageGetResponseStatusCode(httpMessage);        RetainPtr<CFNumberRef> statusCodeNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberCFIndexType, &statusCode));        CFDictionarySetValue(responseDictionary.get(), CFSTR("statusCode"), statusCodeNumber.get());    }    CFDictionarySetValue(propertyList, CFSTR("WebResourceResponse"), responseDictionary.get());}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:41,



注:本文中的CFDictionaryCreateMutableCopy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CFDictionaryGetCount函数代码示例
C++ CFDictionaryCreate函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。