c++ jsoncpp: How to know location of incorrect JSON data when json parsing with try/catch?

42 Views Asked by At

There is lots of data in JSON, and I don't want to use IsInt() or IsUInt() when getting data from JSON. Are there any tips for finding the incorrect key (which is an inappropriate key)?

ex)

{
    "a": 0,
    "b": -1, 
    ..... (large data)
}

try {
    value["a"].asUInt();
    value["b"].asUInt(); // type error
    ..
}
catch{
    // how to know "b" is problem?
}

I don't want to use typecheck befause of performance issue

0

There are 0 best solutions below