docs/Writerside/topics/json.h.md

changeset 1573
cd2e974410ad
parent 1566
2ebbcb38986d
--- a/docs/Writerside/topics/json.h.md	Thu Dec 11 22:43:13 2025 +0100
+++ b/docs/Writerside/topics/json.h.md	Thu Dec 11 22:59:55 2025 +0100
@@ -346,6 +346,12 @@
 
 int cxJsonWrite(void* target, const CxJsonValue* value,
         cx_write_func wfunc, const CxJsonWriter* settings);
+
+cxmutstr cxJsonToString(CxJsonValue *value,
+        const CxAllocator *allocator);
+
+cxmutstr cxJsonToPrettyString(CxJsonValue *value,
+        const CxAllocator *allocator);
 ```
 
 A JSON value can be formatted with the `cxJsonWrite()` function.
@@ -353,7 +359,9 @@
 The `target` can be a stream, a UCX [buffer](buffer.h.md), or anything else that can be written to with a write function.
 The behavior of the function is controlled via a `CxJsonWriter` struct.
 With the functions `cxJsonWriterCompact()` and `cxJsonWriterPretty()` you can create default settings,
-which you may modify to suit your needs.
+which you may modify to suit your needs (see the table below).
+The functions `cxJsonToString()` and `cxJsonToPrettyString()` are convenience functions
+which create a writer with default settings to produce a null-terminated string allocated by the specified allocator.
 
 | Setting           | Compact Default | Pretty Default                   | Description                                                                                                                                                      |
 |-------------------|-----------------|----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|

mercurial