diff --git a/library/server/wsf/src/request/value/wsf_table.e b/library/server/wsf/src/request/value/wsf_table.e index ecbbc052..0dab49f9 100644 --- a/library/server/wsf/src/request/value/wsf_table.e +++ b/library/server/wsf/src/request/value/wsf_table.e @@ -65,6 +65,11 @@ feature -- Access Result := values.item (k) end + is_empty: BOOLEAN + do + Result := count = 0 + end + count: INTEGER do Result := values.count @@ -108,6 +113,59 @@ feature -- Conversion end end + as_array_of_string: detachable ARRAY [READABLE_STRING_32] + -- Return an array of STRING if possible., otherwise Void + local + i,n: INTEGER + nb: INTEGER + do + from + i := 1 + n := count + create Result.make_filled ("", 1, n) + until + i > n or Result = Void + loop + if attached {WSF_STRING} value (i.out) as s then + Result.put (s.value, i) + nb := nb + 1 + else + Result := Void + end + i := i + 1 + end + if Result /= Void and then nb /= n then + Result := Void + end + ensure + is_array_of_string implies Result /= Void and then Result.count = count and then Result.lower = 1 + end + + is_array_of_string: BOOLEAN + -- Is Current representable as an array of string? + local + i,n, nb: INTEGER + do + from + i := 1 + n := count + nb := 0 + Result := True + until + i > n or not Result + loop + if attached {WSF_STRING} value (i.out) then + nb := nb + 1 + else + Result := False + end + i := i + 1 + end + if nb /= n then + Result := False + end + end + feature -- Element change add_value (a_value: WSF_VALUE; k: READABLE_STRING_32)