Home > Back-end >  C parsing json
C parsing json

Time:10-08

Json: : Reader Reader;
Json: : Value Value;

If (reader. Parse (you, value))
{
if (! The value [" rateName "] isNull ())
STD: : string STR=value [r]. "rateName asString ();
When you perform to STD: : string STR=value [r]. "rateName" asString (); At this time, holding such mistakes
An Assertion failed type_==nullValue | | type_==objectValue, trouble q1978211846 directly, thank you very much!

CodePudding user response:

Top, and the block, I'm doing, encounter this problem, and did not cause any of the nodes,

CodePudding user response:

The building Lord solved?
I also met the same problem

CodePudding user response:

I have resolved the building Lord.
If you haven't solve can find my

CodePudding user response:

An Assertion failed type_==nullValue | | type_==objectValue

This sentence is not clear yet, is a null value or object, cannot be converted to a string

CodePudding user response:

I solved the
{" name ":" building night listening to the spring rain ", "age" : 27} to design such a string can solve with the above method,
But [{" name ":" building night listening to the spring rain ", "age" : 27}] will be submitted to an Assertion failed type_==nullValue | | type_==objectValue, you need to use the int size=root. The size ();
for (int i=0; i{
Name=root [I] [r]. "the name" asString ();
Age=root [I] [r]. "age" asInt ();
}
To solve the problem,
I hope it can help you!

CodePudding user response:

This design with you json. If your design is a multiple records.. It should be enclosed in brackets [] data.
There cannot be obtained in asString way. Should be with the value [number] [name] parameters to obtain

CodePudding user response:

Json is what? How to parse, can you say?

CodePudding user response:

What is the original poster with the library

CodePudding user response:

Seems like JSONCPP, heard that CB's own JSON module is also useful
  • Related