Page 1 of 1

Clarification on - YAJL_OBJECT_FIND

Posted: Thu Apr 18, 2024 10:16 am
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? .

Re: Clarification on - YAJL_OBJECT_FIND

Posted: Thu Apr 18, 2024 1:27 pm
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;

Re: Clarification on - YAJL_OBJECT_FIND

Posted: Tue Apr 23, 2024 9:15 am
by THIYAGARAJAN
Thanks Jon.