Name: @PACKAGE_NAME@
Description: Class for ZakFormIProvider based on json format.
Version: @PACKAGE_VERSION@
-Requires: libzakform libzakutils json-glib-1.0
+Requires: libzakform libzakutils libzakutilsjsonxml json-glib-1.0
Libs: -L${libdir} -lzakformjson
Cflags: -I${includedir}
#include <libzakform/libzakform.h>
#include <libzakutils/libzakutils.h>
+#include <libzakutilsjsonxml/libzakutilsjsonxml.h>
#include <json-glib/json-glib.h>
#include "form.h"
if (priv->root == NULL)
{
- JsonArray *jar;
-
g_warning ("Unable to get json root element.");
- jar = json_array_new ();
- priv->root = json_node_new (JSON_NODE_ARRAY);
- json_node_init_array (priv->root, jar);
+ priv->root = zak_utils_json_node_new_array ();
zak_form_json_provider_write_to_file (zak_form_json_provider);
}
if (priv->root == NULL)
{
- JsonArray *jar;
-
g_warning ("Unable to get json root element.");
- jar = json_array_new ();
- priv->root = json_node_new (JSON_NODE_ARRAY);
- json_node_init_array (priv->root, jar);
+ priv->root = zak_utils_json_node_new_array ();
}
return zak_form_json_provider;
{
JsonNode *jnode;
- obj = json_object_new ();
-
- jnode = json_node_new (JSON_NODE_OBJECT);
- json_node_init_object (jnode, obj);
+ jnode = zak_utils_json_node_new_object ();
json_array_add_element (json_node_get_array (priv->root), jnode);
+
+ obj = json_node_get_object (jnode);
}
for (i = 0; i < elements->len; i++)