https://github.com/lzpdark/jsonparser
try to parse json, make it easy to unserstand
https://github.com/lzpdark/jsonparser
cpp json
Last synced: about 2 months ago
JSON representation
try to parse json, make it easy to unserstand
- Host: GitHub
- URL: https://github.com/lzpdark/jsonparser
- Owner: lzpDark
- License: gpl-3.0
- Created: 2021-06-01T17:38:33.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-04-16T17:04:37.000Z (about 4 years ago)
- Last Synced: 2023-08-17T15:47:56.720Z (almost 3 years ago)
- Topics: cpp, json
- Language: C++
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsonparser
An easy implement of json-parser.
## Usage
#### parse string into object
```cpp
const char *input = "{\"subObj\":{\"subAge\":13}, \"age\":12, \"name\":\"lzp\", \"gender\":\"man\", \"good\":true, \"hungry\":false, \"tag\":null}";
auto jsonObj = parseObject(input);
```
#### get string from object
```cpp
JsonObject obj;
obj.addValue("num_key", 1);
obj.addValue("false_key", false);
std::cout << toJson(&obj) << std::endl;
```