Add helper function mg_json_get_tok

This commit is contained in:
Sergey Lyubka committed 2024-02-01 12:05:49 +00:00
1 parent ebfa5f0ba7
commit f231760395
4 files changed
+300 -285

No files matched your search

+1
View File
@@ -11,6 +11,7 @@
enum { MG_JSON_TOO_DEEP = -1, MG_JSON_INVALID = -2, MG_JSON_NOT_FOUND = -3 };
int mg_json_get(struct mg_str json, const char *path, int *toklen);
struct mg_str mg_json_get_tok(struct mg_str json, const char *path);
bool mg_json_get_num(struct mg_str json, const char *path, double *v);
bool mg_json_get_bool(struct mg_str json, const char *path, bool *v);
long mg_json_get_long(struct mg_str json, const char *path, long dflt);