diff options
author | Jonathan Beck | 2009-01-04 20:56:05 +0100 |
---|---|---|
committer | Jonathan Beck | 2009-01-04 20:56:05 +0100 |
commit | a835ed062afea72a2c50fc002b0467925f8d9c1b (patch) | |
tree | 23a2bc7cfd487a568013c9cee7e78e46afa9ad02 /src/xplist.c | |
parent | a3c6acf863f1a4deef76b0075c36f20de8d31197 (diff) | |
download | libplist-a835ed062afea72a2c50fc002b0467925f8d9c1b.tar.gz libplist-a835ed062afea72a2c50fc002b0467925f8d9c1b.tar.bz2 |
handle date tag.
Diffstat (limited to 'src/xplist.c')
-rw-r--r-- | src/xplist.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/xplist.c b/src/xplist.c index 3487f96..29d4e46 100644 --- a/src/xplist.c +++ b/src/xplist.c @@ -188,7 +188,10 @@ static void node_to_xml(GNode * node, gpointer xml_struct) tag = XPLIST_DICT; isStruct = TRUE; break; - case PLIST_DATE: //TODO : handle date tag + case PLIST_DATE: + tag = XPLIST_DATE; + val = g_time_val_to_iso8601(&node_data->timeval); + break; default: break; } @@ -268,8 +271,12 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node) continue; } - if (!xmlStrcmp(node->name, XPLIST_DATE)) + if (!xmlStrcmp(node->name, XPLIST_DATE)) { + g_time_val_from_iso8601((char*)xmlNodeGetContent(node), &data->timeval); + data->type = PLIST_DATE; + data->length = sizeof(GTimeVal); continue; //TODO : handle date tag + } if (!xmlStrcmp(node->name, XPLIST_STRING)) { data->strval = strdup( (char*) xmlNodeGetContent(node)); |