docs/Writerside/topics/json.h.md

changeset 1556
afdaa70034f8
parent 1553
7c46531efd52
equal deleted inserted replaced
1555:8972247f54e8 1556:afdaa70034f8
26 int cxJsonFill(CxJson *json, AnyStr str); 26 int cxJsonFill(CxJson *json, AnyStr str);
27 27
28 CxJsonStatus cxJsonNext(CxJson *json, CxJsonValue **value); 28 CxJsonStatus cxJsonNext(CxJson *json, CxJsonValue **value);
29 29
30 void cxJsonDestroy(CxJson *json); 30 void cxJsonDestroy(CxJson *json);
31
32 CxJsonStatus cxJsonFromString(const CxAllocator *allocator,
33 AnyStr str, CxJsonValue **value);
31 ``` 34 ```
32 35
33 The first step is to initialize a `CxJson` structure with a call to `cxJsonInit()`, 36 The first step is to initialize a `CxJson` structure with a call to `cxJsonInit()`,
34 specifying the allocator that shall be used for allocating values of type `CxJsonValue`. 37 specifying the allocator that shall be used for allocating values of type `CxJsonValue`.
35 38
52 55
53 A complete list of all status codes can be seen [below](#list-of-status-codes). 56 A complete list of all status codes can be seen [below](#list-of-status-codes).
54 57
55 If you want to reuse a `CxJson` structure, you can call `cxJsonReset()`, even if the last operation was a failure. 58 If you want to reuse a `CxJson` structure, you can call `cxJsonReset()`, even if the last operation was a failure.
56 Otherwise, you need to call `cxJsonDestroy()` when you are done with the parser. 59 Otherwise, you need to call `cxJsonDestroy()` when you are done with the parser.
60
61 The function `cxJsonFromString()` combines the above procedure.
57 62
58 ### List of Status Codes 63 ### List of Status Codes
59 64
60 Below is a full list of status codes for `cxJsonNext()`. 65 Below is a full list of status codes for `cxJsonNext()`.
61 66

mercurial