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


C++ CFShow函数代码示例

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


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

示例1: writePropertyListToFile

void writePropertyListToFile (CFDataRef data) {
    CFStringRef errorString;

    CFPropertyListRef propertyList = CFPropertyListCreateFromXMLData (NULL, data, kCFPropertyListMutableContainersAndLeaves, &errorString);

    if (errorString == NULL) {
        CFStringRef urlString = CFStringCreateWithCString (NULL, kFilename, CFStringGetSystemEncoding ());

        CFURLRef fileURL = CFURLCreateWithFileSystemPath (NULL, urlString, kCFURLPOSIXPathStyle, FALSE);

        CFWriteStreamRef stream = CFWriteStreamCreateWithFile (NULL, fileURL);

        Boolean isOpen = CFWriteStreamOpen (stream);

        show (CFSTR ("Property list (as written to file):\n%@"), propertyList);
  
        CFIndex bytesWritten = CFPropertyListWriteToStream (propertyList, stream, kCFPropertyListXMLFormat_v1_0, NULL);

        CFWriteStreamClose (stream);
    }
    else {
        CFShow (errorString);
        CFRelease (errorString);
    }

    CFRelease (propertyList);
}
开发者ID:Ashod,项目名称:WinCairoRequirements,代码行数:27,代码来源:WritePListExample.cpp

示例2: GPDuplexClient_Send

extern CFDataRef GPDuplexClient_Send(GPDuplexClientRef client, SInt32 type, CFDataRef data, Boolean expectsReturn) {
	CFMessagePortRef serverPort;
	if (client != NULL)
		serverPort = client->serverPort;
	else {
		serverPort = CFMessagePortCreateRemote(NULL, CFSTR("hk.kennytm.GriP.server"));
		if (serverPort == NULL) {
			CFShow(CFSTR("GPDuplexClient_Send(): Cannot create server port. Is GriP running?"));
			return NULL;
		}
	}
	
	if (expectsReturn) {
		CFDataRef retData = NULL;
		SInt32 errorCode = CFMessagePortSendRequest(serverPort, type, data, 4, 1, kCFRunLoopDefaultMode, &retData);
		if (client == NULL)
			CFRelease(serverPort);
		if (errorCode != kCFMessagePortSuccess) {
			CFLog(4, CFSTR("GPDuplexClient_Send(): Cannot send data %@ of type %d to server. Returning NULL. Error code = %d"), data, type, errorCode);
			if (retData != NULL) {
				CFRelease(retData);
				retData = NULL;
			}
		}
		return retData;
	} else {
		SInt32 errorCode = CFMessagePortSendRequest(serverPort, type, data, 4, 0, NULL, NULL);
		if (client == NULL)
			CFRelease(serverPort);
		if (errorCode != kCFMessagePortSuccess) {
			CFLog(4, CFSTR("GPDuplexClient_Send(): Cannot send data %@ of type %d to server. Error code = %d"), data, type, errorCode);
		}
		return NULL;
	}
}
开发者ID:525828027,项目名称:networkpx,代码行数:35,代码来源:ClientC.c

示例3: wireless_scan_ssid

static CFArrayRef
wireless_scan_ssid(wireless_t wref, CFStringRef ssid)
{
    CFArrayRef			bssid_list = NULL;
    Apple80211Err		error;
    CFDictionaryRef	 	scan_args;
    CFArrayRef 			scan_result = NULL;
	
	EAPLOG(LOG_ERR, "######## DEBUG ####### - FAIL - wireless_scan_ssid");
	
    scan_args = make_scan_args(ssid, 1);
    error = Apple80211Scan((Apple80211Ref)wref, &scan_result, scan_args);
    CFRelease(scan_args);
    if (error != kA11NoErr) {
		EAPLOG(LOG_ERR, "Apple80211Scan failed, %d\n", error);
		goto failed;
    }
    bssid_list = copy_bssid_list_from_scan(scan_result, ssid);
    if (bssid_list == NULL) {
		EAPLOG(LOG_ERR, "No scan results\n");
    }
    else {
		CFShow(bssid_list);
    }
    fflush(stdout);
    fflush(stderr);
	
failed:
    my_CFRelease(&scan_result);
    return (bssid_list);
	
}
开发者ID:gfleury,项目名称:eap8021x-debug,代码行数:32,代码来源:wireless.c

示例4: TestDuplicateAndDeleteSet

static void TestDuplicateAndDeleteSet(void)
	// A test of the set duplication and deleting routines.
{
	OSStatus err;
	CFStringRef currentSetID;
	CFStringRef newSetID;
	
	currentSetID = NULL;
	newSetID = NULL;
	err = MoreSCCopyCurrentSet(&currentSetID);
	if (err == noErr) {
		err = MoreSCDuplicateSet(currentSetID, CFSTR("Frog"), &newSetID);
	}
	if (err == noErr) {
		if (!gRunQuiet) {
			fprintf(stderr, "New set ID is ");
			CFShow(newSetID);
		}
		
		err = MoreSCDeleteSet(newSetID);
	}
	
	CFQRelease(currentSetID);
	CFQRelease(newSetID);

	PrintTestResult(err, NULL);
}
开发者ID:fruitsamples,项目名称:MoreIsBetter,代码行数:27,代码来源:MoreSCFTest.c

示例5: JSRunEvaluate

/*
    JSRunEvaluate
*/
JSObjectRef JSRunEvaluate(JSRunRef ref)
{
    JSObjectRef result = 0;
    JSRun* ptr = (JSRun*)ref;
    if (ptr)
    {
        Completion completion = ptr->Evaluate();
        if (completion.isValueCompletion())
        {
            result = (JSObjectRef)KJSValueToJSObject(completion.value(), ptr->GetInterpreter()->globalExec());
        }

        if (completion.complType() == Throw)
        {
            JSFlags flags = ptr->Flags();
            if (flags & kJSFlagDebug)
            {
                CFTypeRef error = JSObjectCopyCFValue(result);
                if (error)
                {
                    CFShow(error);
                    CFRelease(error);
                }
            }
        }
    }
    return result;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:31,代码来源:JavaScriptGlue.cpp

示例6: GTMSMJobCopyDictionary

CFDictionaryRef GTMSMJobCopyDictionary(CFStringRef jobLabel) {
  CFDictionaryRef dict = NULL;
  CFErrorRef error = NULL;
  launch_data_t resp = GTMPerformOnLabel(LAUNCH_KEY_GETJOB,
                                         jobLabel,
                                         &error);
  if (resp) {
    launch_data_type_t ldata_Type = launch_data_get_type(resp);
    if (ldata_Type == LAUNCH_DATA_DICTIONARY) {
      dict = GTMCFTypeCreateFromLaunchData(resp, true, &error);
    } else {
      error = GTMCFLaunchCreateUnlocalizedError(EINVAL,
                                                CFSTR("Unknown launchd type %d"),
                                                ldata_Type);
    }
    launch_data_free(resp);
  }
  if (error) {
#ifdef DEBUG
    CFShow(error);
#endif //  DEBUG
    CFRelease(error);
  }
  return dict;
}
开发者ID:aseehra,项目名称:google-toolbox-for-mac,代码行数:25,代码来源:GTMServiceManagement.c

示例7: _ShowCF

static void	_ShowCF (FILE* file, CFStringRef str)
{
	if (CFGetTypeID(str) != CFStringGetTypeID()) {
		CFShow(str);
		return;
	}

	UInt32 len = CFStringGetLength(str);
	char* chars = (char*)CA_malloc (len * 2); // give us plenty of room for unichar chars
	if (CFStringGetCString (str, chars, len * 2, kCFStringEncodingUTF8))
		fprintf (file, "%s", chars);
	else
		CFShow (str);

	free (chars);
}
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:16,代码来源:CAComponent.cpp

示例8: main

int
main (int argc, const char *argv[])
{
    CFShow(CFSTR("Hello, World!\n"));

    return EXIT_SUCCESS;
}
开发者ID:senojsitruc,项目名称:Chatter,代码行数:7,代码来源:main.c

示例9: dumpSetProperties

static void
dumpSetProperties(CFMutableDictionaryRef set)
{
    CFPrintf(CFSTR("\n%@\n"), CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetUUIDKey)));
    CFPrintf(CFSTR("\t\"%@\" type = %@ /dev/%@\n"),
	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetNameKey)),
	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDLevelNameKey)),
	     CFDictionaryGetValue(set, CFSTR("BSD Name")));
    CFPrintf(CFSTR("\tstatus = %@, sequence = %@\n"),
	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDStatusKey)),
	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDSequenceNumberKey)));
    CFPrintf(CFSTR("\tchunk count = %@, chunk size = %@\n"),
	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDChunkCountKey)),
	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDChunkSizeKey)));

    CFStringRef level = CFDictionaryGetValue(set, CFSTR(kAppleRAIDLevelNameKey));
    if (CFStringCompare(level, CFSTR("mirror"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
	CFPrintf(CFSTR("\tcontent hint = %@, auto = %@, quick = %@, timeout = %@\n"),
		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetContentHintKey)),
		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetAutoRebuildKey)),
		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetQuickRebuildKey)),
		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetTimeoutKey)));
    } else if (CFStringCompare(level, CFSTR("LVG"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
	CFPrintf(CFSTR("\tcontent hint = %@, lv count = %@, free space %@\n"),
		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetContentHintKey)),
		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDLVGVolumeCountKey)),
		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDLVGFreeSpaceKey)));
    } else {
	CFPrintf(CFSTR("\tcontent hint = %@\n"), CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetContentHintKey)));
    }

    if (verbose) CFShow(set);
}
开发者ID:RomiPierre,项目名称:osx,代码行数:33,代码来源:artest.c

示例10: write_plist

/* @overload write_plist(hash, path)
 *
 * Writes the serialized contents of a property list to the specified path.
 *
 * @note This does not yet support all possible types that can exist in a valid property list.
 *
 * @note This currently only assumes to be given an Xcode project document.
 *       This means that it only accepts dictionaries, arrays, and strings in
 *       the document.
 *
 * @param [Hash] hash     The property list to serialize.
 * @param [String] path   The path to the property list file.
 * @return [true, false]  Wether or not saving was successful.
 */
static VALUE
write_plist(VALUE self, VALUE hash, VALUE path) {
  VALUE h = rb_check_convert_type(hash, T_HASH, "Hash", "to_hash");
  if (NIL_P(h)) {
    rb_raise(rb_eTypeError, "%s can't be coerced to Hash", rb_obj_classname(hash));
  }

  CFMutableDictionaryRef dict = CFDictionaryCreateMutable(NULL,
                                                          0,
                                                          &kCFTypeDictionaryKeyCallBacks,
                                                          &kCFTypeDictionaryValueCallBacks);

  rb_hash_foreach(h, dictionary_set, (st_data_t)dict);

  CFURLRef fileURL = str_to_url(path);
  CFWriteStreamRef stream = CFWriteStreamCreateWithFile(NULL, fileURL);
  CFRelease(fileURL);

  CFIndex success = 0;
  if (CFWriteStreamOpen(stream)) {
    CFStringRef errorString;
    success = CFPropertyListWriteToStream(dict, stream, kCFPropertyListXMLFormat_v1_0, &errorString);
    if (!success) {
      CFShow(errorString);
    }
  } else {
    printf("Unable to open stream!\n");
  }

  CFRelease(dict);
  return success ? Qtrue : Qfalse;
}
开发者ID:Ashton-W,项目名称:Xcodeproj,代码行数:46,代码来源:xcodeproj_ext.c

示例11: DebugModemScriptSearch

	static void DebugModemScriptSearch(void)
		// Used for debugging the modem script code.
	{
		OSStatus 	err;
		CFArrayRef	cclArray;
		CFIndex		indexOfDefaultCCL;
		
		cclArray = NULL;
		err = MoreSCCreateCCLArray(&cclArray, &indexOfDefaultCCL);
		if (err == noErr) {
			CFIndex i;
			CFIndex c;
			
			c = CFArrayGetCount(cclArray);
			fprintf(stderr, "CCL Count = %ld\n", c);
			for (i = 0; i < c; i++) {
				fprintf(stderr, "%3ld %c ", i, i == indexOfDefaultCCL ? '*' : ' ');
				CFShow(CFArrayGetValueAtIndex(cclArray, i));
			}
		}
		
		CFQRelease(cclArray);
		
	    if (err == noErr) {
    	    fprintf(stderr, "Success!\n");
	    } else {
    	    fprintf(stderr, "*** Failed with error %ld!\n", err);
	    }
	}
开发者ID:fruitsamples,项目名称:MoreIsBetter,代码行数:29,代码来源:MoreSCFTest.c

示例12: main

int main(int argc, const char * argv[])
{

    // insert code here...
    CFShow(CFSTR("Hello, World!\n"));
    return 0;
}
开发者ID:ERICx86,项目名称:Exercise,代码行数:7,代码来源:main.c

示例13: xml_load

// ---------------------------------
// Load the element strings from the given resource (XML) file into a CFPropertyListRef
static CFPropertyListRef xml_load(const CFStringRef pResourceName,const CFStringRef pResourceExtension)
{
	CFPropertyListRef tCFPropertyListRef = NULL;
	CFURLRef resFileCFURLRef = CFBundleCopyResourceURL(CFBundleGetMainBundle(), pResourceName, pResourceExtension, NULL);

	if (NULL != resFileCFURLRef)
	{
		CFDataRef resCFDataRef;

		if (CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, resFileCFURLRef, &resCFDataRef, nil, nil, nil))
		{
			if (NULL != resCFDataRef)
			{
				CFStringRef errorString;

				tCFPropertyListRef = CFPropertyListCreateFromXMLData(kCFAllocatorDefault, resCFDataRef, kCFPropertyListImmutable, &errorString);
				if (NULL == tCFPropertyListRef)
					CFShow(errorString);
				CFRelease(resCFDataRef);
			}
		}
		CFRelease(resFileCFURLRef);
	}
	return tCFPropertyListRef;
}
开发者ID:AlanFreeman,项目名称:Psychtoolbox-3,代码行数:27,代码来源:HID_Name_Lookup.c

示例14: GTMSMCopyAllJobDictionaries

CFDictionaryRef GTMSMCopyAllJobDictionaries(void) {
  CFDictionaryRef dict = NULL;
  launch_data_t msg = launch_data_new_string(LAUNCH_KEY_GETJOBS);
  launch_data_t resp = launch_msg(msg);
  launch_data_free(msg);
  CFErrorRef error = NULL;

  if (resp) {
    launch_data_type_t ldata_Type = launch_data_get_type(resp);
    if (ldata_Type == LAUNCH_DATA_DICTIONARY) {
      dict = GTMCFTypeCreateFromLaunchData(resp, true, &error);
    } else {
      error = GTMCFLaunchCreateUnlocalizedError(EINVAL,
                                                CFSTR("Unknown launchd type %d"),
                                                ldata_Type);
    }
    launch_data_free(resp);
  } else {
    error
      = GTMCFLaunchCreateUnlocalizedError(errno, CFSTR(""));
  }
  if (error) {
#ifdef DEBUG
    CFShow(error);
#endif //  DEBUG
    CFRelease(error);
  }
  return dict;
}
开发者ID:aseehra,项目名称:google-toolbox-for-mac,代码行数:29,代码来源:GTMServiceManagement.c

示例15: CFDictionaryGetValue

/* Get the value for the given key. We don't allow NULL ad a value, so
 * returning NULL means failure (not present).
 */
CFPropertyListRef Preferences::get_value(CFStringRef key) const
{
    CFPropertyListRef prefval = NULL;

    if (!this->is_loaded()) {
	return NULL;
    }

    if (this->m_plist) {
	prefval = CFDictionaryGetValue((CFDictionaryRef)this->m_plist, key);
    } else if (this->m_scpref) {
	prefval = SCPreferencesGetValue(this->m_scpref, key);
    }

    /* Dump the raw keys for debugging. Useful for figuring out whether our
     * type conversion has gone awry.
     */
    if (Options::Debug) {
	DEBUGMSG("%s value for key %s:\n",
		this->m_pspec.c_str(), cfstring_convert(key).c_str());
	CFShow(prefval);
    }

    return prefval;
}
开发者ID:aosm,项目名称:samba,代码行数:28,代码来源:plist.cpp


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