This commit is contained in:
Sergey Lyubka committed 2022-07-01 17:28:06 +01:00
1 parent a183621268
commit f1da8542ce
20 files changed
+136 -120

No files matched your search

+3 -3
View File
@@ -2840,7 +2840,7 @@ mg_json_get_bool(mg_str("[true]", "$[0]", &b)); // b is true
### mg\_json\_get\_long()
```c
long mg_json_get_bool(struct mg_str json, const char *path, long default_val);
long mg_json_get_long(struct mg_str json, const char *path, long default_val);
```
Fetch integer numeric (long) value from the json string `json` at JSON path
@@ -2856,8 +2856,8 @@ Return value: found value, or `default_val` value
Usage example:
```c
long a = mg_json_get_bool(mg_str("[123]", "$a", -1)); // a = -1
long b = mg_json_get_bool(mg_str("[123]", "$[0]", -1)); // b = 123
long a = mg_json_get_long(mg_str("[123]", "$a", -1)); // a = -1
long b = mg_json_get_long(mg_str("[123]", "$[0]", -1)); // b = 123
```
### mg\_json\_get\_str()