add documentation for cxJsonArrRemove() and cxJsonObjRemove()

Fri, 15 Aug 2025 17:44:19 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 15 Aug 2025 17:44:19 +0200
changeset 1339
bff0a078523d
parent 1338
cc153bffea28
child 1340
31c61b6dcaa5

add documentation for cxJsonArrRemove() and cxJsonObjRemove()

resolves #627

docs/Writerside/topics/json.h.md file | annotate | diff | comparison | revisions
--- a/docs/Writerside/topics/json.h.md	Fri Aug 15 17:42:01 2025 +0200
+++ b/docs/Writerside/topics/json.h.md	Fri Aug 15 17:44:19 2025 +0200
@@ -104,8 +104,12 @@
 
 CxJsonValue *cxJsonArrGet(const CxJsonValue *value, size_t index);
 
+CxJsonValue *cxJsonArrRemove(const CxJsonValue *value, size_t index);
+
 CxJsonValue *cxJsonObjGet(const CxJsonValue *value, AnyStr name);
 
+CxJsonValue *cxJsonObjRemove(const CxJsonValue *value, AnyStr name);
+
 CxIterator cxJsonArrIter(const CxJsonValue *value);
 
 CxIterator cxJsonObjIter(const CxJsonValue *value);
@@ -132,13 +136,17 @@
 
 The function `cxJsonArraySize()` returns the number of items in an array value,
 which can be accessed via index with `cxJsonArrGet()` or via an iterator created with `cxJsonArrIter()`.
+An element can be removed from an array with `cxJsonArrRemove()`.
 
-The function `cxJsonObjGet()` returns the member in a JSON object associated with the specified `name`. 
+The function `cxJsonObjGet()` returns the member in a JSON object associated with the specified `name`.
+To remove a member, use `cxJsonObjRemove()`.
 
 > Both `cxJsonArrGet()` and `cxJsonObjGet()` are safe regarding access to non-existing values.
 > 
 > When `cxJsonArrGet()` is used with an out-of-bounds index, or `cxJsonObjGet()` is used with a non-existent name,
 > they return a JSON value, that returns `false` for any `cxJsonIsXYZ()` function.
+> 
+> This is **not** the case for `cxJsonArrRemove()` and `cxJsonObjRemove()`, which return `NULL` in that case.
 
 > If you don't have full control over the JSON data, you should always check the datatype of a value first, before accessing it.
 >{style="note"}

mercurial