Changed the WGI_INPUT_STREAM and WGI_OUTPUT_STREAM interfaces

main changes for existing code  `read_stream' is renamed `read_string'
This commit is contained in:
Jocelyn Fiat
2011-11-14 14:17:41 +01:00
parent bc2e8b8ee2
commit 13b09adc8c
19 changed files with 334 additions and 113 deletions

View File

@@ -10,9 +10,9 @@
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="connector" location="..\connector-safe.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi-safe.ecf" />
<library name="connector" location="..\connector-safe.ecf"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf"/>
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi-safe.ecf"/>
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>
<cluster name="src" location=".\" recursive="true"/>
</target>

View File

@@ -32,9 +32,38 @@ feature {NONE} -- Initialization
create last_string.make_empty
end
feature -- Basic operation
feature -- Status report
read_stream (nb_char: INTEGER)
is_open_read: BOOLEAN
-- Can items be read from input stream?
do
Result := True
end
end_of_input: BOOLEAN
-- Has the end of input stream been reached?
do
Result := fcgi.fcgi_end_of_input
end
feature -- Input
read_character
-- Read the next character in input stream.
-- Make the result available in `last_character'.
local
s: STRING
do
create s.make (1)
fcgi.fill_string_from_stdin (s, 1)
if s.count >= 1 then
last_character := s.item (1)
else
last_character := '%U'
end
end
read_string (nb_char: INTEGER)
-- Read a string of at most `nb_char' bound characters
-- or until end of file.
-- Make result available in `last_string'.
@@ -47,6 +76,9 @@ feature -- Access
last_string: STRING
-- Last string read
last_character: CHARACTER_8
-- Last item read
feature {NONE} -- Implementation
fcgi: FCGI;

View File

@@ -28,6 +28,14 @@ feature {NONE} -- Initialization
fcgi := a_fcgi
end
feature -- Status report
is_open_write: BOOLEAN
-- Can items be written to output stream?
do
Result := True
end
feature -- Status writing
put_status_line (a_code: INTEGER)
@@ -56,6 +64,13 @@ feature -- Basic operation
fcgi.put_string (s)
end
feature -- Basic operations
flush
-- Flush buffered data to disk.
do
end
feature {NONE} -- Implementation
fcgi: FCGI