src/cx/json.h

changeset 1337
6dfa1eb58ce3
parent 1193
cfa44f3f5e3b
--- a/src/cx/json.h	Sat Jul 19 21:09:07 2025 +0200
+++ b/src/cx/json.h	Thu Aug 14 23:03:01 2025 +0200
@@ -1284,6 +1284,23 @@
 CxJsonValue *cxJsonArrGet(const CxJsonValue *value, size_t index);
 
 /**
+ * Removes an element from a JSON array.
+ *
+ * If the @p value is not a JSON array, the behavior is undefined.
+ *
+ * This function, in contrast to cxJsonArrayGet(), returns @c NULL
+ * when the index is out of bounds.
+ *
+ * @param value the JSON value
+ * @param index the index in the array
+ * @return the removed value from the specified index or @c NULL when the index was out of bounds
+ * @see cxJsonIsArray()
+ */
+cx_attr_nonnull
+cx_attr_export
+CxJsonValue *cxJsonArrRemove(CxJsonValue *value, size_t index);
+
+/**
  * Returns an iterator over the JSON array elements.
  *
  * The iterator yields values of type @c CxJsonValue* .

mercurial