comp.lang.ada
 help / color / mirror / Atom feed
From: tonyg <tonythegair@gmail.com>
Subject: JSON and interpreting JSON objects
Date: Fri, 13 Mar 2015 06:15:13 -0700 (PDT)
Date: 2015-03-13T06:15:13-07:00	[thread overview]
Message-ID: <fd80c709-5195-4a5b-b276-5c8931e47511@googlegroups.com> (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;


             reply	other threads:[~2015-03-13 13:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 13:15 tonyg [this message]
2015-03-13 15:07 ` JSON and interpreting JSON objects Björn Lundin
2015-03-13 16:03   ` tonyg
2015-03-16 12:01   ` tonyg
2015-03-16 13:11     ` tonyg
replies disabled

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