Skip to content

Commit

Permalink
Add boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
ynh committed Sep 27, 2013
1 parent 805ac5d commit 48251fb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions library/kernel/json_object.e
Expand Up @@ -101,6 +101,18 @@ feature -- Change Element
put (l_value, key)
end

put_boolean (value: BOOLEAN; key: JSON_STRING)
-- Assuming there is no item of key `key',
-- insert `value' with `key'.
require
key_not_present: not has_key (key)
local
l_value: JSON_BOOLEAN
do
create l_value.make_boolean (value)
put (l_value, key)
end

replace (value: detachable JSON_VALUE; key: JSON_STRING)
-- Assuming there is no item of key `key',
-- insert `value' with `key'.
Expand Down Expand Up @@ -154,6 +166,16 @@ feature -- Change Element
replace (l_value, key)
end

replace_with_boolean (value: BOOLEAN; key: JSON_STRING)
-- Assuming there is no item of key `key',
-- insert `value' with `key'.
local
l_value: JSON_BOOLEAN
do
create l_value.make_boolean (value)
replace (l_value, key)
end

remove (key: JSON_STRING)
-- Remove item indexed by `key' if any.
do
Expand Down

0 comments on commit 48251fb

Please sign in to comment.