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

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

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

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

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

示例1: __CFArrayCopyDescription

static CFStringRef __CFArrayCopyDescription(CFTypeRef cf) {    CFArrayRef array = (CFArrayRef)cf;    CFMutableStringRef result;    const CFArrayCallBacks *cb;    CFAllocatorRef allocator;    CFIndex idx, cnt;    cnt = __CFArrayGetCount(array);    allocator = CFGetAllocator(array);    result = CFStringCreateMutable(allocator, 0);    switch (__CFArrayGetType(array)) {    case __kCFArrayImmutable:	CFStringAppendFormat(result, NULL, CFSTR("<CFArray %p [%p]>{type = immutable, count = %lu, values = (%s"), cf, allocator, (unsigned long)cnt, cnt ? "/n" : "");	break;    case __kCFArrayDeque:	CFStringAppendFormat(result, NULL, CFSTR("<CFArray %p [%p]>{type = mutable-small, count = %lu, values = (%s"), cf, allocator, (unsigned long)cnt, cnt ? "/n" : "");	break;    }    cb = __CFArrayGetCallBacks(array);    for (idx = 0; idx < cnt; idx++) {	CFStringRef desc = NULL;	const void *val = __CFArrayGetBucketAtIndex(array, idx)->_item;	if (NULL != cb->copyDescription) {	    desc = (CFStringRef)INVOKE_CALLBACK1(cb->copyDescription, val);	}	if (NULL != desc) {	    CFStringAppendFormat(result, NULL, CFSTR("/t%lu : %@/n"), (unsigned long)idx, desc);	    CFRelease(desc);	} else {	    CFStringAppendFormat(result, NULL, CFSTR("/t%lu : <%p>/n"), (unsigned long)idx, val);	}    }    CFStringAppend(result, CFSTR(")}"));    return result;}
开发者ID:goodcyg,项目名称:swift-corelibs-foundation,代码行数:34,


示例2: rlsCopyDescription

static CFStringRefrlsCopyDescription(const void *info){	CFMutableStringRef		result;	SCDynamicStoreRef		store		= (SCDynamicStoreRef)info;	SCDynamicStorePrivateRef	storePrivate	= (SCDynamicStorePrivateRef)store;	result = CFStringCreateMutable(NULL, 0);	CFStringAppendFormat(result, NULL, CFSTR("<SCDynamicStore RLS> {"));	CFStringAppendFormat(result, NULL, CFSTR("store = %p"), store);	if (storePrivate->notifyStatus == Using_NotifierInformViaRunLoop) {		CFStringRef	description	= NULL;		CFStringAppendFormat(result, NULL, CFSTR(", callout = %p"), storePrivate->rlsFunction);		if ((storePrivate->rlsContext.info != NULL) && (storePrivate->rlsContext.copyDescription != NULL)) {			description = (*storePrivate->rlsContext.copyDescription)(storePrivate->rlsContext.info);		}		if (description == NULL) {			description = CFStringCreateWithFormat(NULL, NULL, CFSTR("<SCDynamicStore context %p>"), storePrivate->rlsContext.info);		}		if (description == NULL) {			description = CFRetain(CFSTR("<no description>"));		}		CFStringAppendFormat(result, NULL, CFSTR(", context = %@"), description);		CFRelease(description);	}	CFStringAppendFormat(result, NULL, CFSTR("}"));	return result;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:31,


示例3: ipv6_duplicated_address

__private_extern__voidipv6_duplicated_address(const char * if_name, const struct in6_addr * addr,			int hw_len, const void * hw_addr){	uint8_t	*		hw_addr_bytes = (uint8_t *)hw_addr;	int			i;	CFStringRef		if_name_cf;	CFMutableStringRef	key;	char			ntopbuf[INET6_ADDRSTRLEN];	CFStringRef		prefix;	if_name_cf = CFStringCreateWithCString(NULL, if_name,					       kCFStringEncodingASCII);	prefix = SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL,							       kSCDynamicStoreDomainState,							       if_name_cf,							       kSCEntNetIPv6DuplicatedAddress);	ntopbuf[0] = '/0';	(void)inet_ntop(AF_INET6, addr, ntopbuf, sizeof(ntopbuf));	key = CFStringCreateMutableCopy(NULL, 0, prefix);	CFStringAppendFormat(key, NULL, CFSTR("/%s"), ntopbuf);	for (i = 0; i < hw_len; i++) {	    CFStringAppendFormat(key, NULL, CFSTR("%s%02x"),				 (i == 0) ? "/" : ":", hw_addr_bytes[i]);	}	cache_SCDynamicStoreNotifyValue(store, key);	CFRelease(key);	CFRelease(prefix);	CFRelease(if_name_cf);}
开发者ID:carriercomm,项目名称:osx-2,代码行数:31,


示例4: __CFSetCopyDescription

static CFStringRef __CFSetCopyDescription(CFTypeRef cf) {    CFSetRef set = (CFSetRef)cf;    const CFSetCallBacks *cb;    const struct __CFSetBucket *buckets;    CFIndex idx, nbuckets;    CFMutableStringRef result;    cb = __CFSetGetCallBacks(set);    buckets = set->_buckets;    nbuckets = set->_bucketsNum;    result = CFStringCreateMutable(kCFAllocatorSystemDefault, 0);    CFStringAppendFormat(result, NULL, CFSTR("<CFSet %p [%p]>{count = %u, capacity = %u, values = (/n"), set, CFGetAllocator(set), set->_count, set->_capacity);    for (idx = 0; idx < nbuckets; idx++) {	if (__CFSetBucketIsOccupied(set, &buckets[idx])) {	    CFStringRef desc = NULL;	    if (NULL != cb->copyDescription) {		desc = (CFStringRef)INVOKE_CALLBACK2(((CFStringRef (*)(const void *, void *))cb->copyDescription), buckets[idx]._key, set->_context);	    }	    if (NULL != desc) {		CFStringAppendFormat(result, NULL, CFSTR("/t%u : %@/n"), idx, desc, NULL);		CFRelease(desc);	    } else {		CFStringAppendFormat(result, NULL, CFSTR("/t%u : <%p>/n"), idx, buckets[idx]._key, NULL);	    }	}    }    CFStringAppend(result, CFSTR(")}"));    return result;}
开发者ID:0x4d52,项目名称:JavaScriptCore-X,代码行数:28,


示例5: format_message

static VALUEformat_message(VALUE exc){    CFMutableStringRef result = CFStringCreateMutable(NULL, 0);    VALUE message = rb_vm_call(exc, sel_registerName("message"), 0, NULL);    VALUE bt = rb_vm_call(exc, sel_registerName("backtrace"), 0, NULL);    message = rb_check_string_type(message);    const char *msg = message == Qnil ? "" : RSTRING_PTR(message);    const long count = (bt != Qnil ? RARRAY_LEN(bt) : 0);    if (count > 0) {	for (long i = 0; i < count; i++) {	    const char *bte = RSTRING_PTR(RARRAY_AT(bt, i));	    if (i == 0) {		CFStringAppendFormat(result, NULL, CFSTR("%s: %s (%s)/n"),		    bte, msg, rb_class2name(*(VALUE *)exc));	    }	    else {		CFStringAppendFormat(result, NULL, CFSTR("/tfrom %s/n"), bte);	    }	}    }    else {	CFStringAppendFormat(result, NULL, CFSTR("%s (%s)/n"),	    msg, rb_class2name(*(VALUE *)exc));    }    CFMakeCollectable(result);    return (VALUE)result;}
开发者ID:1nueve,项目名称:MacRuby,代码行数:30,


示例6: __CFBinaryHeapCopyDescription

static CFStringRef __CFBinaryHeapCopyDescription(CFTypeRef cf) {    CFBinaryHeapRef heap = (CFBinaryHeapRef)cf;    CFMutableStringRef result;    CFIndex idx;    CFIndex cnt;    const void **list, *buffer[256];    cnt = __CFBinaryHeapCount(heap);    result = CFStringCreateMutable(CFGetAllocator(heap), 0);    CFStringAppendFormat(result, NULL, CFSTR("<CFBinaryHeap %p [%p]>{count = %lu, capacity = %lu, objects = (/n"), cf, CFGetAllocator(heap), (unsigned long)cnt, (unsigned long)__CFBinaryHeapCapacity(heap));    list = (cnt <= 128) ? (const void **)buffer : (const void **)CFAllocatorAllocate(kCFAllocatorSystemDefault, cnt * sizeof(void *), 0); // GC OK    if (__CFOASafe && list != buffer) __CFSetLastAllocationEventName(list, "CFBinaryHeap (temp)");    CFBinaryHeapGetValues(heap, list);    for (idx = 0; idx < cnt; idx++) {	CFStringRef desc = NULL;	const void *item = list[idx];	if (NULL != heap->_callbacks.copyDescription) {	    desc = heap->_callbacks.copyDescription(item);	}	if (NULL != desc) {	    CFStringAppendFormat(result, NULL, CFSTR("/t%lu : %@/n"), (unsigned long)idx, desc);	    CFRelease(desc);	} else {	    CFStringAppendFormat(result, NULL, CFSTR("/t%lu : <%p>/n"), (unsigned long)idx, item);	}    }    CFStringAppend(result, CFSTR(")}"));    if (list != buffer) CFAllocatorDeallocate(CFGetAllocator(heap), list); // GC OK    return result;}
开发者ID:Design-Complex,项目名称:CFLite,代码行数:29,


示例7: __CFDataCopyDescription

static CFStringRef __CFDataCopyDescription(CFTypeRef cf) {    CFDataRef data = (CFDataRef)cf;    CFMutableStringRef result;    CFIndex idx;    CFIndex len;    const uint8_t *bytes;    len = __CFDataLength(data);    bytes = CFDataGetBytePtr(data);    result = CFStringCreateMutable(CFGetAllocator(data), 0);    CFStringAppendFormat(result, NULL, CFSTR("<CFData %p [%p]>{length = %u, capacity = %u, bytes = 0x"), cf, CFGetAllocator(data), len, __CFDataCapacity(data));    if (24 < len) {        for (idx = 0; idx < 16; idx += 4) {	    CFStringAppendFormat(result, NULL, CFSTR("%02x%02x%02x%02x"), bytes[idx], bytes[idx + 1], bytes[idx + 2], bytes[idx + 3]);	}        CFStringAppend(result, CFSTR(" ... "));        for (idx = len - 8; idx < len; idx += 4) {	    CFStringAppendFormat(result, NULL, CFSTR("%02x%02x%02x%02x"), bytes[idx], bytes[idx + 1], bytes[idx + 2], bytes[idx + 3]);	}    } else {        for (idx = 0; idx < len; idx++) {	    CFStringAppendFormat(result, NULL, CFSTR("%02x"), bytes[idx]);	}    }    CFStringAppend(result, CFSTR("}"));    return result;}
开发者ID:CoherentLabs,项目名称:CoherentWebCoreDependencies,代码行数:26,


示例8: CGPathToCFStringApplierFunction

static void CGPathToCFStringApplierFunction(void* info, const CGPathElement *element){    CFMutableStringRef string = (CFMutableStringRef)info;    CFStringRef typeString = CFSTR("");    CGPoint* points = element->points;    switch (element->type) {    case kCGPathElementMoveToPoint:        CFStringAppendFormat(string, 0, CFSTR("M%.2f,%.2f "), points[0].x, points[0].y);        break;    case kCGPathElementAddLineToPoint:        CFStringAppendFormat(string, 0, CFSTR("L%.2f,%.2f "), points[0].x, points[0].y);        break;    case kCGPathElementAddQuadCurveToPoint:        CFStringAppendFormat(string, 0, CFSTR("Q%.2f,%.2f,%.2f,%.2f "),                points[0].x, points[0].y, points[1].x, points[1].y);        break;    case kCGPathElementAddCurveToPoint:        CFStringAppendFormat(string, 0, CFSTR("C%.2f,%.2f,%.2f,%.2f,%.2f,%.2f "),                points[0].x, points[0].y, points[1].x, points[1].y,                points[2].x, points[2].y);        break;    case kCGPathElementCloseSubpath:        typeString = CFSTR("X"); break;    }}
开发者ID:acss,项目名称:owb-mirror,代码行数:25,


示例9: _CFErrorCreateDebugDescription

/* The "debug" description, used by CFCopyDescription and -[NSObject description]. */CFStringRef _CFErrorCreateDebugDescription(CFErrorRef err) {    CFMutableStringRef result = CFStringCreateMutable(        kCFAllocatorSystemDefault, 0);    CFStringAppendFormat(        result, NULL,        CFSTR("Error Domain=%@ Code=%d"),        CFErrorGetDomain(err), (int)CFErrorGetCode(err));    CFDictionaryRef userInfo = _CFErrorGetUserInfo(err);    if (userInfo) {        CFStringAppendFormat(result, NULL, CFSTR(" UserInfo=%p"), userInfo);    }    CFStringRef desc = CFErrorCopyDescription(err);    if (desc) {        CFStringAppendFormat(result, NULL, CFSTR(" /"%@/""), desc);        CFRelease(desc);    }    CFStringRef debugDesc = _CFErrorCopyUserInfoKey(err, kCFErrorDebugDescriptionKey);    if (debugDesc) {        if (CFStringGetLength(debugDesc) > 0) {            CFStringAppendFormat(result, NULL, CFSTR(" (%@)"), debugDesc);        }        CFRelease(debugDesc);    }    return result;}
开发者ID:DmitrySkiba,项目名称:itoa-cleancf,代码行数:31,


示例10: userInfoKeyValueShow

/* The "debug" description, used by CFCopyDescription and -[NSObject description].*/static void userInfoKeyValueShow(const void *key, const void *value, void *context) {    CFStringRef desc;    if (CFEqual(key, kCFErrorUnderlyingErrorKey) && (desc = CFErrorCopyDescription((CFErrorRef)value))) {	// We check desc, see <rdar://problem/8415727>	CFStringAppendFormat((CFMutableStringRef)context, NULL, CFSTR("%@=%p /"%@/", "), key, value, desc); 	CFRelease(desc);    } else {	CFStringAppendFormat((CFMutableStringRef)context, NULL, CFSTR("%@=%@, "), key, value);     }}
开发者ID:cooljeanius,项目名称:opencflite-code,代码行数:11,


示例11: __SCPreferencesCopyDescription

static CFStringRef__SCPreferencesCopyDescription(CFTypeRef cf) {	CFAllocatorRef		allocator	= CFGetAllocator(cf);	SCPreferencesPrivateRef prefsPrivate	= (SCPreferencesPrivateRef)cf;	CFMutableStringRef	result;	result = CFStringCreateMutable(allocator, 0);	CFStringAppendFormat(result, NULL, CFSTR("<SCPreferences %p [%p]> {"), cf, allocator);	CFStringAppendFormat(result, NULL, CFSTR("name = %@"), prefsPrivate->name);	CFStringAppendFormat(result, NULL, CFSTR(", id = %@"), prefsPrivate->prefsID);	CFStringAppendFormat(result, NULL, CFSTR(", path = %s"),			     prefsPrivate->newPath ? prefsPrivate->newPath : prefsPrivate->path);	if (prefsPrivate->accessed) {		CFStringAppendFormat(result, NULL, CFSTR(", accessed"));	}	if (prefsPrivate->changed) {		CFStringAppendFormat(result, NULL, CFSTR(", changed"));	}	if (prefsPrivate->locked) {		CFStringAppendFormat(result, NULL, CFSTR(", locked"));	}	if (prefsPrivate->helper_port != MACH_PORT_NULL) {		CFStringAppendFormat(result, NULL, CFSTR(", helper port = 0x%x"), prefsPrivate->helper_port);	}	CFStringAppendFormat(result, NULL, CFSTR("}"));	return result;}
开发者ID:010001111,项目名称:darling,代码行数:28,


示例12: __ACSharedArtImageSourceCopyFormat

static CFStringRef __ACSharedArtImageSourceCopyFormat(CFTypeRef cf, CFDictionaryRef format){	ACSharedArtImageSourceRef isrc = (ACSharedArtImageSourceRef) cf;	CFMutableStringRef description = CFStringCreateMutable(kCFAllocatorDefault,0);	CFStringAppendFormat(description,NULL,CFSTR("Type: %d EntryCount: %d/n"),isrc->header->type,isrc->header->entryCount);	for (int i = 0; i < isrc->header->entryCount; i++)	{		struct __ACSharedArtImageHeaderDataInfo dataInfoAtIndex = isrc->header->data_info[i];		CFStringAppendFormat(description,NULL,CFSTR("/tImage %d Size: %dx%d Length: %d @ %d /n"),i,dataInfoAtIndex.width,dataInfoAtIndex.height,							 dataInfoAtIndex.length,dataInfoAtIndex.relativeOffset);	}	return (CFStringRef) description;}
开发者ID:jlazarow,项目名称:artcore,代码行数:13,


示例13: SOSCoderStart

// Start OTR negotiation if we haven't already done so.SOSCoderStatusSOSCoderStart(SOSCoderRef coder, CFErrorRef *error) {    CFMutableStringRef action = CFStringCreateMutable(kCFAllocatorDefault, 0);    CFStringRef beginState = NULL;    SOSCoderStatus result = kSOSCoderFailure;    CFMutableDataRef startPacket = NULL;    require_action_quiet(coder->sessRef, coderFailure, CFStringAppend(action, CFSTR("*** no otr session ***")));    beginState = CFCopyDescription(coder->sessRef);    require_action_quiet(!coder->waitingForDataPacket, negotiatingOut, CFStringAppend(action, CFSTR("waiting for peer to send first data packet")));    require_action_quiet(!SecOTRSGetIsReadyForMessages(coder->sessRef), coderFailure, CFStringAppend(action, CFSTR("otr session ready"));                         result = kSOSCoderDataReturned);    require_action_quiet(SecOTRSGetIsIdle(coder->sessRef), negotiatingOut, CFStringAppend(action, CFSTR("otr negotiating already")));    require_action_quiet(startPacket = CFDataCreateMutable(kCFAllocatorDefault, 0), coderFailure, SOSCreateError(kSOSErrorAllocationFailure, CFSTR("alloc failed"), NULL, error));    require_quiet(SOSOTRSAppendStartPacket(coder->sessRef, startPacket, error), coderFailure);    CFRetainAssign(coder->pendingResponse, startPacket);negotiatingOut:    result = kSOSCoderNegotiating;coderFailure:    // Uber state log    if (result == kSOSCoderFailure && error && *error)        CFStringAppendFormat(action, NULL, CFSTR(" %@"), *error);    secnotice("coder", "%@ %s %@ %@ returned %s", beginState,              SecOTRPacketTypeString(startPacket), action, coder->sessRef, SOSCoderString(result));    CFReleaseNull(startPacket);    CFReleaseSafe(beginState);    CFRelease(action);    return result;}
开发者ID:unofficial-opensource-apple,项目名称:Security,代码行数:33,


示例14: __SCBondStatusCopyDescription

static CFStringRef__SCBondStatusCopyDescription(CFTypeRef cf){	CFAllocatorRef		allocator	= CFGetAllocator(cf);	CFMutableStringRef	result;	SCBondStatusPrivateRef	statusPrivate	= (SCBondStatusPrivateRef)cf;	result = CFStringCreateMutable(allocator, 0);	CFStringAppendFormat(result, NULL, CFSTR("<SCBondStatus %p [%p]> {"), cf, allocator);	CFStringAppendFormat(result, NULL, CFSTR(" bond = %@"), statusPrivate->bond);	CFStringAppendFormat(result, NULL, CFSTR(", interface = %@"), statusPrivate->status_bond);	CFStringAppendFormat(result, NULL, CFSTR(", members = %@"),   statusPrivate->status_interfaces);	CFStringAppendFormat(result, NULL, CFSTR(" }"));	return result;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:16,


示例15: run

static int run(CFArrayRef argv) {	if (CFArrayGetCount(argv) > 1)  return -1;	CFStringRef build = DBGetCurrentBuild();	CFStringRef project = NULL;	CFDictionaryRef projectEnv = NULL;	CFDictionaryRef globalEnv = DBCopyPropDictionary(build, NULL, CFSTR("environment"));	if (CFArrayGetCount(argv) == 1) {		project = CFArrayGetValueAtIndex(argv, 0);		projectEnv = DBCopyPropDictionary(build, project, CFSTR("environment"));	}		CFMutableDictionaryRef env = NULL;		if (globalEnv && projectEnv) {		env = (CFMutableDictionaryRef)mergeDictionaries(projectEnv, globalEnv);	} else if (globalEnv) {		env = (CFMutableDictionaryRef)globalEnv;	} else if (projectEnv) {		env = (CFMutableDictionaryRef)projectEnv;	} else {		return 0;	}	// Auto-generate some variables based on RC_ARCHS and RC_NONARCH_CFLAGS	// RC_CFLAGS=$RC_NONARCH_CFLAGS -arch ${arch}	// RC_${arch}=YES	CFStringRef str = CFDictionaryGetValue(env, CFSTR("RC_NONARCH_CFLAGS"));	if (!str) str = CFSTR("");	CFMutableStringRef cflags = CFStringCreateMutableCopy(NULL, 0, str);	str = CFDictionaryGetValue(env, CFSTR("RC_ARCHS"));	if (str) {		CFMutableStringRef trimmed = CFStringCreateMutableCopy(NULL, 0, str);		CFStringTrimWhitespace(trimmed);		CFArrayRef archs = tokenizeString(trimmed);		CFIndex i, count = CFArrayGetCount(archs);		for (i = 0; i < count; ++i) {			CFStringRef arch = CFArrayGetValueAtIndex(archs, i);			// -arch ${arch}			CFStringAppendFormat(cflags, NULL, CFSTR(" -arch %@"), arch);						// RC_${arch}=YES			CFStringRef name = CFStringCreateWithFormat(NULL, NULL, CFSTR("RC_%@"), arch);			CFDictionarySetValue(env, name, CFSTR("YES"));			CFRelease(name);		}		CFRelease(trimmed);	}	CFDictionarySetValue(env, CFSTR("RC_CFLAGS"), cflags);		// print variables to stdout	CFArrayRef keys = dictionaryGetSortedKeys(env);	CFIndex i, count = CFArrayGetCount(keys);	for (i = 0; i < count; ++i) {		CFStringRef name = CFArrayGetValueAtIndex(keys, i);		CFStringRef value = CFDictionaryGetValue(env, name);		cfprintf(stdout, "%@=%@/n", name, value);	}	return 0;}
开发者ID:calyx,项目名称:darwinbuild,代码行数:59,


示例16: appendElementProlog

static void appendElementProlog(CFMutableStringRef str, CFXMLTreeRef tree) {    const CFXMLElementInfo *data = (CFXMLElementInfo *)CFXMLNodeGetInfoPtr(CFXMLTreeGetNode(tree));    CFStringAppendFormat(str, NULL, CFSTR("<%@"), CFXMLNodeGetString(CFXMLTreeGetNode(tree)));    if (data->attributeOrder) {        CFIndex i, c = CFArrayGetCount(data->attributeOrder);        for (i = 0; i < c; i ++) {            CFStringRef attr = (CFStringRef)CFArrayGetValueAtIndex(data->attributeOrder, i);            CFStringRef value = (CFStringRef)CFDictionaryGetValue(data->attributes, attr);            CFStringAppendFormat(str, NULL, CFSTR(" %@="), attr);            appendQuotedString(str, value);        }    }    if (data->isEmpty) {        CFStringAppendCString(str, "/>", kCFStringEncodingASCII);    } else {        CFStringAppendCString(str, ">", kCFStringEncodingASCII);    }}
开发者ID:Acorld,项目名称:WinObjC-Heading,代码行数:18,


示例17: _CFErrorCreateDebugDescription

CFStringRef _CFErrorCreateDebugDescription(CFErrorRef err) {    CFStringRef desc = CFErrorCopyDescription(err);    CFStringRef debugDesc = _CFErrorCopyUserInfoKey(err, kCFErrorDebugDescriptionKey);    CFDictionaryRef userInfo = _CFErrorGetUserInfo(err);    CFMutableStringRef result = CFStringCreateMutable(kCFAllocatorSystemDefault, 0);    CFStringAppendFormat(result, NULL, CFSTR("Error Domain=%@ Code=%d"), CFErrorGetDomain(err), (long)CFErrorGetCode(err));    CFStringAppendFormat(result, NULL, CFSTR(" /"%@/""), desc);    if (debugDesc && CFStringGetLength(debugDesc) > 0) CFStringAppendFormat(result, NULL, CFSTR(" (%@)"), debugDesc);    if (userInfo) {        CFStringAppendFormat(result, NULL, CFSTR(" UserInfo=%p {"), userInfo);	CFDictionaryApplyFunction(userInfo, userInfoKeyValueShow, (void *)result);	CFIndex commaLength = (CFStringHasSuffix(result, CFSTR(", "))) ? 2 : 0;	CFStringReplace(result, CFRangeMake(CFStringGetLength(result)-commaLength, commaLength), CFSTR("}"));    }    if (debugDesc) CFRelease(debugDesc);    if (desc) CFRelease(desc);    return result;}
开发者ID:cooljeanius,项目名称:opencflite-code,代码行数:18,


示例18: __SCNetworkSetCopyDescription

static CFStringRef__SCNetworkSetCopyDescription(CFTypeRef cf){	CFAllocatorRef		allocator	= CFGetAllocator(cf);	CFMutableStringRef      result;	SCNetworkSetPrivateRef	setPrivate	= (SCNetworkSetPrivateRef)cf;	result = CFStringCreateMutable(allocator, 0);	CFStringAppendFormat(result, NULL, CFSTR("<SCNetworkSet %p [%p]> {"), cf, allocator);	CFStringAppendFormat(result, NULL, CFSTR("id = %@"), setPrivate->setID);	CFStringAppendFormat(result, NULL, CFSTR(", prefs = %p"), setPrivate->prefs);	if (setPrivate->name != NULL) {		CFStringAppendFormat(result, NULL, CFSTR(", name = %@"), setPrivate->name);	}	CFStringAppendFormat(result, NULL, CFSTR("}"));	return result;}
开发者ID:carriercomm,项目名称:osx-2,代码行数:18,


示例19: VLC_UNUSED

/** * Determines the network proxy server to use (if any). * @param url absolute URL for which to get the proxy server (not used) * @return proxy URL, NULL if no proxy or error */char *vlc_getProxyUrl(const char *url){    VLC_UNUSED(url);    CFDictionaryRef proxies = SCDynamicStoreCopyProxies(NULL);    char *proxy_url = NULL;    if (proxies) {        CFNumberRef cfn_httpProxyOn =            (CFNumberRef)CFDictionaryGetValue(proxies,                                              kSCPropNetProxiesHTTPEnable);        if (cfn_httpProxyOn) {            int i_httpProxyOn;            CFNumberGetValue(cfn_httpProxyOn, kCFNumberIntType, &i_httpProxyOn);            CFRelease(cfn_httpProxyOn);            if (i_httpProxyOn == 1) // http proxy is on            {                CFStringRef httpProxy =                    (CFStringRef)CFDictionaryGetValue(proxies,                                                      kSCPropNetProxiesHTTPProxy);                if (httpProxy) {                    CFNumberRef cfn_httpProxyPort =                        (CFNumberRef)CFDictionaryGetValue(proxies,                                                        kSCPropNetProxiesHTTPPort);                    int i_httpProxyPort;                    CFNumberGetValue(cfn_httpProxyPort,                                     kCFNumberIntType,                                     &i_httpProxyPort);                    CFRelease(cfn_httpProxyPort);                    CFMutableStringRef outputURL =                        CFStringCreateMutableCopy(kCFAllocatorDefault,                                                  0,                                                  httpProxy);                    if (i_httpProxyPort > 0)                        CFStringAppendFormat(outputURL,                                             NULL,                                             CFSTR(":%i"),                                             i_httpProxyPort);                    char buffer[4096];                    if (CFStringGetCString(outputURL, buffer, sizeof(buffer),                        kCFStringEncodingUTF8))                        proxy_url = strdup(buffer);                    CFRelease(outputURL);                }                CFRelease(httpProxy);            }        }        CFRelease(proxies);    }    return proxy_url;}
开发者ID:dougmencken,项目名称:vlc,代码行数:61,


示例20: addUUID

/*void addUUID(CFMutableDictionaryRef dest, CFStringRef key, EFI_GUID *uuid){    assert(dest);    CFStringRef strValue = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,                                                    CFSTR("%08tX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X"),                                                    uuid->Data1, uuid->Data2, uuid->Data3,                                                    uuid->Data4[0], uuid->Data4[1],                                                    uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5], uuid->Data4[6], uuid->Data4[7]);    assert(strValue);    CFDictionaryAddValue( dest, key, strValue );    CFRelease(strValue);}*/void addUUID(CFMutableDictionaryRef dest, CFStringRef key, UInt8 *uuid){  SInt64 i = 0;  CFMutableStringRef strValue = CFStringCreateMutable (kCFAllocatorDefault, 0);    for (i = 0; i < 4; i++) {    CFStringAppendFormat(strValue, NULL, CFSTR("%02x"), *uuid++);  }  for (i = 0; i < 3; i++) {    CFStringAppendFormat(strValue, NULL, CFSTR("-%02x"), *uuid++);    CFStringAppendFormat(strValue, NULL, CFSTR("%02x"), *uuid++);  }  CFStringAppendFormat(strValue, NULL, CFSTR("-"));  for (i = 0; i < 6; i++) {    CFStringAppendFormat(strValue, NULL, CFSTR("%02x"), *uuid++);  }  CFDictionaryAddValue( dest, key, strValue );  CFRelease(strValue);}
开发者ID:huaqli,项目名称:clover,代码行数:32,


示例21: addIntArray

void addIntArray(CFMutableDictionaryRef dest, CFStringRef key, UInt8 *Value, SInt64 num){    SInt64 i = 0;    CFMutableStringRef strValue = CFStringCreateMutable (kCFAllocatorDefault, 0);    for (i = 0; i < num; i++) {        CFStringAppendFormat(strValue, NULL, CFSTR("%02x"), Value[i]);    }    CFDictionaryAddValue( dest, key, strValue );    CFRelease(strValue);}
开发者ID:huaqli,项目名称:clover,代码行数:11,


示例22: __EAPOLClientItemIDCopyDebugDesc

STATIC CFStringRef__EAPOLClientItemIDCopyDebugDesc(CFTypeRef cf){    CFAllocatorRef		allocator = CFGetAllocator(cf);    EAPOLClientItemIDRef	itemID = (EAPOLClientItemIDRef)cf;    CFStringRef			profileID;    CFMutableStringRef		result;    CFStringRef			ssid_str;    result = CFStringCreateMutable(allocator, 0);    CFStringAppendFormat(result, NULL, 			 CFSTR("<EAPOLClientItemID %p [%p]> {"), cf, allocator);    switch (itemID->type) {    case kEAPOLClientItemIDTypeWLANSSID:	ssid_str = my_CFStringCreateWithData(itemID->u.ssid);	CFStringAppendFormat(result, NULL, CFSTR("WLAN SSID = %@"),			     ssid_str);	CFRelease(ssid_str);	break;    case kEAPOLClientItemIDTypeWLANDomain:	CFStringAppendFormat(result, NULL, CFSTR("WLAN domain = %@"),			     itemID->u.domain);	break;    case kEAPOLClientItemIDTypeProfileID:	CFStringAppendFormat(result, NULL, CFSTR("ProfileID = %@"),			     itemID->u.profileID);	break;    case kEAPOLClientItemIDTypeProfile:	profileID = EAPOLClientProfileGetID(itemID->u.profile);	CFStringAppendFormat(result, NULL, CFSTR("Profile = %@"),			     profileID);	break;    case kEAPOLClientItemIDTypeDefault:	CFStringAppend(result, CFSTR("Default"));	break;    default:	break;    }    CFStringAppend(result, CFSTR("}"));    return result;}
开发者ID:gfleury,项目名称:eap8021x-debug,代码行数:41,


示例23: __CFNumberCopyDescription

static CFStringRef __CFNumberCopyDescription(CFTypeRef cf) {    CFNumberRef number = (CFNumberRef)cf;    CFNumberType type = __CFNumberGetType(number);    CFMutableStringRef mstr = CFStringCreateMutable(kCFAllocatorSystemDefault, 0);    CFStringAppendFormat(mstr, NULL, CFSTR("<CFNumber %p [%p]>{value = "), cf, CFGetAllocator(cf));    if (__CFNumberTypeTable[type].floatBit) {        Float64 d;        __CFNumberGetValue(number, kCFNumberFloat64Type, &d);        if (isnan(d)) {            CFStringAppend(mstr, CFSTR("nan"));        } else if (isinf(d)) {            CFStringAppend(mstr, (0.0 < d) ? CFSTR("+infinity") : CFSTR("-infinity"));        } else if (0.0 == d) {            CFStringAppend(mstr, (copysign(1.0, d) < 0.0) ? CFSTR("-0.0") : CFSTR("+0.0"));        } else {            CFStringAppendFormat(mstr, NULL, CFSTR("%+.*f"), (__CFNumberTypeTable[type].storageBit ? 20 : 10), d);        }        const char* typeName = "unknown float";        switch (type) {            case kCFNumberFloat32Type: typeName = "kCFNumberFloat32Type"; break;            case kCFNumberFloat64Type: typeName = "kCFNumberFloat64Type"; break;        }        CFStringAppendFormat(mstr, NULL, CFSTR(", type = %s}"), typeName);    } else {        CFSInt128Struct i;        __CFNumberGetValue(number, kCFNumberSInt128Type, &i);        char buffer[128];        __CFSInt128Format(buffer, &i, true);        const char* typeName = "unknown integer";        switch (type) {            case kCFNumberSInt8Type: typeName = "kCFNumberSInt8Type"; break;            case kCFNumberSInt16Type: typeName = "kCFNumberSInt16Type"; break;            case kCFNumberSInt32Type: typeName = "kCFNumberSInt32Type"; break;            case kCFNumberSInt64Type: typeName = "kCFNumberSInt64Type"; break;            case kCFNumberSInt128Type: typeName = "kCFNumberSInt128Type"; break;        }        CFStringAppendFormat(mstr, NULL, CFSTR("%s, type = %s}"), buffer, typeName);    }    return mstr;}
开发者ID:DmitrySkiba,项目名称:itoa-cleancf,代码行数:40,


示例24: CGColorSpaceCopyDebugDescription

static CFStringRef CGColorSpaceCopyDebugDescription(CFTypeRef ref) {    CGColorSpace* colorSpace=_CGColorSpaceFromTypeRef(ref);    CFAllocatorRef allocator=CFGetAllocator(ref);    CFMutableStringRef description=CFStringCreateMutable(allocator,0);    CFStringRef typeName=CGColorSpaceFormatType(colorSpace->type);    CFStringAppendFormat(        description,        NULL,        CFSTR("<CGColorSpace %p> (%@)"),        colorSpace,typeName);    CFRelease(typeName);    return description;}
开发者ID:AriX,项目名称:FrozenCocoa-POC,代码行数:13,


示例25: SOSRecoveryKeyBagCopyFormatDescription

static CFStringRef SOSRecoveryKeyBagCopyFormatDescription(CFTypeRef aObj, CFDictionaryRef formatOptions) {    SOSRecoveryKeyBagRef rb = (SOSRecoveryKeyBagRef) aObj;    CFStringRef gcString = SOSGenerationCountCopyDescription(rb->generation);    CFStringRef rkbID = SOSCopyIDOfDataBufferWithLength(rb->recoveryKeyBag, 8, NULL);    CFMutableStringRef description = CFStringCreateMutable(kCFAllocatorDefault, 0);        CFStringAppendFormat(description, NULL, CFSTR("<[email
C++ CFStringCompare函数代码示例
C++ CFStringAppend函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。