这个解析苹果的plist专用的。用cmake搞了好久才弄出来的。运行要有libxml2.dll和zlib1.dll。经过试验可以用。源码demo都在。 点这里下载
// TestPlist.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <plist/plist.h>
#include <stdlib.h>
#pragma comment(lib, "libplist.lib")
int main(int argc, char* argv[])
{
char *payload = NULL;
unsigned __int32 payload_size = 0;
plist_t dict = plist_new_dict();
plist_dict_insert_item(dict, "这是key", plist_new_string("这是string"));
plist_to_xml(dict, &payload, &payload_size);
plist_free(dict);
printf("%s n" , payload);
free(payload);
return 0;
}