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

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

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

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

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

示例1: CFURLCopyFileSystemPath

void TestController::initializeInjectedBundlePath(){    CFStringRef exeContainerPath = CFURLCopyFileSystemPath(CFURLCreateCopyDeletingLastPathComponent(0, CFBundleCopyExecutableURL(CFBundleGetMainBundle())), kCFURLWindowsPathStyle);    CFMutableStringRef bundlePath = CFStringCreateMutableCopy(0, 0, exeContainerPath);    CFStringAppendCString(bundlePath, injectedBundleDLL, kCFStringEncodingWindowsLatin1);    m_injectedBundlePath.adopt(WKStringCreateWithCFString(bundlePath));}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:7,


示例2: convertChars

int convertChars(char *from, int fromLen, void *fromCode, char *to, int toLen, void *toCode, int norm, int term){  CFStringRef	     cfs= CFStringCreateWithBytes(NULL, (UInt8 *) from, fromLen, (CFStringEncoding)fromCode, 0);  if (cfs == NULL) {      toLen = 0;	  to[toLen]= '/0';	  return toLen;	}	  CFMutableStringRef str= CFStringCreateMutableCopy(NULL, 0, cfs);  CFRelease(cfs);  if (norm) // HFS+ imposes Unicode2.1 decomposed UTF-8 encoding on all path elements    CFStringNormalize(str, kCFStringNormalizationFormD); // canonical decomposition  else    CFStringNormalize(str, kCFStringNormalizationFormC); // pre-combined  {    CFRange rng= CFRangeMake(0, CFStringGetLength(str));    CFIndex len= 0;    CFIndex num= CFStringGetBytes(str, rng, (CFStringEncoding)toCode, '?', 0, (UInt8 *)to, toLen - term, &len);    CFRelease(str);    if (!num)      return convertCopy(from, fromLen, to, toLen, term);    if (term)      to[len]= '/0';    return len;  }}
开发者ID:Geal,项目名称:Squeak-VM,代码行数:27,


示例3: PathToFileViaFSRef

void PathToFileViaFSRef(char *pathName, int pathNameMax, FSRef *theFSRef,CFStringEncoding encoding) {                CFURLRef sillyThing;        CFStringRef filePath;        Boolean isDirectory;				pathName[0]=  0x00;        sillyThing =  CFURLCreateFromFSRef (kCFAllocatorDefault, theFSRef);		if (sillyThing == NULL)			return;        isDirectory = CFURLHasDirectoryPath(sillyThing);                filePath = CFURLCopyFileSystemPath (sillyThing, kCFURLPOSIXPathStyle);        CFRelease(sillyThing);          		CFMutableStringRef mutableStr= CFStringCreateMutableCopy(NULL, 0, filePath);          CFRelease(filePath);    		// HFS+ imposes Unicode2.1 decomposed UTF-8 encoding on all path elements  		if (encoding == kCFStringEncodingUTF8)   			CFStringNormalize(mutableStr, kCFStringNormalizationFormC); // pre-combined            CFStringGetCString (mutableStr, pathName,pathNameMax, encoding);			CFRelease(mutableStr);                if (isDirectory)            strcat(pathName,"/");}
开发者ID:Geal,项目名称:Squeak-VM,代码行数:27,


示例4: setPlayerWinTitle

bool setPlayerWinTitle(CFStringRef sTitle){    CFMutableStringRef sFinalStr = NULL;    OSStatus iErr = noErr;    if (NULL == (sFinalStr = CFStringCreateMutableCopy(NULL, 8 + CFStringGetLength(sTitle), CFSTR("Frogg - "))))    {        fprintf(stderr, "setPlayerWinTitle() - CFStringCreateMutableCopy() failed!/n");        return false;    }    else    {        CFStringAppend(sFinalStr, sTitle);        if (noErr != (iErr = SetWindowTitleWithCFString(g_refPlayerWin, sFinalStr)))        {            CFRelease(sFinalStr);            fprintf(stderr, "setPlayerWinTitle() - SetWindowTitleWithCFString() failed, returning %lu!/n", (unsigned long) iErr);            return false;        }                CFRelease(sFinalStr);        return true;    }}
开发者ID:ullerrm,项目名称:frogg,代码行数:25,


示例5: 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,


示例6: CFBundleCopyLocalizedStringForLocalization

CF_EXPORT CFStringRef CFBundleCopyLocalizedStringForLocalization(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName, CFStringRef localizationName) {    if (!key) { return (value ? (CFStringRef)CFRetain(value) : (CFStringRef)CFRetain(CFSTR(""))); }        // Make sure to check the mixed localizations key early -- if the main bundle has not yet been cached, then we need to create the cache of the Info.plist before we start asking for resources (11172381)    (void)CFBundleAllowMixedLocalizations();        if (!tableName || CFEqual(tableName, CFSTR(""))) tableName = _CFBundleDefaultStringTableName;        CFStringRef result = _copyStringFromTable(bundle, tableName, key, localizationName);        if (!result) {        if (!value) {            result = (CFStringRef)CFRetain(key);        } else if (CFEqual(value, CFSTR(""))) {            result = (CFStringRef)CFRetain(key);        } else {            result = (CFStringRef)CFRetain(value);        }        static Boolean capitalize = false;        if (capitalize) {            CFMutableStringRef capitalizedResult = CFStringCreateMutableCopy(kCFAllocatorSystemDefault, 0, result);            os_log_error(_CFBundleLocalizedStringLogger(), "ERROR: %@ not found in table %@ of bundle %@", key, tableName, bundle);            CFStringUppercase(capitalizedResult, NULL);            CFRelease(result);            result = capitalizedResult;        }    }    os_log_debug(_CFBundleLocalizedStringLogger(), "Bundle: %{private}@, key: %{public}@, value: %{public}@, table: %{public}@, localizationName: %{public}@, result: %{public}@", bundle, key, value, tableName, localizationName, result);    return result;}
开发者ID:JGiola,项目名称:swift-corelibs-foundation,代码行数:30,


示例7: AudioComponentCopyName

void 		CAComponent::SetCompNames () const{	if (!mCompName) {			CFStringRef compName;		OSStatus result = AudioComponentCopyName (Comp(), &compName);		if (result) return;				const_cast<CAComponent*>(this)->mCompName = compName;		if (compName)		{			CFArrayRef splitStrArray = CFStringCreateArrayBySeparatingStrings(NULL, compName, CFSTR(":"));						// we need to retain these values so the strings are not lost when the array is released			const_cast<CAComponent*>(this)->mManuName = (CFStringRef)CFArrayGetValueAtIndex(splitStrArray, 0);            CFRetain(this->mManuName);			if (CFArrayGetCount(splitStrArray) > 1)			{				CFStringRef str = (CFStringRef)CFArrayGetValueAtIndex(splitStrArray, 1);								CFMutableStringRef mstr = CFStringCreateMutableCopy (NULL, CFStringGetLength(str), str);				// this needs to trim out white space:								CFStringTrimWhitespace (mstr);							const_cast<CAComponent*>(this)->mAUName = mstr;			} else				const_cast<CAComponent*>(this)->mAUName = NULL;						CFRelease(splitStrArray);		}	}}
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:34,


示例8: TargetNameCreatedWithHostName

/*  * Create the target name using the host name. Note we will use the  * GSS_C_NT_HOSTBASE name type of [email
C++ CFStringCreateWithBytes函数代码示例
C++ CFStringCreateExternalRepresentation函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。