<doc xml:space="preserve">Json major version component (e.g. 1 if %JSON_VERSION is 1.2.3)</doc>
<type name="gint" c:type="gint"/>
</constant>
- <constant name="MICRO_VERSION" value="2" c:type="JSON_MICRO_VERSION">
+ <constant name="MICRO_VERSION" value="4" c:type="JSON_MICRO_VERSION">
<doc xml:space="preserve">Json micro version component (e.g. 3 if %JSON_VERSION is 1.2.3)</doc>
<type name="gint" c:type="gint"/>
</constant>
</method>
<method name="dup_array" c:identifier="json_node_dup_array">
<doc xml:space="preserve">Retrieves the #JsonArray stored inside a #JsonNode and returns it
-with its reference count increased by one.</doc>
- <return-value transfer-ownership="full">
+with its reference count increased by one. If the node does not hold an
+array value, %NULL is returned.</doc>
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">the #JsonArray with its reference
count increased.</doc>
<type name="Array" c:type="JsonArray*"/>
</method>
<method name="dup_object" c:identifier="json_node_dup_object">
<doc xml:space="preserve">Retrieves the #JsonObject inside @node. The reference count of
-the returned object is increased.</doc>
- <return-value transfer-ownership="full">
+the returned object is increased. If the node does not hold an object value,
+%NULL is returned.</doc>
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">the #JsonObject</doc>
<type name="Object" c:type="JsonObject*"/>
</return-value>
</parameters>
</method>
<method name="dup_string" c:identifier="json_node_dup_string">
- <doc xml:space="preserve">Gets a copy of the string value stored inside a #JsonNode</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing a copy
- of the #JsonNode contents. Use g_free() to free the allocated resources</doc>
+ <doc xml:space="preserve">Gets a copy of the string value stored inside a #JsonNode. If the node does
+not hold a string value, %NULL is returned.</doc>
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">a newly allocated string
+ containing a copy of the #JsonNode contents. Use g_free() to free the
+ allocated resources</doc>
<type name="utf8" c:type="gchar*"/>
</return-value>
<parameters>
</parameters>
</method>
<method name="get_array" c:identifier="json_node_get_array">
- <doc xml:space="preserve">Retrieves the #JsonArray stored inside a #JsonNode</doc>
- <return-value transfer-ownership="none">
+ <doc xml:space="preserve">Retrieves the #JsonArray stored inside a #JsonNode. If the node does not
+hold an array value, %NULL is returned.</doc>
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">the #JsonArray</doc>
<type name="Array" c:type="JsonArray*"/>
</return-value>
</parameters>
</method>
<method name="get_boolean" c:identifier="json_node_get_boolean">
- <doc xml:space="preserve">Gets the boolean value stored inside a #JsonNode</doc>
+ <doc xml:space="preserve">Gets the boolean value stored inside a #JsonNode. If the node holds an
+integer or double value which is zero, %FALSE is returned; otherwise %TRUE
+is returned. If the node holds a %JSON_NODE_NULL value or a value of another
+non-boolean type, %FALSE is returned.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a boolean value.</doc>
<type name="gboolean" c:type="gboolean"/>
</parameters>
</method>
<method name="get_double" c:identifier="json_node_get_double">
- <doc xml:space="preserve">Gets the double value stored inside a #JsonNode</doc>
+ <doc xml:space="preserve">Gets the double value stored inside a #JsonNode. If the node holds an integer
+value, it is returned as a double. If the node holds a %FALSE boolean value,
+`0.0` is returned; otherwise a non-zero double is returned. If the node holds
+a %JSON_NODE_NULL value or a value of another non-double type, `0.0` is
+returned.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a double value.</doc>
<type name="gdouble" c:type="gdouble"/>
</parameters>
</method>
<method name="get_int" c:identifier="json_node_get_int">
- <doc xml:space="preserve">Gets the integer value stored inside a #JsonNode</doc>
+ <doc xml:space="preserve">Gets the integer value stored inside a #JsonNode. If the node holds a double
+value, its integer component is returned. If the node holds a %FALSE boolean
+value, `0` is returned; otherwise a non-zero integer is returned. If the
+node holds a %JSON_NODE_NULL value or a value of another non-integer type,
+`0` is returned.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">an integer value.</doc>
<type name="gint64" c:type="gint64"/>
</parameters>
</method>
<method name="get_object" c:identifier="json_node_get_object">
- <doc xml:space="preserve">Retrieves the #JsonObject stored inside a #JsonNode</doc>
- <return-value transfer-ownership="none">
+ <doc xml:space="preserve">Retrieves the #JsonObject stored inside a #JsonNode. If the node does not
+hold an object value, %NULL is returned.</doc>
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">the #JsonObject</doc>
<type name="Object" c:type="JsonObject*"/>
</return-value>
</method>
<method name="get_parent" c:identifier="json_node_get_parent">
<doc xml:space="preserve">Retrieves the parent #JsonNode of @node.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the parent node, or %NULL if @node is
- the root node</doc>
+ <return-value transfer-ownership="none" nullable="1">
+ <doc xml:space="preserve">the parent node, or %NULL if @node
+ is the root node</doc>
<type name="Node" c:type="JsonNode*"/>
</return-value>
<parameters>
</parameters>
</method>
<method name="get_string" c:identifier="json_node_get_string">
- <doc xml:space="preserve">Gets the string value stored inside a #JsonNode</doc>
- <return-value transfer-ownership="none">
+ <doc xml:space="preserve">Gets the string value stored inside a #JsonNode. If the node does not hold a
+string value, %NULL is returned.</doc>
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">a string value.</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
</method>
<method name="get_value" c:identifier="json_node_get_value">
<doc xml:space="preserve">Retrieves a value from a #JsonNode and copies into @value. When done
-using it, call g_value_unset() on the #GValue.</doc>
+using it, call g_value_unset() on the #GValue. If the node does not hold a
+scalar value, @value is not modified.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
</callback>
</field>
</record>
- <constant name="VERSION_S" value="1.2.2" c:type="JSON_VERSION_S">
+ <constant name="VERSION_S" value="1.2.4" c:type="JSON_VERSION_S">
<doc xml:space="preserve">JSON-GLib version, encoded as a string, useful for printing and
concatenation.</doc>
<type name="utf8" c:type="gchar*"/>