Rename procedures. Change input type of replace_with_string and

put_string
This commit is contained in:
YNH Webdev
2013-09-25 10:03:38 +02:00
parent 95fd5f93fc
commit 4d0dc964da

View File

@@ -52,15 +52,21 @@ feature -- Change Element
object.extend (l_value, key) object.extend (l_value, key)
end end
put_string (value: detachable JSON_STRING; key: JSON_STRING) put_string (value: detachable READABLE_STRING_GENERAL; key: JSON_STRING)
-- Assuming there is no item of key `key', -- Assuming there is no item of key `key',
-- insert `value' with `key'. -- insert `value' with `key'.
require require
key_not_present: not has_key (key) key_not_present: not has_key (key)
local
l_value: detachable JSON_STRING
do do
put (value, key) if attached value as v then
create l_value.make_json_from_string_32 (v.as_string_32)
end
put (l_value, key)
end end
put_integer (value: detachable INTEGER_64; key: JSON_STRING) put_integer (value: detachable INTEGER_64; key: JSON_STRING)
-- Assuming there is no item of key `key', -- Assuming there is no item of key `key',
-- insert `value' with `key'. -- insert `value' with `key'.
@@ -116,14 +122,19 @@ feature -- Change Element
object.force (l_value, key) object.force (l_value, key)
end end
replace_string (value: detachable JSON_STRING; key: JSON_STRING) replace_with_string (value: detachable READABLE_STRING_GENERAL; key: JSON_STRING)
-- Assuming there is no item of key `key', -- Assuming there is no item of key `key',
-- insert `value' with `key'. -- insert `value' with `key'.
local
l_value: detachable JSON_STRING
do do
replace (value, key) if attached value as v then
create l_value.make_json_from_string_32 (v.as_string_32)
end
replace (l_value, key)
end end
replace_integer (value: detachable INTEGER_64; key: JSON_STRING) replace_with_integer (value: detachable INTEGER_64; key: JSON_STRING)
-- Assuming there is no item of key `key', -- Assuming there is no item of key `key',
-- insert `value' with `key'. -- insert `value' with `key'.
local local
@@ -135,7 +146,7 @@ feature -- Change Element
replace (l_value, key) replace (l_value, key)
end end
replace_natural (value: detachable NATURAL_64; key: JSON_STRING) replace_with_with_natural (value: detachable NATURAL_64; key: JSON_STRING)
-- Assuming there is no item of key `key', -- Assuming there is no item of key `key',
-- insert `value' with `key'. -- insert `value' with `key'.
local local
@@ -147,7 +158,7 @@ feature -- Change Element
replace (l_value, key) replace (l_value, key)
end end
replace_real (value: detachable DOUBLE; key: JSON_STRING) replace_with_real (value: detachable DOUBLE; key: JSON_STRING)
-- Assuming there is no item of key `key', -- Assuming there is no item of key `key',
-- insert `value' with `key'. -- insert `value' with `key'.
local local