https://github.com/jacobious52/json-generics
Classes to provide plain text serializable generic support for common C++ data types.
https://github.com/jacobious52/json-generics
Last synced: over 1 year ago
JSON representation
Classes to provide plain text serializable generic support for common C++ data types.
- Host: GitHub
- URL: https://github.com/jacobious52/json-generics
- Owner: Jacobious52
- License: mit
- Created: 2015-10-03T11:11:27.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-15T00:34:53.000Z (over 10 years ago)
- Last Synced: 2025-01-18T05:09:07.420Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Generics
Classes to provide json serializable generic support for common C++ data types.
Allows for having mixed types in other generic types.
Built in json serialization behaviour using streams
e.g Have a map with a string and a vector, which has a float and a string and another map inside, with an int... etc
#Really Basic Reading From File Usage
This uses a json helper to avoid messing with pointers and generic types
```
Json json = Json::load("imaginary_users_list_or_something.json");
std::string email = json["users"]["jayp"]["email"].asString();
int something = json["stuff"][0]["things"]["deeper"][32].asInt();
```
`Generic - base class`
`GNumber - int \ float`
`GString - std::string`
`GArray - std::vector`
`GDict - std::map`
____
`GConfig` - Wrapper around a `GDict`
Used for writing and reading from a file. In a json format