comp.lang.ada
 help / color / mirror / Atom feed
* JSON and interpreting JSON objects
@ 2015-03-13 13:15 tonyg
  2015-03-13 15:07 ` Björn Lundin
  0 siblings, 1 reply; 5+ messages in thread
From: tonyg @ 2015-03-13 13:15 UTC (permalink / raw)




I'm playing with some JSON. I am trying to pick some information out of a JSON object but am trying to understand what I am doing first.

In the following code I am not totally sure about displaying a JSON object, and I was wondering what to put in "when JSON_Object_Type =>" I want to traverse over the object and print the information out if you didn't manage to guess what I was trying to do

CODE>>>

with GNATCOLL.JSON; use GNATCOLL.JSON;

  procedure Output_Json (JV : in Json_Value) is

      

   begin
      case Kind(Val => JV) is
         when JSON_Array_Type =>
            for count in 1..JV.Length loop
               Output_Json (JV.Get(count));
               
            end loop;
            
         when JSON_Object_Type =>
            
            
         when JSON_Null_Type =>
            TP.Put_Line("JSON_NULL_TYPE");
         when others =>
            TP.Put_Line(JV.Get'Image);
        

      end case;



   end Json_Stuff;


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-16 13:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 13:15 JSON and interpreting JSON objects tonyg
2015-03-13 15:07 ` Björn Lundin
2015-03-13 16:03   ` tonyg
2015-03-16 12:01   ` tonyg
2015-03-16 13:11     ` tonyg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox