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

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

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

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

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

示例1: kim_os_preferences_get_boolean_for_key

kim_error kim_os_preferences_get_boolean_for_key (kim_preference_key  in_key,                                                  kim_boolean         in_hardcoded_default,                                                  kim_boolean        *out_boolean){    kim_error err = KIM_NO_ERROR;    CFBooleanRef value = NULL;    if (!err && !out_boolean) { err = check_error (KIM_NULL_PARAMETER_ERR); }    if (!err) {        err = kim_os_preferences_copy_value (in_key, CFBooleanGetTypeID (),                                             (CFPropertyListRef *) &value);    }    if (!err && !value) {        err = kim_os_preferences_copy_value_compat (in_key, CFBooleanGetTypeID (),                                                    (CFPropertyListRef *) &value);    }    if (!err) {        if (value) {            *out_boolean = CFBooleanGetValue (value);        } else {            *out_boolean = in_hardcoded_default;        }    }    if (value) { CFRelease (value); }    return check_error (err);}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:31,


示例2: getIOKitProperty

std::string getIOKitProperty(const CFMutableDictionaryRef& details,                             const std::string& key) {  std::string value;  // Get a property from the device.  auto cfkey = CFStringCreateWithCString(      kCFAllocatorDefault, key.c_str(), kCFStringEncodingUTF8);  auto property = CFDictionaryGetValue(details, cfkey);  CFRelease(cfkey);  // Several supported ways of parsing IOKit-encoded data.  if (property) {    if (CFGetTypeID(property) == CFNumberGetTypeID()) {      value = stringFromCFNumber((CFDataRef)property);    } else if (CFGetTypeID(property) == CFStringGetTypeID()) {      value = stringFromCFString((CFStringRef)property);    } else if (CFGetTypeID(property) == CFDataGetTypeID()) {      value = stringFromCFData((CFDataRef)property);    } else if (CFGetTypeID(property) == CFBooleanGetTypeID()) {      value = (CFBooleanGetValue((CFBooleanRef)property)) ? "1" : "0";    }  }  return value;}
开发者ID:PoppySeedPlehzr,项目名称:osquery,代码行数:25,


示例3: typeFromCFTypeRef

static CFType typeFromCFTypeRef(CFTypeRef type){    ASSERT(type);    if (type == tokenNullTypeRef())        return Null;    CFTypeID typeID = CFGetTypeID(type);    if (typeID == CFArrayGetTypeID())        return CFArray;    if (typeID == CFBooleanGetTypeID())        return CFBoolean;    if (typeID == CFDataGetTypeID())        return CFData;    if (typeID == CFDictionaryGetTypeID())        return CFDictionary;    if (typeID == CFNullGetTypeID())        return CFNull;    if (typeID == CFNumberGetTypeID())        return CFNumber;    if (typeID == CFStringGetTypeID())        return CFString;    if (typeID == CFURLGetTypeID())        return CFURL;#if PLATFORM(MAC)    if (typeID == SecCertificateGetTypeID())        return SecCertificate;#endif    ASSERT_NOT_REACHED();    return Unknown;}
开发者ID:ACSOP,项目名称:android_external_webkit,代码行数:32,


示例4: KJSValueToJSObject

double UserObjectImp::toNumber(ExecState *exec) const{    double result = 0;    JSUserObject* jsObjPtr = KJSValueToJSObject(toObject(exec), exec);    CFTypeRef cfValue = jsObjPtr ? jsObjPtr->CopyCFValue() : 0;    if (cfValue)    {        CFTypeID cfType = CFGetTypeID(cfValue);        if (cfValue == GetCFNull())        {            //        }        else if (cfType == CFBooleanGetTypeID())        {            if (cfValue == kCFBooleanTrue)            {                result = 1;            }        }        else if (cfType == CFStringGetTypeID())        {            result = CFStringGetDoubleValue((CFStringRef)cfValue);        }        else if (cfType == CFNumberGetTypeID())        {            CFNumberGetValue((CFNumberRef)cfValue, kCFNumberDoubleType, &result);        }    }    ReleaseCFType(cfValue);    if (jsObjPtr) jsObjPtr->Release();    return result;}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:33,


示例5: stringFromCFAbsoluteTime

std::string DiskArbitrationEventPublisher::getProperty(    const CFStringRef& property, const CFDictionaryRef& dict) {  CFTypeRef value = (CFTypeRef)CFDictionaryGetValue(dict, property);  if (value == nullptr) {    return "";  }  if (CFStringCompare(property, CFSTR(kDAAppearanceTime_), kNilOptions) ==      kCFCompareEqualTo) {    return stringFromCFAbsoluteTime((CFDataRef)value);  }  if (CFGetTypeID(value) == CFNumberGetTypeID()) {    return stringFromCFNumber((CFDataRef)value,                              CFNumberGetType((CFNumberRef)value));  } else if (CFGetTypeID(value) == CFStringGetTypeID()) {    return stringFromCFString((CFStringRef)value);  } else if (CFGetTypeID(value) == CFBooleanGetTypeID()) {    return (CFBooleanGetValue((CFBooleanRef)value)) ? "1" : "0";  } else if (CFGetTypeID(value) == CFUUIDGetTypeID()) {    return stringFromCFString(        CFUUIDCreateString(kCFAllocatorDefault, (CFUUIDRef)value));  }  return "";}
开发者ID:PoppySeedPlehzr,项目名称:osquery,代码行数:25,


示例6: jsUndefined

JSValue *UserObjectImp::toPrimitive(ExecState *exec, JSType preferredType) const{    JSValue *result = jsUndefined();    JSUserObject* jsObjPtr = KJSValueToJSObject(toObject(exec), exec);    CFTypeRef cfValue = jsObjPtr ? jsObjPtr->CopyCFValue() : 0;    if (cfValue) {        CFTypeID cfType = CFGetTypeID(cfValue);  // toPrimitive        if (cfValue == GetCFNull()) {            result = jsNull();        }        else if (cfType == CFBooleanGetTypeID()) {            if (cfValue == kCFBooleanTrue) {                result = jsBoolean(true);            } else {                result = jsBoolean(false);            }        } else if (cfType == CFStringGetTypeID()) {            result = jsString(CFStringToUString((CFStringRef)cfValue));        } else if (cfType == CFNumberGetTypeID()) {            double d = 0.0;            CFNumberGetValue((CFNumberRef)cfValue, kCFNumberDoubleType, &d);            result = jsNumber(d);        } else if (cfType == CFURLGetTypeID()) {            CFURLRef absURL = CFURLCopyAbsoluteURL((CFURLRef)cfValue);            if (absURL) {                result = jsString(CFStringToUString(CFURLGetString(absURL)));                ReleaseCFType(absURL);            }        }        ReleaseCFType(cfValue);    }    if (jsObjPtr)        jsObjPtr->Release();    return result;}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:35,


示例7: EnableExtendedLogging

void EnableExtendedLogging(SDMMD_AMDeviceRef device){	sdmmd_return_t result = SDMMD_AMDeviceConnect(device);	if (SDM_MD_CallSuccessful(result)) {		result = SDMMD_AMDeviceStartSession(device);		if (SDM_MD_CallSuccessful(result)) {			CFTypeRef value = SDMMD_AMDeviceCopyValue(device, CFSTR(AMSVC_MOBILE_DEBUG), CFSTR(kEnableLockdownExtendedLogging));			if (CFGetTypeID(value) == CFBooleanGetTypeID()) {				if (!CFBooleanGetValue(value)) {					result = SDMMD_AMDeviceSetValue(device, CFSTR(AMSVC_MOBILE_DEBUG), CFSTR(kEnableLockdownExtendedLogging), kCFBooleanTrue);					if (SDM_MD_CallSuccessful(result)) {						printf("Enabling extended logging.../n");					}				}				else {					printf("Extended logging already enabled./n");				}			}			else {				PrintCFType(value);			}			CFSafeRelease(value);		}		SDMMD_AMDeviceStopSession(device);		SDMMD_AMDeviceDisconnect(device);	}}
开发者ID:K0smas,项目名称:SDMMobileDevice,代码行数:27,


示例8: CopyCFTypeValue

void	CASettingsStorage::CopyBoolValue(CFStringRef inKey, bool& outValue, bool inDefaultValue) const{	//	initialize the return value	outValue = inDefaultValue;		//	get the raw value	CFTypeRef theValue = NULL;	CopyCFTypeValue(inKey, theValue, NULL);		//	for this type, NULL is an invalid value	if(theValue != NULL)	{		//	bools can be made from either CFBooleans or CFNumbers		if(CFGetTypeID(theValue) == CFBooleanGetTypeID())		{			//	get the return value from the CF object			outValue = CFBooleanGetValue(static_cast<CFBooleanRef>(theValue));		}		else if(CFGetTypeID(theValue) == CFNumberGetTypeID())		{			//	get the numeric value			SInt32 theNumericValue = 0;			CFNumberGetValue(static_cast<CFNumberRef>(theValue), kCFNumberSInt32Type, &theNumericValue);						//	non-zero indicates true			outValue = theNumericValue != 0;		}				//	release the value since we aren't returning it		CFRelease(theValue);	}}
开发者ID:11020156,项目名称:SampleCode,代码行数:32,


示例9: getBool

////////////////////////////////////////////////////////////////////////////Boolean //////////////////////////////////////////////////////////////////////////BooleangetBool(CFTypeRef preference, Boolean* boolean){	Boolean ret = FALSE;	if (!preference)		return FALSE;	if (CFGetTypeID(preference) == CFBooleanGetTypeID()) {		ret = TRUE;		*boolean = CFBooleanGetValue((CFBooleanRef) preference);	}	else if (CFGetTypeID(preference) == CFStringGetTypeID()) {		if (!CFStringCompare((CFStringRef)preference, Yes, kCFCompareCaseInsensitive)) {			ret = TRUE;			*boolean = TRUE;		}		else if (!CFStringCompare((CFStringRef)preference, No, kCFCompareCaseInsensitive)) {			ret = TRUE;			*boolean = FALSE;		}		else if (!CFStringCompare((CFStringRef)preference, True, kCFCompareCaseInsensitive)) {			ret = TRUE;			*boolean = TRUE;		}		else if (!CFStringCompare((CFStringRef)preference, False, kCFCompareCaseInsensitive)) {			ret = TRUE;			*boolean = FALSE;		}	}	return ret;}
开发者ID:NSOiO,项目名称:freequartz,代码行数:36,


示例10: printObj

static void printObj(CFPropertyListRef obj, struct printContext* c) {	CFTypeID typeID = CFGetTypeID(obj);	if (typeID == _CFKeyedArchiverUIDGetTypeID()) {		unsigned uid = _CFKeyedArchiverUIDGetValue(obj);		CFPropertyListRef refObj = CFArrayGetValueAtIndex(c->objs, uid);		if (CFEqual(refObj, CFSTR("$null")))			printf("nil");		else if (c->refCount[uid] > 1 && isComplexObj(refObj))			printf("{CF$UID = %u;}", uid);		else			printObj(refObj, c);	} else if (typeID == CFArrayGetTypeID()) {		printf("(/n");		++ c->tabs;		CFArrayApplyFunction(obj, CFRangeMake(0, CFArrayGetCount(obj)), (CFArrayApplierFunction)&printObjAsArrayEntry, c);		-- c->tabs;		for (unsigned i = 0; i < c->tabs; ++ i)			printf("/t");		printf(")");	} else if (typeID == CFDictionaryGetTypeID()) {		CFStringRef className = CFDictionaryGetValue(obj, CFSTR("$classname"));		if (className != NULL)			printObjAsClassName(className);		else {			printf("{/n");			++ c->tabs;			CFIndex dictCount = CFDictionaryGetCount(obj);						struct dictionarySorterContext sc;			sc.keys = malloc(sizeof(CFStringRef)*dictCount);			sc.values = malloc(sizeof(CFPropertyListRef)*dictCount);			unsigned* mapping = malloc(sizeof(unsigned)*dictCount);			for (unsigned i = 0; i < dictCount; ++ i)				mapping[i] = i;			CFDictionaryGetKeysAndValues(obj, (const void**)sc.keys, sc.values);			qsort_r(mapping, dictCount, sizeof(unsigned), &sc, (int(*)(void*,const void*,const void*))&dictionaryComparer);			for (unsigned i = 0; i < dictCount; ++ i)				printObjAsDictionaryEntry(sc.keys[mapping[i]], sc.values[mapping[i]], c);			free(mapping);			free(sc.keys);			free(sc.values);			-- c->tabs;			for (unsigned i = 0; i < c->tabs; ++ i)				printf("/t");			printf("}");		}	} else if (typeID == CFDataGetTypeID())		printObjAsData(obj);	else if (typeID == CFNumberGetTypeID())		printObjAsNumber(obj);	else if (typeID == CFStringGetTypeID())		printObjAsString(obj);	else if (typeID == CFBooleanGetTypeID())		printf(CFBooleanGetValue(obj) ? "true" : "false");	else if (typeID == CFDateGetTypeID()) 		printf("/*date*/ %0.09g", CFDateGetAbsoluteTime(obj));}
开发者ID:bu2,项目名称:networkpx,代码行数:58,


示例11: InternSettings

static void InternSettings(CFDictionaryRef srcDict, MySettings* settings){    CFTypeRef dictValue;        if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyHaveSelection)) &&        (CFGetTypeID(dictValue) == CFBooleanGetTypeID()))            settings->mHaveSelection = CFBooleanGetValue((CFBooleanRef)dictValue);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyHaveFrames)) &&        (CFGetTypeID(dictValue) == CFBooleanGetTypeID()))            settings->mHaveFrames = CFBooleanGetValue((CFBooleanRef)dictValue);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyHaveFrameSelected)) &&        (CFGetTypeID(dictValue) == CFBooleanGetTypeID()))            settings->mHaveFrameSelected = CFBooleanGetValue((CFBooleanRef)dictValue);        if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyPrintFrameType)) &&        (CFGetTypeID(dictValue) == CFStringGetTypeID())) {        if (CFEqual(dictValue, kPDEValueFramesAsIs))            settings->mPrintFrameAsIs = true;        else if (CFEqual(dictValue, kPDEValueSelectedFrame))            settings->mPrintSelectedFrame = true;        else if (CFEqual(dictValue, kPDEValueEachFrameSep))            settings->mPrintFramesSeparately = true;    }    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyPrintSelection)) &&        (CFGetTypeID(dictValue) == CFBooleanGetTypeID()))            settings->mPrintSelection = CFBooleanGetValue((CFBooleanRef)dictValue);     if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyShrinkToFit)) &&        (CFGetTypeID(dictValue) == CFBooleanGetTypeID()))            settings->mShrinkToFit = CFBooleanGetValue((CFBooleanRef)dictValue);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyPrintBGColors)) &&        (CFGetTypeID(dictValue) == CFBooleanGetTypeID()))            settings->mPrintBGColors = CFBooleanGetValue((CFBooleanRef)dictValue);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyPrintBGImages)) &&        (CFGetTypeID(dictValue) == CFBooleanGetTypeID()))            settings->mPrintBGImages = CFBooleanGetValue((CFBooleanRef)dictValue);            if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyHeaderLeft)) &&        (CFGetTypeID(dictValue) == CFStringGetTypeID()))            settings->mHeaderLeft = MyCFAssign(dictValue, settings->mHeaderLeft);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyHeaderCenter)) &&        (CFGetTypeID(dictValue) == CFStringGetTypeID()))            settings->mHeaderCenter = MyCFAssign(dictValue, settings->mHeaderCenter);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyHeaderRight)) &&        (CFGetTypeID(dictValue) == CFStringGetTypeID()))            settings->mHeaderRight = MyCFAssign(dictValue, settings->mHeaderRight);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyFooterLeft)) &&        (CFGetTypeID(dictValue) == CFStringGetTypeID()))            settings->mFooterLeft = MyCFAssign(dictValue, settings->mFooterLeft);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyFooterCenter)) &&        (CFGetTypeID(dictValue) == CFStringGetTypeID()))            settings->mFooterCenter = MyCFAssign(dictValue, settings->mFooterCenter);    if ((dictValue = CFDictionaryGetValue(srcDict, kPDEKeyFooterRight)) &&        (CFGetTypeID(dictValue) == CFStringGetTypeID()))            settings->mFooterRight = MyCFAssign(dictValue, settings->mFooterRight);}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:59,


示例12: __attribute__

__attribute__((constructor)) void Init_TSICTString(void){    kCFDataTypeID        = CFDataGetTypeID();    kCFStringTypeID      = CFStringGetTypeID();    kCFNumberTypeID      = CFNumberGetTypeID();    kCFBooleanTypeID     = CFBooleanGetTypeID();    kCFNullTypeID        = CFNullGetTypeID();    kCFArrayTypeID       = CFArrayGetTypeID();    kCFDictionaryTypeID  = CFDictionaryGetTypeID();}
开发者ID:4justinstewart,项目名称:Polity,代码行数:10,


示例13: init_log

static voidinit_log(void){    static dispatch_once_t once = 0;    dispatch_once(&once, ^{	    CFBooleanRef b;	    b = CFPreferencesCopyAppValue(CFSTR("EnableDebugging"),					  CFSTR("com.apple.MITKerberosShim"));	    if (b && CFGetTypeID(b) == CFBooleanGetTypeID())		do_log = CFBooleanGetValue(b);    });
开发者ID:heimdal,项目名称:MKShim,代码行数:11,


示例14: GetValue

CFBooleanRef SFB::Audio::Metadata::GetCompilation() const{	CFTypeRef value = GetValue(kCompilationKey);		if(nullptr == value)		return nullptr;	if(CFBooleanGetTypeID() != CFGetTypeID(value))		return nullptr;	else		return (CFBooleanRef)value;}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:12,


示例15: getBoolForKey

static bool getBoolForKey(CFDictionaryRef dict, CFStringRef key, bool default_value) {	CFTypeRef value = CFDictionaryGetValue(dict, key);	if (value) {		if (CFGetTypeID(value) == CFBooleanGetTypeID()) {			return CFBooleanGetValue(value);		} else {			secwarning("Value %@ for key %@ is not bool", value, key);		}	}    	return default_value;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:12,


示例16: plist_get_node_type

/** * Get the #plist_type of a node. * * @param node the node * @return the type of the node */plist_type plist_get_node_type(plist_t node){	if (!node)		return PLIST_NONE;	CFTypeID type = CFGetTypeID(node);	if (type == CFArrayGetTypeID())		return PLIST_ARRAY;	else if (type == CFDictionaryGetTypeID())		return PLIST_DICT;	else if (type == CFStringGetTypeID())		return PLIST_STRING;	else if (type == CFDataGetTypeID())		return PLIST_DATA;	else if (type == CFBooleanGetTypeID())		return PLIST_BOOLEAN;	else if (type == CFDateGetTypeID())		return PLIST_DATE;	else if (type == CFNumberGetTypeID()) {		CFTypeID numType = CFNumberGetType(node);		switch (numType) {			case kCFNumberFloat32Type:			case kCFNumberFloat64Type:			case kCFNumberFloatType:			case kCFNumberDoubleType:				return PLIST_REAL;				break;			case kCFNumberSInt8Type:			case kCFNumberSInt16Type:			case kCFNumberSInt32Type:			case kCFNumberSInt64Type:			case kCFNumberCharType:			case kCFNumberShortType:			case kCFNumberIntType:				return PLIST_UINT;				break;			default:				return PLIST_NONE;				break;		}	}	return PLIST_NONE;}
开发者ID:aburgh,项目名称:usbmuxd,代码行数:58,


示例17: SecTaskGetBooleanValueForEntitlement

static bool SecTaskGetBooleanValueForEntitlement(SecTaskRef task,    CFStringRef entitlement) {#if CHECK_ENTITLEMENTS    CFStringRef canModify = (CFStringRef)SecTaskCopyValueForEntitlement(task,        entitlement, NULL);    if (!canModify)        return false;    CFTypeID canModifyType = CFGetTypeID(canModify);    bool ok = (CFBooleanGetTypeID() == canModifyType) && CFBooleanGetValue((CFBooleanRef)canModify);    CFRelease(canModify);    return ok;#else    return true;#endif /* !CHECK_ENTITLEMENTS */}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:15,


示例18: CFPreferencesAppBooleanValue

CF_EXPORT Boolean CFPreferencesAppBooleanValue(CFStringRef key, CFStringRef appName, Boolean *keyExistsAndHasValidFormat) {    CFPropertyListRef value;    Boolean result, valid;    CFTypeID typeID = 0;    CFAssert1(appName != NULL, __kCFLogAssertion, "%s(): Cannot access application preferences with a NULL application name", __PRETTY_FUNCTION__);    CFAssert1(key != NULL, __kCFLogAssertion, "%s(): Cannot access preferences with a NULL key", __PRETTY_FUNCTION__);    if (!keyExistsAndHasValidFormat) {        keyExistsAndHasValidFormat = &valid;    }    value = CFPreferencesCopyAppValue(key, appName);    if (!value) {        *keyExistsAndHasValidFormat = false;        return false;    }    typeID = CFGetTypeID(value);    if (typeID == CFStringGetTypeID()) {        if (CFStringCompare((CFStringRef)value, CFSTR("true"), kCFCompareCaseInsensitive) == kCFCompareEqualTo || CFStringCompare((CFStringRef)value, CFSTR("YES"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {            *keyExistsAndHasValidFormat = true;            result = true;        } else if (CFStringCompare((CFStringRef)value, CFSTR("false"), kCFCompareCaseInsensitive) == kCFCompareEqualTo || CFStringCompare((CFStringRef)value, CFSTR("NO"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {            *keyExistsAndHasValidFormat = true;            result = false;        } else {            *keyExistsAndHasValidFormat = false;            result = false;        }    } else if (typeID == CFNumberGetTypeID()) {        if (CFNumberIsFloatType((CFNumberRef)value)) {            *keyExistsAndHasValidFormat = false;            result = false;        } else {            int i;            *keyExistsAndHasValidFormat = true;            CFNumberGetValue((CFNumberRef)value, kCFNumberIntType, &i);            result = (i == 0) ? false : true;        }    } else if (typeID == CFBooleanGetTypeID()) {        result = (value == kCFBooleanTrue);        *keyExistsAndHasValidFormat = true;    } else {        // Unknown type        result = false;        *keyExistsAndHasValidFormat = false;    }    CFRelease(value);    return result;}
开发者ID:CoherentLabs,项目名称:CoherentWebCoreDependencies,代码行数:48,


示例19: CFGetTypeID

void mUSBHID::registerHIDProperties(CFTypeRef object){	CFTypeID type = CFGetTypeID(object);	if (type == CFArrayGetTypeID()){		registerHID_CFArray((const __CFArray*)object);	} else if (type == CFDictionaryGetTypeID()){		registerHID_CFDictionary((const __CFDictionary*)object);	} else if (type == CFBooleanGetTypeID()){		//MyCFBoolean(object);	} else if (type == CFNumberGetTypeID()){		//MyCFNumberShow(object);	} else if (type == CFStringGetTypeID()){		//MyCFStringShow(object);	} else{		//mprintf("<unknown hid object>");	}}
开发者ID:BramVerhoef,项目名称:mworks,代码行数:16,


示例20: MyBurnSessionDeviceCheckCallBack

static BooleanMyBurnSessionDeviceCheckCallBack(DRBurnSessionRef burnSession, DRDeviceRef device){    #pragma unused(burnSession)        CFDictionaryRef deviceDict;    CFDictionaryRef writeCapDict;    CFBooleanRef canWriteDVDRAM;    CFStringRef vendorName;    CFStringRef productName;    char vendor[256];    char product[256];    Boolean showDeviceInList;        /* DRDeviceCopyInfo will return information that identifies the device and describes its    capabilities. The information includes the vendor's name, the product identifier, whether     the device can burn CDs or DVDs, and so on. */    deviceDict = DRDeviceCopyInfo(device);    assert(deviceDict != NULL);            vendorName = CFDictionaryGetValue(deviceDict, kDRDeviceVendorNameKey);    assert((vendorName != NULL) && (CFGetTypeID(vendorName) == CFStringGetTypeID()));        productName = CFDictionaryGetValue(deviceDict, kDRDeviceProductNameKey);    assert((productName != NULL) && (CFGetTypeID(productName) == CFStringGetTypeID()));            if (CFStringGetCString(vendorName, vendor, sizeof(vendor), kCFStringEncodingASCII)) {        if (CFStringGetCString(productName, product, sizeof(product), kCFStringEncodingASCII)) {                    fprintf(stderr, "%s ", vendor);            fprintf(stderr, "%s Checked./n", product);        }    }        writeCapDict = CFDictionaryGetValue(deviceDict, kDRDeviceWriteCapabilitiesKey);    assert((writeCapDict != NULL) && (CFGetTypeID(writeCapDict) == CFDictionaryGetTypeID()));        canWriteDVDRAM = CFDictionaryGetValue(writeCapDict, kDRDeviceCanWriteDVDRAMKey);    assert((canWriteDVDRAM != NULL) && (CFGetTypeID(canWriteDVDRAM) == CFBooleanGetTypeID()));    // Don't show DVD-RAM drives in the list.    showDeviceInList = !CFBooleanGetValue(canWriteDVDRAM);    CFRelease(deviceDict);        return showDeviceInList;}
开发者ID:arnelh,项目名称:Examples,代码行数:46,


示例21: statusMessage

/** * Records the success or failure or a particular service. * If no service name is specified, but a pid is, then all services provided * by the item are flagged. **/static void statusMessage (StartupContext aStartupContext, CFDictionaryRef anIPCMessage){    if (anIPCMessage && aStartupContext && aStartupContext->aStatusDict)      {        CFMutableDictionaryRef anItem       = itemFromIPCMessage(aStartupContext, anIPCMessage);        CFStringRef            aServiceName = CFDictionaryGetValue(anIPCMessage, kIPCServiceNameKey);        CFBooleanRef	       aStatus      = CFDictionaryGetValue(anIPCMessage, kIPCStatusKey);                if (anItem && aStatus &&             CFGetTypeID(aStatus) == CFBooleanGetTypeID() &&            (!aServiceName || CFGetTypeID(aServiceName) == CFStringGetTypeID()))          {            StartupItemSetStatus(aStartupContext->aStatusDict, anItem, aServiceName, CFBooleanGetValue(aStatus), TRUE);            displayProgress(aStartupContext->aDisplayContext, ((float)CFDictionaryGetCount(aStartupContext->aStatusDict)/((float)aStartupContext->aServicesCount + 1.0)));          }      }}
开发者ID:aosm,项目名称:Startup,代码行数:22,


示例22: switch

//// Process % scan forms.// This delivers the object value, scanf-style, somehow.//bool CFScan::scanformat(CFTypeRef obj){	switch (*++format) {	case F_OBJECT:		store<CFTypeRef>(obj);		return true;	case F_ARRAY:	// %a*		return typescan(obj, CFArrayGetTypeID()) == done;	case F_BOOLEAN:		if (Typescan rc = typescan(obj, CFBooleanGetTypeID()))			return rc == done;		switch (*format) {		case 'f':	// %Bf - two arguments (value, &variable)			{				unsigned flag = va_arg(args, unsigned);				unsigned *value = va_arg(args, unsigned *);				if (obj == kCFBooleanTrue && !suppress)					*value |= flag;				return true;			}		default:	// %b - CFBoolean as int boolean			store<int>(obj == kCFBooleanTrue);			return true;		}	case F_DICTIONARY:		return typescan(obj, CFDictionaryGetTypeID()) == done;	case 'd':	// %d - int		return scannumber<int>(obj);	case F_NUMBER:		return typescan(obj, CFNumberGetTypeID()) == done;	case F_STRING:	case 's':		if (Typescan rc = typescan(obj, CFStringGetTypeID()))			return rc == done;		// %s		store<std::string>(cfString(CFStringRef(obj)));		return true;	case 'u':		return scannumber<unsigned int>(obj);	case F_DATA:		return typescan(obj, CFDataGetTypeID()) == done;	default:		assert(false);		return false;	}}
开发者ID:Apple-FOSS-Mirror,项目名称:Security,代码行数:50,


示例23: security_auth_verbose

static boolsecurity_auth_verbose(void){    static dispatch_once_t onceToken;    static bool verbose_enabled = false;        //sudo defaults write /Library/Preferences/com.apple.authd verbose -bool true    dispatch_once(&onceToken, ^{		CFTypeRef verbose = (CFNumberRef)CFPreferencesCopyValue(CFSTR("verbose"), CFSTR(SECURITY_AUTH_NAME), kCFPreferencesAnyUser, kCFPreferencesCurrentHost);                if (verbose && CFGetTypeID(verbose) == CFBooleanGetTypeID()) {            verbose_enabled = CFBooleanGetValue((CFBooleanRef)verbose);        }#if DEBUG        syslog(LOG_NOTICE, "verbose: %s", verbose_enabled ? "enabled" : "disabled");#endif        CFReleaseSafe(verbose);    });
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:18,


示例24: genOSXPrefValues

void genOSXPrefValues(const CFTypeRef& value,                      const Row& base,                      QueryData& results,                      size_t depth) {  if (value == nullptr) {    return;  }  // Since we recurse when parsing Arrays/Dicts, monitor stack limits.  if (++depth > kPreferenceDepthLimit) {    TLOG << "The macOS preference: " << base.at("domain")         << " exceeded subkey depth limit: " << kPreferenceDepthLimit;    return;  }  // Emit a string representation for each preference type.  Row r = base;  if (CFGetTypeID(value) == CFNumberGetTypeID()) {    r["value"] = stringFromCFNumber(static_cast<CFDataRef>(value));  } else if (CFGetTypeID(value) == CFStringGetTypeID()) {    r["value"] = stringFromCFString(static_cast<CFStringRef>(value));  } else if (CFGetTypeID(value) == CFDateGetTypeID()) {    auto unix_time = CFDateGetAbsoluteTime(static_cast<CFDateRef>(value)) +                     kCFAbsoluteTimeIntervalSince1970;    r["value"] = boost::lexical_cast<std::string>(std::llround(unix_time));  } else if (CFGetTypeID(value) == CFBooleanGetTypeID()) {    r["value"] = (CFBooleanGetValue(static_cast<CFBooleanRef>(value)) == TRUE)                     ? "true"                     : "false";  } else if (CFGetTypeID(value) == CFDataGetTypeID()) {    // Do not include data preferences.  } else if (CFGetTypeID(value) == CFArrayGetTypeID()) {    genOSXListPref(static_cast<CFArrayRef>(value), base, results, depth);    return;  } else if (CFGetTypeID(value) == CFDictionaryGetTypeID()) {    // Generate a row for each hash key.    TRowResults trow(base, results, depth);    CFDictionaryApplyFunction(        static_cast<CFDictionaryRef>(value), &genOSXHashPref, &trow);    return;  }  results.push_back(std::move(r));}
开发者ID:theopolis,项目名称:osquery,代码行数:44,


示例25: cf_hash_to_rb_hash

static void cf_hash_to_rb_hash(const void *raw_key, const void * raw_value, void *ctx){  CFTypeRef value = (CFTypeRef)raw_value;  CFStringRef key = (CFStringRef)raw_key;  VALUE rubyValue = Qnil;  VALUE hash = (VALUE)ctx;  if(CFStringGetTypeID() == CFGetTypeID(value)){    rubyValue = cfstring_to_rb_string((CFStringRef)value);  }  else if(CFDataGetTypeID() == CFGetTypeID(value)){    CFDataRef data = (CFDataRef)value;    rubyValue = rb_enc_str_new((const char*)CFDataGetBytePtr(data),CFDataGetLength(data), rb_ascii8bit_encoding());  }  else if(CFBooleanGetTypeID() == CFGetTypeID(value)){    Boolean booleanValue = CFBooleanGetValue(value);    rubyValue = booleanValue ? Qtrue : Qfalse;  }  else if(CFNumberGetTypeID() == CFGetTypeID(value)){    if(CFNumberIsFloatType(value))    {      double doubleValue;      CFNumberGetValue(value, kCFNumberDoubleType, &doubleValue);      rubyValue = rb_float_new(doubleValue);    }else{      long long longValue;      CFNumberGetValue(value, kCFNumberLongLongType, &longValue);      rubyValue = LL2NUM(longValue);    }  }  else if (CFDateGetTypeID() == CFGetTypeID(value)){    CFDateRef date = (CFDateRef) value;    CFAbsoluteTime abs_time = CFDateGetAbsoluteTime(date);    double secondsSinceUnixEpoch = abs_time + kCFAbsoluteTimeIntervalSince1970;    time_t seconds = (time_t)secondsSinceUnixEpoch;    long usec = (secondsSinceUnixEpoch - seconds) * 1000000;    rubyValue = rb_time_new((time_t)secondsSinceUnixEpoch, usec);  }  if(!NIL_P(rubyValue)){    rb_hash_aset(hash, cfstring_to_rb_string(key), rubyValue);  }}
开发者ID:fcheung,项目名称:keychain_c,代码行数:43,


示例26: get_mac_x11_prop

/*    eats it */static int get_mac_x11_prop(char *keystr) {    CFPropertyListRef ret;    CFStringRef key, appID;    int val;    appID = CFStringCreateWithBytes(NULL,(uint8 *) "com.apple.x11",strlen("com.apple.x11"), kCFStringEncodingISOLatin1, 0);    key   = CFStringCreateWithBytes(NULL,(uint8 *) keystr,strlen(keystr), kCFStringEncodingISOLatin1, 0);    ret = CFPreferencesCopyAppValue(key,appID);    if ( ret==NULL ) {	/* Sigh. Apple uses a different preference file under 10.5.6 I really */	/*  wish they'd stop making stupid, unnecessary changes */	appID = CFStringCreateWithBytes(NULL,(uint8 *) "org.x.X11",strlen("org.x.X11"), kCFStringEncodingISOLatin1, 0);	ret = CFPreferencesCopyAppValue(key,appID);    }    if ( ret==NULL )return( -1 );    if ( CFGetTypeID(ret)!=CFBooleanGetTypeID())return( -2 );    val = CFBooleanGetValue(ret);    CFRelease(ret);return( val );}
开发者ID:MichinariNukazawa,项目名称:fontforge,代码行数:23,


示例27: CGCFDictionaryGetBoolean

BooleanCGCFDictionaryGetBoolean(CFDictionaryRef theDict, CFStringRef key, Boolean* boolean){	Boolean ret;	CFTypeRef type;	if (!theDict || !key)		return FALSE;	type = (CFTypeRef)CFDictionaryGetValue(theDict, (const void*)key);	if (type && CFGetTypeID(type) == CFBooleanGetTypeID())	{		ret = TRUE;		if (boolean)		{			*boolean = CFBooleanGetValue((CFBooleanRef)type) != 0;		}	}	else	{		ret = FALSE;	}}
开发者ID:NSOiO,项目名称:freequartz,代码行数:23,


示例28: CFSTR

uint32 CommonBlob::getCurrentVersion() {    uint32 ret = version_MacOS_10_0;    // If the integrity protections are turned on, use version_partition.    // else, use version_MacOS_10_0.    CFTypeRef integrity = (CFNumberRef)CFPreferencesCopyValue(CFSTR("KeychainIntegrity"), CFSTR("com.apple.security"), kCFPreferencesAnyUser, kCFPreferencesCurrentHost);    if (integrity && CFGetTypeID(integrity) == CFBooleanGetTypeID()) {        bool integrityProtections = CFBooleanGetValue((CFBooleanRef)integrity);        if(integrityProtections) {            secnotice("integrity", "creating a partition keychain; global is on");            ret = version_partition;        } else {            secnotice("integrity", "creating a old-style keychain; global is off");            ret = version_MacOS_10_0;        }    } else {        secnotice("integrity", "global integrity not set, defaulting to on");        ret = version_partition;    }    CFReleaseSafe(integrity);    return ret;}
开发者ID:darlinghq,项目名称:darling-security,代码行数:23,


示例29: if

bool	CACFArray::GetBool(UInt32 inIndex, bool& outValue) const{	bool theAnswer = false;		CFTypeRef theValue = NULL;	if(GetCFType(inIndex, theValue))	{		if((theValue != NULL) && (CFGetTypeID(theValue) == CFBooleanGetTypeID()))		{			outValue = CFBooleanGetValue(static_cast<CFBooleanRef>(theValue));			theAnswer = true;		}		else if((theValue != NULL) && (CFGetTypeID(theValue) == CFNumberGetTypeID()))		{			SInt32 theNumericValue = 0;			CFNumberGetValue(static_cast<CFNumberRef>(theValue), kCFNumberSInt32Type, &theNumericValue);			outValue = theNumericValue != 0;			theAnswer = true;		}	}		return theAnswer;}
开发者ID:Michael-Lfx,项目名称:iOS,代码行数:23,



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


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