Fixed compilation issue related to old usage of modified JSON library.

This commit is contained in:
2014-07-07 11:14:36 +02:00
parent 985a5e5ce7
commit 0427f7a8d3
4 changed files with 33 additions and 148 deletions

View File

@@ -69,7 +69,12 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
Result.put_string (f.name, "file_name") Result.put_string (f.name, "file_name")
Result.put_string (f.type, "file_type") Result.put_string (f.type, "file_type")
Result.put_integer (f.size, "file_size") Result.put_integer (f.size, "file_size")
Result.put_string (f.id, "file_id") if attached f.id as fid then
Result.put_string (fid, "file_id")
else
Result.put (Void, "file_id")
end
end end
Result.put_boolean (disabled, "disabled") Result.put_boolean (disabled, "disabled")
Result.put_boolean (image_preview, "image_preview") Result.put_boolean (image_preview, "image_preview")
@@ -98,11 +103,21 @@ feature -- Event handling
f_type := f.type f_type := f.type
f_size := f.size f_size := f.size
f_id := f.id f_id := f.id
end
state_changes.replace_with_string (f_name, "file_name") state_changes.replace_with_string (f_name, "file_name")
state_changes.replace_with_string (f_type, "file_type") state_changes.replace_with_string (f_type, "file_type")
state_changes.replace_with_integer (f_size, "file_size") state_changes.replace_with_integer (f_size, "file_size")
else
state_changes.replace (Void, "file_name")
state_changes.replace (Void, "file_type")
state_changes.replace (Void, "file_size")
end
if f_id /= Void then
state_changes.replace_with_string (f_id, "file_id") state_changes.replace_with_string (f_id, "file_id")
else
state_changes.replace (Void, "file_id")
end
end end
end end
end end

View File

@@ -36,7 +36,7 @@ feature --Properties
is_uploaded: BOOLEAN is_uploaded: BOOLEAN
-- Whether the file denoted by this abstract file has been uploaded. -- Whether the file denoted by this abstract file has been uploaded.
do do
Result := attached id Result := id /= Void
end end
name: STRING_32 name: STRING_32
@@ -51,4 +51,14 @@ feature --Properties
id: detachable STRING_32 id: detachable STRING_32
-- Server side file id (e.g. S3 filename) -- Server side file id (e.g. S3 filename)
;note
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end end

View File

@@ -18,147 +18,6 @@ inherit
create create
make make
feature -- Change
put_string (value: detachable READABLE_STRING_GENERAL; 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: detachable JSON_STRING
do
if attached value as a_value then
create l_value.make_json_from_string_32 (a_value.as_string_32)
end
put (l_value, key)
ensure
has_key: has_key (key)
end
put_integer (value: detachable INTEGER_64; 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: detachable JSON_NUMBER
do
if attached value as a_value then
create l_value.make_integer (a_value)
end
put (l_value, key)
ensure
has_key: has_key (key)
end
put_natural (value: detachable NATURAL_64; 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: detachable JSON_NUMBER
do
if attached value as a_value then
create l_value.make_natural (a_value)
end
put (l_value, key)
ensure
has_key: has_key (key)
end
put_real (value: detachable DOUBLE; 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: detachable JSON_NUMBER
do
if attached value as a_value then
create l_value.make_real (a_value)
end
put (l_value, key)
ensure
has_key: has_key (key)
end
put_boolean (value: detachable 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: detachable JSON_BOOLEAN
do
if attached value as a_value then
create l_value.make_boolean (a_value)
end
put (l_value, key)
ensure
has_key: has_key (key)
end
replace_with_string (value: detachable READABLE_STRING_GENERAL; key: JSON_STRING)
-- Assuming there is no item of key `key',
-- insert `value' with `key'.
local
l_value: detachable JSON_STRING
do
if attached value as a_value then
create l_value.make_json_from_string_32 (value.as_string_32)
end
replace (l_value, key)
end
replace_with_integer (value: detachable INTEGER_64; key: JSON_STRING)
-- Assuming there is no item of key `key',
-- insert `value' with `key'.
local
l_value: detachable JSON_NUMBER
do
if attached value as a_value then
create l_value.make_integer (a_value)
end
replace (l_value, key)
end
replace_with_with_natural (value: detachable NATURAL_64; key: JSON_STRING)
-- Assuming there is no item of key `key',
-- insert `value' with `key'.
local
l_value: detachable JSON_NUMBER
do
if attached value as a_value then
create l_value.make_natural (a_value)
end
replace (l_value, key)
end
replace_with_real (value: detachable DOUBLE; key: JSON_STRING)
-- Assuming there is no item of key `key',
-- insert `value' with `key'
local
l_value: detachable JSON_NUMBER
do
if attached value as a_value then
create l_value.make_real (a_value)
end
replace (l_value, key)
end
replace_with_boolean (value: detachable BOOLEAN; key: JSON_STRING)
-- Assuming there is no item of key `key',
-- insert `value' with `key'.
local
l_value: detachable JSON_BOOLEAN
do
if attached value as a_value then
create l_value.make_boolean (a_value)
end
replace (l_value, key)
end
note note
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others" copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"

View File

@@ -57,7 +57,8 @@
<library name="wsf_policy_driven" location="..\library\server\wsf\wsf_policy_driven-safe.ecf" readonly="false"/> <library name="wsf_policy_driven" location="..\library\server\wsf\wsf_policy_driven-safe.ecf" readonly="false"/>
<library name="wsf_router_context" location="..\library\server\wsf\wsf_router_context-safe.ecf" readonly="false"/> <library name="wsf_router_context" location="..\library\server\wsf\wsf_router_context-safe.ecf" readonly="false"/>
<library name="wsf_session" location="..\library\server\wsf\wsf_session-safe.ecf" readonly="false"/> <library name="wsf_session" location="..\library\server\wsf\wsf_session-safe.ecf" readonly="false"/>
<library name="widgetapp" location="..\examples\widgetapp\widgetapp.ecf" readonly="false"/> <library name="wsf_js_widget" location="..\draft\library\server\wsf_js_widget\wsf_js_widget-safe.ecf" readonly="false"/>
<library name="wsf_js_widget_demo" location="..\draft\library\server\wsf_js_widget\examples\demo\demo.ecf" readonly="false"/>
</target> </target>
<target name="all_windows" extends="all"> <target name="all_windows" extends="all">
<description>Compiling as Windows , on other platforms than Windows</description> <description>Compiling as Windows , on other platforms than Windows</description>