mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Add JSON API
This commit is contained in:
1 parent
b73115c002
commit
106662b1d7
9 files changed
+687
-1
No files matched your search
+17
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "arch.h"
|
||||
#include "str.h"
|
||||
|
||||
#ifndef MG_JSON_MAX_DEPTH
|
||||
#define MG_JSON_MAX_DEPTH 30
|
||||
#endif
|
||||
|
||||
// Error return values - negative. Successful returns are >= 0
|
||||
enum { MG_JSON_TOO_DEEP = -1, MG_JSON_INVALID = -2, MG_JSON_NOT_FOUND = -3 };
|
||||
int mg_json_get(const char *buf, int len, const char *path, int *toklen);
|
||||
|
||||
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);
|
||||
char *mg_json_get_str(struct mg_str json, const char *path);
|
||||
char *mg_json_get_hex(struct mg_str json, const char *path);
|
||||
Reference in new issue
Block a user