当前位置: 首页>>代码示例>>C++>>正文


C++ CFDictionaryRemoveValue函数代码示例

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


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

示例1: interface_update_status

static void
interface_update_status(const char *if_name, CFBooleanRef active,
			boolean_t attach)
{
	CFStringRef		key		= NULL;
	CFMutableDictionaryRef	newDict		= NULL;

	key = create_interface_key(if_name);
	newDict = copy_entity(key);
	/* if new status available, update cache */
	if (active == NULL) {
	    CFDictionaryRemoveValue(newDict, kSCPropNetLinkActive);
	} else {
	    CFDictionarySetValue(newDict, kSCPropNetLinkActive, active);
	}
	if (attach == TRUE) {
		/* the interface was attached, remove stale state */
		CFDictionaryRemoveValue(newDict, kSCPropNetLinkDetaching);
	}

	/* update status */
	if (CFDictionaryGetCount(newDict) > 0) {
		cache_SCDynamicStoreSetValue(store, key, newDict);
	} else {
		cache_SCDynamicStoreRemoveValue(store, key);
	}

	CFRelease(key);
	CFRelease(newDict);
	return;
}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:31,代码来源:ev_dlil.c

示例2: find_class_path

static VALUE
find_class_path(VALUE klass)
{
    struct fc_result arg;

    arg.name = 0;
    arg.path = 0;
    arg.klass = klass;
    arg.track = rb_cObject;
    arg.prev = 0;

    CFMutableDictionaryRef iv_dict = rb_class_ivar_dict(rb_cObject);
    if (iv_dict != NULL) {
	ivar_dict_foreach(iv_dict, fc_i, (VALUE)&arg);
    }
    if (arg.path == 0) {
	st_foreach_safe(rb_class_tbl, fc_i, (st_data_t)&arg);
    }
    if (arg.path) {
	iv_dict = rb_class_ivar_dict_or_create(klass);
	CFDictionarySetValue(iv_dict, (const void *)id_classpath,
		(const void *)arg.path);
	CFDictionaryRemoveValue(iv_dict, (const void *)id_tmp_classpath);
	return arg.path;
    }
    if (!RCLASS_RUBY(klass)) {
	VALUE name = rb_str_new2(class_getName((Class)klass));
	iv_dict = rb_class_ivar_dict_or_create(klass);
	CFDictionarySetValue(iv_dict, (const void *)id_classpath,
		(const void *)name);
	CFDictionaryRemoveValue(iv_dict, (const void *)id_tmp_classpath);
	return name;
    }
    return Qnil;
}
开发者ID:kyab,项目名称:MacRuby,代码行数:35,代码来源:variable.c

示例3: _CFBundlePlugInLoaded

__private_extern__ void _CFBundlePlugInLoaded(CFBundleRef bundle) {
    CFDictionaryRef infoDict = CFBundleGetInfoDictionary(bundle);
    CFStringRef tempStr;
    CFPlugInDynamicRegisterFunction func = NULL;

    if (!__CFBundleGetPlugInData(bundle)->_isPlugIn || __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration || !infoDict || !CFBundleIsExecutableLoaded(bundle)) return;

    tempStr = (CFStringRef)CFDictionaryGetValue(infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));
    if (tempStr && CFGetTypeID(tempStr) == CFStringGetTypeID() && CFStringCompare(tempStr, CFSTR("YES"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
        CFDictionaryRemoveValue((CFMutableDictionaryRef)infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));
        tempStr = (CFStringRef)CFDictionaryGetValue(infoDict, kCFPlugInDynamicRegisterFunctionKey);
        if (!tempStr || CFGetTypeID(tempStr) != CFStringGetTypeID() || CFStringGetLength(tempStr) <= 0) tempStr = CFSTR("CFPlugInDynamicRegister");
        __CFBundleGetPlugInData(bundle)->_loadOnDemand = false;
        __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration = true;

        /* Find the symbol and call it. */
        func = (CFPlugInDynamicRegisterFunction)CFBundleGetFunctionPointerForName(bundle, tempStr);
        if (func) {
            func(bundle);
            // MF:!!! Unload function is never called.  Need to deal with this!
        }

        __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration = false;
        if (__CFBundleGetPlugInData(bundle)->_loadOnDemand && __CFBundleGetPlugInData(bundle)->_instanceCount == 0) CFBundleUnloadExecutable(bundle);   // Unload now if we can/should.
    } else {
        CFDictionaryRemoveValue((CFMutableDictionaryRef)infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));
    }
}
开发者ID:Ashod,项目名称:WinCairoRequirements,代码行数:28,代码来源:CFPlugIn_PlugIn.c

示例4: copyIF

static CFMutableDictionaryRef
copyIF(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,代码来源:ev_ipv6.c

示例5: CFDictionarySetValue

void SFB::Audio::Metadata::SetValue(CFStringRef key, CFTypeRef value)
{
	if(nullptr == key)
		return;

	if(nullptr == value) {
		if(CFDictionaryContainsKey(mMetadata, key))
			CFDictionarySetValue(mChangedMetadata, key, kCFNull);
		else
			CFDictionaryRemoveValue(mChangedMetadata, key);
	}
	else {
		CFTypeRef savedValue = CFDictionaryGetValue(mMetadata, key);
		// Revert the change if the new value is the save as the saved value
		if(CFDictionaryContainsKey(mChangedMetadata, key)) {
			if(savedValue && CFEqual(savedValue, value))
				CFDictionaryRemoveValue(mChangedMetadata, key);
			else
				CFDictionarySetValue(mChangedMetadata, key, value);
		}
		// If a saved value exists only register the change if the new value is different
		else if(savedValue && !CFEqual(savedValue, value))
			CFDictionarySetValue(mChangedMetadata, key, value);
		// If no saved value exists for the key register the change
		else if(nullptr == savedValue)
			CFDictionarySetValue(mChangedMetadata, key, value);
	}
}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:28,代码来源:AudioMetadata.cpp

示例6: rb_mod_init_copy

VALUE
rb_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,代码来源:class.c

示例7: __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,代码来源:SCNetworkConfigurationInternal.c

示例8: rb_mod_init_copy

/* :nodoc: */
VALUE
rb_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,代码来源:class.c

示例9: EAPOLClientProfileSetInformation

/*
 * Function: EAPOLClientProfileSetInformation
 *
 * Purpose:
 *   Associate additional information with the profile using the given
 *   application identifier.
 *   
 *   If info is NULL, the information for the particular application is cleared.
 *
 * Note:
 *   applicationID must be an application identifier e.g. "com.mycompany.myapp".
 */
Boolean
EAPOLClientProfileSetInformation(EAPOLClientProfileRef profile,
				 CFStringRef applicationID,
				 CFDictionaryRef information)
{
    if (applicationID_is_valid(applicationID) == FALSE) {
	return (FALSE);
    }
    if (information == NULL) {
	if (profile->information != NULL) {
	    CFDictionaryRemoveValue(profile->information, applicationID);
	}
    }
    else {
	if (isA_CFDictionary(information) == NULL) {
	    return (FALSE);
	}
	if (profile->information == NULL) {
	    profile->information
		= CFDictionaryCreateMutable(NULL, 0,
					    &kCFTypeDictionaryKeyCallBacks,
					    &kCFTypeDictionaryValueCallBacks);
	}
	CFDictionarySetValue(profile->information, applicationID, information);
    }
    return (TRUE);
}
开发者ID:gfleury,项目名称:eap8021x-debug,代码行数:39,代码来源:EAPOLClientProfile.c

示例10: 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,代码来源:AudioMetadata.cpp

示例11: CFDictionaryGetCount

void SFB::Audio::Metadata::MergeChangedMetadataIntoMetadata()
{
	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(mMetadata, keys[i]);
		else
			CFDictionarySetValue(mMetadata, keys[i], values[i]);
	}
	
	free(keys), keys = nullptr;
	free(values), values = nullptr;
	
	CFDictionaryRemoveAllValues(mChangedMetadata);

	auto iter = std::begin(mPictures);
	while(iter != std::end(mPictures)) {
		auto picture = *iter;
		if(AttachedPicture::ChangeState::Removed == picture->mState)
			iter = mPictures.erase(iter);
		else {
			picture->MergeChangedMetadataIntoMetadata();
			picture->mState = AttachedPicture::ChangeState::Saved;
			++iter;
		}
	}
}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:33,代码来源:AudioMetadata.cpp

示例12: rb_gc_copy_finalizer

void
rb_gc_copy_finalizer(VALUE dest, VALUE obj)
{
    VALUE table;

    if (__os_finalizers == NULL)
	return;

    if (NATIVE(obj)) {
	if (!rb_objc_flag_check((void *)obj, FL_FINALIZE))
	    return;
    }
    else {
	if (!FL_TEST(obj, FL_FINALIZE))
	    return;
    }

    table = (VALUE)CFDictionaryGetValue((CFDictionaryRef)__os_finalizers,
	(const void *)obj);

    if (table == 0) {
	CFDictionaryRemoveValue(__os_finalizers, (const void *)dest);
    }
    else {
	CFDictionarySetValue(__os_finalizers, (const void *)dest, 
	    (const void *)table);	
    }
}
开发者ID:prototype,项目名称:MacRuby,代码行数:28,代码来源:gc.c

示例13: interface_update_quality_metric

__private_extern__
void
interface_update_quality_metric(const char *if_name,
				int quality)
{
	CFStringRef  		key             = NULL;
	CFMutableDictionaryRef	newDict         = NULL;
	CFNumberRef		linkquality     = NULL;

	key = create_linkquality_key(if_name);
	newDict = copy_entity(key);

	if (quality != IFNET_LQM_THRESH_UNKNOWN) {
		linkquality = CFNumberCreate(NULL, kCFNumberIntType, &quality);
		CFDictionarySetValue(newDict, kSCPropNetLinkQuality, linkquality);
		CFRelease(linkquality);
	} else {
		CFDictionaryRemoveValue(newDict, kSCPropNetLinkQuality);
	}

	/* update status */
	if (CFDictionaryGetCount(newDict) > 0) {
		cache_SCDynamicStoreSetValue(store, key, newDict);
	} else {
		cache_SCDynamicStoreRemoveValue(store, key);
	}

	CFRelease(key);
	CFRelease(newDict);
	return;
}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:31,代码来源:ev_dlil.c

示例14: remove_old_linklocal_modifiers

STATIC void
remove_old_linklocal_modifiers(CFMutableDictionaryRef modifiers)
{
    CFIndex		count;

    count = CFDictionaryGetCount(modifiers);
    if (count > 0) {
	int		i;
	const void *	keys[count];
	CFDateRef	now;
	const void *	values[count];

	now = CFDateCreate(NULL, CFAbsoluteTimeGetCurrent());
	CFDictionaryGetKeysAndValues(modifiers, keys, values);
	for (i = 0; i < count; i++) {
	    CFDictionaryRef	dict = (CFDictionaryRef)values[i];

	    if (linklocal_modifier_has_expired(dict, now)) {
		CFStringRef	key = (CFStringRef)keys[i];

		CFDictionaryRemoveValue(modifiers, key);
	    }
	}
	CFRelease(now);
    }
    return;
}
开发者ID:carriercomm,项目名称:osx-2,代码行数:27,代码来源:CGA.c

示例15: classname

static VALUE
classname(VALUE klass)
{
    VALUE path = Qnil;

    if (klass == 0) {
	klass = rb_cObject;
    }
    CFMutableDictionaryRef iv_dict = rb_class_ivar_dict(klass);
    if (iv_dict != NULL) {
	if (!CFDictionaryGetValueIfPresent((CFDictionaryRef)iv_dict, 
		    (const void *)id_classpath, (const void **)&path)) {
	    if (!CFDictionaryGetValueIfPresent((CFDictionaryRef)iv_dict, 
			(const void *)id_classid, (const void **)&path)) {
		return find_class_path(klass);
	    }
	    path = rb_str_dup(path);
	    OBJ_FREEZE(path);
	    CFDictionarySetValue(iv_dict, (const void *)id_classpath,
		    (const void *)path);
	    CFDictionaryRemoveValue(iv_dict, (const void *)id_classid);
	}
	if (TYPE(path) != T_STRING) {
	    rb_bug("class path is not set properly");
	}
	return path;
    }
    return find_class_path(klass);
}
开发者ID:kyab,项目名称:MacRuby,代码行数:29,代码来源:variable.c


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