Registry / serialization / daw-json-link

daw-json-link

JSON →
library3.31.0vcpkgunverified

Perhaps the fastest JSON deserializer/serializer possible or at least close to it.

vcpkg install daw-json-link
INSTALL
IMPORT
SIG · DAW-JSON-LINK
D
daw-json-link
serializationcppv3.31.0
harness data pending
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.

daw/json/daw_json_link.h
#include <daw/json/daw_json_link.h>

Deserialize JSON to a struct using daw_json_link

#include <daw/json/daw_json_link.h> #include <iostream> #include <string> struct Point { double x, y; }; namespace daw::json { template<> struct json_data_contract<Point> { static constexpr auto to_json_data = make_member_list( "x", &Point::x, "y", &Point::y ); }; } int main() { std::string json = R"({"x":1.0,"y":2.0})"; Point p = daw::json::from_json<Point>(json); std::cout << p.x << ", " << p.y << std::endl; return 0; }
Debug
Known issues
gotchaRequires C++17 or later; compile-time reflection may cause long compilation times.
fix
Use C++17 or later and consider precompiled headers.
affects: *
Upgrade
Version history
3.31.0latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources

No resource links recorded.

daw-json-link — pip install daw-json-link · libregistry