os_form_map |
A container for name/value pairs posted from a form.
An os_form_map
is a container for name/value pairs transmitted from an os_form
. os_form_map is designed for use with an os_form
that specifies an HTTP action URL, the post HTTP
method, and MIME type application/x-www-form-urlencoded
.
An os_form_map
is initialized by reading name/value pairs from an input stream specified in the
constructor, typically cin . The name and value
information is automatically URL-decoded prior to insertion into the os_form_map
.
Several member functions are provided to easily query the form data.
name_exists()
-Indicates whether a given name exists.name_count()
-Indicates how many name/value pairs there are for a given name.first_value()
-Returns the first value for a given name.all_values()
-Returns an STL vector containing all values
for a given name.size()
-Returns the total number of name/value pairs in the os_form_map
. Name/value pairs are stored
internally in an STL multimap . This underlying
container is exposed through the fields() member
function to allow application-specific manipulation of the form data.
Although the os_form_map
makes note of the CGI environment variables REQUEST_METHOD
, CONTENT_TYPE , and CONTENT_LENGTH
, it attempts to initialize itself even if one or more of these environment
variables are invalid. The member functions invalid_environment()
, invalid_request_method() , invalid_content_type()
, invalid_content_length() , and malformed_input()
report the status of the environment and data at the time the os_form_map
was initialized.
typedef multimap< string, string, less< string > >::iterator iterator;
typedef multimap< string, string, less< string > >::const_iterator const_iterator;
true
if the CONTENT_LENGTH environment variable is
not set or is equal to 0.true
if the CONTENT_TYPE environment variable is not
set or does not equal application/x-www-form-urlencoded
.true
if any of the gateway program environment variables REQUEST_METHOD
, CONTENT_TYPE , or CONTENT_LENGTH
are invalid.true
if the REQUEST_METHOD environment variable is
not set or does not equal POST .true
if the input stream, from which the form map was initialized, did not
contain a matched set of name/value pairs.true
if name has a value in the form map.Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved