Clarification on - YAJL_OBJECT_FIND

Discussions relating to the ScottKlement.com port of the open source YAJL JSON Reader/Generator. This includes the YAJL tool as well as the YAJLR4, YAJLGEN, YAJLINTO and YAJLDTAGEN add-ons from ScottKlement.com. http://www.scottklement.com/yajl/
Post Reply
THIYAGARAJAN
Posts: 7
Joined: Sat Jul 01, 2023 3:57 pm

Clarification on - YAJL_OBJECT_FIND

Post by THIYAGARAJAN »

Hi Guys,
I am using YAJL_OBJECT_FIND(DocNode: 'String'); to find a node inside a JSON.
If the node is not present then it will return SPP:NULL else an address of the node. My doubt here is - is there a way to validate whether Node is found or not? .
jonboy49
Posts: 218
Joined: Wed Jul 28, 2021 8:18 pm

Re: Clarification on - YAJL_OBJECT_FIND

Post by jonboy49 »

Unless I misunderstand you, you have answered your own question.

YAJL_OBJECT_FIND returns a pointer so one way to test is simply:

Code: Select all

node = YAJL_OBJECT_FIND(.....);

if node <> *Null;
   // node is valid
else;
   // node not found
endif;
THIYAGARAJAN
Posts: 7
Joined: Sat Jul 01, 2023 3:57 pm

Re: Clarification on - YAJL_OBJECT_FIND

Post by THIYAGARAJAN »

Thanks Jon.
Post Reply