Copyright (C) 2020, AdaCore
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
function As_Float (Self : JSON_Number) return Interfaces.IEEE_Float_64
Return number value as floating point value.
is raised when value is out of range or not present.
function As_Integer (Self : JSON_Number) return Interfaces.Integer_64
Return number value as integer number. Non-integer value is rounded to integer.
is raised when value is out of range or not present.
type JSON_Number (Kind : JSON_Number_Kind := None) is record
case Kind is
when None =>
null;
when others =>
String_Value : VSS.Strings.Virtual_String;
case Kind is
when None | Out_Of_Range =>
null;
when JSON_Integer =>
Integer_Value : Interfaces.Integer_64;
when JSON_Float =>
Float_Value : Interfaces.IEEE_Float_64;
end case;
end case;
end record;
type JSON_Number_Kind is (None, JSON_Integer, JSON_Float, Out_Of_Range);
Format of the number used to represent value. Note, it is only hint in most cases, implementation may use other format for some reason.