how to generater .h from Json #4554
Unanswered
ringchenhao
asked this question in
Q&A
Replies: 1 comment
-
See https://github.com/nlohmann/json?tab=readme-ov-file#arbitrary-types-conversions |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
my question is how to generater .h from Json without prior knowledge of structural information
my Json is like this:
{
"Diplsy2Project": { "Type":"Char", "Length":32 },
"Version": { "Type":"Char", "Length":16 },
"Timeouts": {
"NormalDataMs":
{
"Type":"Int", "Min":0, "Max":10000, "Value":600
},
"BigDataMs":
{
"Type":"Int", "Min":10, "Max":1000, "Value":200 }
}
}
my Struct in .h is like this:
struct Timeouts
{
int NormalDataMs;
int BigDataMs;
}
struct Total
{
char Diplsy2Project[32];
char Version[16];
Timeouts time_outs;
}
can this lib fix this, or are there other libraries can?
Beta Was this translation helpful? Give feedback.
All reactions