class interface CGI
-- A simple CGI data handling class. Probably slow for large amounts of
-- data, doesn't handle multipart form/data (yet, I need it to), and
-- doesn't handle multiple values per key (not directly anyway).
creation
make
-- Standalone, we simply parse the data, and print it back out.
parse
-- Parse the CGI data, only done once.
feature(s) from CGI
make
-- Standalone, we simply parse the data, and print it back out.
display
-- Display our data.
require
has_data
lookup (key: STRING): STRING
-- Get the value for a key
require
key /= Void;
has_data
ensure
Result /= Void
parse
-- Parse the CGI data, only done once.
has_data: BOOLEAN
feature(s) from CGI
-- Misc features, probably should be in a utility class
decode_string (in: STRING): STRING
-- Decode an HTTP encoded string.
from_hex (in: STRING): CHARACTER
-- Take a two digit hex string, and convert it to a hex character.
require
in.item(1).is_hexadecimal_digit;
in.item(2).is_hexadecimal_digit
feature(s) from CGI
-- Features that really belong in a string class.
split_on (s: STRING ;on: CHARACTER): ARRAY[STRING]
-- split a string on a given character.
split_on_in (s: STRING ;words: COLLECTION[STRING] ;on: CHARACTER)
-- A version of split_in that doesn't assume it knows how
-- you want to split.
require
words /= Void
end of CGI