comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: Newbie GNATCOLL question
Date: Tue, 29 Oct 2019 05:54:01 -0700 (PDT)
Date: 2019-10-29T05:54:01-07:00	[thread overview]
Message-ID: <19c2d3be-d639-4c11-9d3a-e469cb9ab7be@googlegroups.com> (raw)

Hi,
  
GNATCOLL.JSON question:

I want to test if an object "state" (JSON_Value) is like "{"name":"blabla"}"
which is almost an empty (sub-)object and which I want to avoid to include
in the (super-)object "cell".

The following  code/hack works:

------------------------------------------------------------
declare
   a : constant JSON_Value := Clone(state);
begin
   a.unset_field(Field_Name => "name");
   if not a.is_empty then
      cell.Set_Field(Field_Name => "state",Field => state);
   end if;
end;
-------------------------------------------------------------

I assume this is clumsy. Is there a shorter way?

reinert


                 reply	other threads:[~2019-10-29 12:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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