Imported Upstream version 1.2.4
[platform/upstream/json-glib.git] / json-glib / Json-1.0.gir
index f66ac42..4071183 100644 (file)
@@ -1245,7 +1245,7 @@ stream.</doc>
       <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>
@@ -1310,8 +1310,9 @@ there should be no need to copy an immutable node.</doc>
       </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*"/>
@@ -1325,8 +1326,9 @@ with its reference count increased by one.</doc>
       </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>
@@ -1338,10 +1340,12 @@ the returned object is increased.</doc>
         </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>
@@ -1384,8 +1388,9 @@ integer value 4.</doc>
         </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>
@@ -1397,7 +1402,10 @@ integer value 4.</doc>
         </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"/>
@@ -1410,7 +1418,11 @@ integer value 4.</doc>
         </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"/>
@@ -1423,7 +1435,11 @@ integer value 4.</doc>
         </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"/>
@@ -1451,8 +1467,9 @@ integer value 4.</doc>
         </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>
@@ -1465,9 +1482,9 @@ integer value 4.</doc>
       </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>
@@ -1478,8 +1495,9 @@ integer value 4.</doc>
         </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>
@@ -1492,7 +1510,8 @@ integer value 4.</doc>
       </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>
@@ -4787,7 +4806,7 @@ sequence.</doc>
         </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*"/>