This site contains older material on Eiffel. For the main Eiffel page, see http://www.eiffel.com.

Appendix A: class CGI_INTERFACE

indexing

description: "Access to information provided by a user through an HTML form. This class may be used as ancestor by classes needing its facilities."
status: ""
date: "$Date: 2007-03-30 19:10:11 +0000 (Fri, 30 Mar 2007) $"
revision: "$Revision: 95354 $"
deferred class interface
CGI_INTERFACE
feature -- Initialization

make
-- Initiate input data parsing and process information.

make_debug (args: ARRAY [STRING])
-- Set environment variables and proceed to regular execution.
feature -- Access

fields: ARRAY [STRING]
-- Names of fields in the form.

value (field_name: STRING): STRING
-- First (unique?) value for a field.
require
field_not_void: field_name /= Void;
field_exists: field_defined (field_name)
ensure
value_exists: Result /= Void

value_count (field_name: STRING): INTEGER
-- Number of values for a field.
require
field_not_void: field_name /= Void;
field_exists: field_defined (field_name)
ensure
valid_count: Result >= 0

value_list (field_name: STRING): LINKED_LIST [STRING]
-- List of values for a field.
require
field_not_void: field_name /= Void;
field_exists: field_defined (field_name)
ensure
valid_count: Result.count = value_count (field_name)
feature -- Status report

field_defined (field_name: STRING): BOOLEAN
-- Is field field_name defined?
feature -- Status setting

set_exception_trace
-- Display exception trace on exception.

set_message
-- Display error message on exception.

set_no_debug
-- Do nothing on exception.
feature -- HTTP facilities

Generate_html_header
-- Generate CGI header reply.
feature -- Miscellanous

execute
-- Process user provided information.

set_environment
-- Set environment variable to user value.
end -- class CGI_INTERFACE

Table of contents | Next chapter