added REQUEST_HANDLER_CONTEXT.string_array_path_parameter (...) to help user handling list/array parameters

fixed postcondition WSF_REQUEST.set_meta_string_variable ...
This commit is contained in:
Jocelyn Fiat
2012-01-31 12:12:41 +01:00
parent 2c4df29877
commit 945ef79857
3 changed files with 25 additions and 2 deletions

View File

@@ -141,6 +141,29 @@ feature -- String query
Result := string_from (path_parameter (a_name))
end
string_array_path_parameter (a_name: READABLE_STRING_8): detachable ARRAY [READABLE_STRING_32]
local
i: INTEGER
n: INTEGER
do
from
i := 1
n := 1
create Result.make_filled ("", 1, 5)
until
i = 0
loop
if attached string_path_parameter (a_name + "[" + i.out + "]") as v then
Result.force (v, n)
n := n + 1
i := i + 1
else
i := 0 -- Exit
end
end
Result.keep_head (n)
end
string_query_parameter (a_name: READABLE_STRING_8): detachable READABLE_STRING_32
do
Result := string_from (query_parameter (a_name))

View File

@@ -298,7 +298,7 @@ feature -- Access: CGI Meta variables
do
meta_variables_table.force (new_string_value (a_name, a_value), a_name)
ensure
param_set: attached {WSF_STRING} meta_variable (a_name) as val and then val ~ a_value
param_set: attached {WSF_STRING} meta_variable (a_name) as val and then val.url_encoded_string.same_string (a_value)
end
unset_meta_variable (a_name: READABLE_STRING_8)