Removed any (put|write)_file_content from the WSF_ or WGI_ OUTPUT classes

Now DEFAULT_SERVICE has to be created instead of inherited.
   - This seems to be better for new user, and this avoid potential conflict and difference when inheriting between the various DEFAULT_SERVICE implementation.
   - remember that DEFAULT_SERVICE, is mainly to help the user to build its very first service.
Use READABLE_STRING_8 as argument whenever it is possible.
Added WSF_RESPONSE_MESSAGE, and WSF_RESPONSE.put_response (a_response_message)
Now WSF_RESPONSE inherit from WGI_RESPONSE
This commit is contained in:
Jocelyn Fiat
2011-12-12 11:16:15 +01:00
parent 019fb539ae
commit 89572b4f33
19 changed files with 426 additions and 128 deletions

View File

@@ -6,7 +6,7 @@ note
deferred class
WGI_RESPONSE
feature {WGI_SERVICE} -- Commit
feature {WGI_RESPONSE, WGI_SERVICE} -- Commit
commit
-- Commit the current response
@@ -110,13 +110,6 @@ feature -- Output operation
deferred
end
write_file_content (fn: READABLE_STRING_8)
-- Send the content of file `fn'
require
message_writable: message_writable
deferred
end
flush
-- Flush if it makes sense
deferred

View File

@@ -43,25 +43,6 @@ feature -- Basic operation
put_string (s.substring (start_index, end_index))
end
put_file_content (fn: STRING)
-- Send the content of file `fn'
local
f: RAW_FILE
do
create f.make (fn)
if f.exists and then f.is_readable then
f.open_read
from
until
f.exhausted
loop
f.read_stream (4096)
put_string (f.last_string)
end
f.close
end
end
put_header_line (s: STRING)
-- Send `s' to http client as header line
do

View File

@@ -115,12 +115,6 @@ feature -- Output operation
output.put_substring (s, start_index, end_index)
end
write_file_content (fn: READABLE_STRING_8)
-- Send the content of file `fn'
do
output.put_file_content (fn)
end
flush
do
output.flush

View File

@@ -46,28 +46,6 @@ feature -- Output
put_string (c.out)
end
put_file_content (fn: READABLE_STRING_8)
-- Send the content of file `fn'
require
string_not_empty: not fn.is_empty
is_readable: (create {RAW_FILE}.make (fn)).is_readable
local
f: RAW_FILE
do
create f.make (fn)
check f.exists and then f.is_readable end
f.open_read
from
until
f.exhausted
loop
f.read_stream (4096)
put_string (f.last_string)
end
f.close
end
feature -- Specific output
put_header_line (s: READABLE_STRING_8)