summaryrefslogtreecommitdiff
path: root/json-glib/json-array.c
diff options
context:
space:
mode:
Diffstat (limited to 'json-glib/json-array.c')
-rw-r--r--json-glib/json-array.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/json-glib/json-array.c b/json-glib/json-array.c
index 3de3244..4b17825 100644
--- a/json-glib/json-array.c
+++ b/json-glib/json-array.c
@@ -44,6 +44,13 @@ struct _JsonArray
volatile gint ref_count;
};
+/**
+ * json_array_new:
+ *
+ * Creates a new #JsonArray.
+ *
+ * Return value: the newly created #JsonArray
+ */
JsonArray *
json_array_new (void)
{
@@ -57,6 +64,14 @@ json_array_new (void)
return array;
}
+/**
+ * json_array_sized_new:
+ * @n_elements: number of slots to pre-allocate
+ *
+ * Creates a new #JsonArray with @n_elements slots already allocated.
+ *
+ * Return value: the newly created #JsonArray
+ */
JsonArray *
json_array_sized_new (guint n_elements)
{
@@ -185,6 +200,13 @@ json_array_get_length (JsonArray *array)
return array->elements->len;
}
+/**
+ * json_array_add_element:
+ * @array: a #JsonArray
+ * @node: a #JsonNode
+ *
+ * Appends @node inside @array.
+ */
void
json_array_add_element (JsonArray *array,
JsonNode *node)