Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
staticjson/staticjson.hpp
✓ #include <staticjson/staticjson.hpp>
Parse JSON into a struct
#include <staticjson/staticjson.hpp>
#include <iostream>
struct Point { double x, y; };
namespace staticjson {
template <> struct TypeHandler<Point> {
static bool from_json(const Document &d, Point &p) {
p.x = d["x"].GetDouble();
p.y = d["y"].GetDouble();
return true;
}
};
}
int main() {
staticjson::Document doc;
doc.Parse("{\"x\":1.0,\"y\":2.0}");
Point p;
staticjson::from_json(doc, p);
std::cout << p.x << ", " << p.y << std::endl;
return 0;
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.