#include <config_processor.hh>
Inheritance diagram for mpcl::net::cgi::TConfigProcessor:
Public Methods | |
TConfigProcessor (int iPARAMETER_COUNT, const char **ppkcPARAMETERS) | |
void | processOptions (void) |
const TString & | getFormValue (const char *pkcNAME) const |
const TString & | getFormValue (const std::string &rkyNAME) const |
bool | hasFormOption (const TString &rkyNAME) const |
bool | hasInput (void) const |
bool | hasOption (const TString &rkyNAME) const |
void | updateForm (text::html::TForm &rtTARGET_FORM) const |
Protected Methods | |
void | processCommandLine (void) |
Loads variables from command-line in CGI fashion. | |
void | readFormData (std::basic_istream< char_type, traits_type > &rtSOURCE_ISTREAM) |
TOption & | updateFormOption (const TString &rkyNAME, const TString &rkyVALUE) |
TOption & | updateOptionWithName (const TString &rkyNAME, const TString &rkyVALUE) |
In CGI programs, the parameters come in this format:
<name_1>=[<value_1>]&<name_2>=[<value_2>]&...<name_n>=[<value_n>]
Furthermore, options can have more than one value. One of the most useful techniques used in HTMLL is coding identifier and value as NAME attribute of THtmlInputImage (input type=image). This must be done cause to the fact that, when that type of input is used, the value provided by the server is:
<name.x>=<position_x>&<name.y>=<position_y>
As you can see, there is no value attribute, so HTMLL bypasses this problem encoding name as a pair of identifier and value. Then, the server will give us, something like this:
<identifier/value.x>=<position_x>&<identifier/value.y>=<position_y>
Next this is translated to:
<identifier>=<value>&<identifier>=<value>
Definition at line 75 of file net/cgi/config_processor.hh.
|
Builds a new instance, and adds all environment variables sets by the HTTP server.
Reimplemented from mpcl::util::prefs::TConfigProcessor. Definition at line 40 of file net/cgi/config_processor.cc. References mpcl::util::prefs::TConfigProcessor::addEnvironmentVariable(). |
|
Gets form option value corresponding to name rkyNAME.
Definition at line 177 of file net/cgi/config_processor.hh. References getFormValue(), and mpcl::text::TString. |
|
Gets form option value corresponding to name pkcNAME.
Definition at line 299 of file net/cgi/config_processor.cc. References mpcl::text::Format(), and mpcl::text::TString. Referenced by getFormValue(). |
|
True if there is an form option called rkyNAME. Definition at line 329 of file net/cgi/config_processor.cc. References mpcl::text::TString. |
|
Returns true if there was any kind of input (from command-line, or from standard input). Definition at line 191 of file net/cgi/config_processor.hh. |
|
True if there is an option called rkyNAME. Definition at line 350 of file net/cgi/config_processor.cc. References mpcl::util::prefs::TConfigProcessor::tOptionVector, and mpcl::text::TString. |
|
Loads options from the source defined in the CGI environment variables (from standard-input or from an environment variable). Reimplemented from mpcl::util::prefs::TConfigProcessor. Definition at line 69 of file net/cgi/config_processor.cc. References mpcl::util::prefs::TConfigProcessor::environmentValue(), mpcl::util::prefs::TConfigProcessor::gOptionsProcessed, mpcl::util::prefs::TConfigProcessor::processConfigFile(), readFormData(), and mpcl::text::TString. |
|
Loads variables from standard-input in CGI fashion. Definition at line 151 of file net/cgi/config_processor.cc. References mpcl::text::html::kcIdentifierValueSeparator, mpcl::text::TString, and updateFormOption(). Referenced by processOptions(). |
|
Updates form qtTARGET_FORM with values parsed from input (from command-line, or from standard input). Definition at line 371 of file net/cgi/config_processor.cc. References mpcl::text::html::TContainer::reset(), and mpcl::text::html::TForm::setValues(). |
|
Updates form variable named rkyNAME with value rkyVALUE. If there is no form variable named rkyNAME, then a new form option is added.
Definition at line 214 of file net/cgi/config_processor.cc. References mpcl::text::TString. Referenced by readFormData(). |
|
Updates option named rkyNAME with value rkyVALUE.
Reimplemented from mpcl::util::prefs::TConfigProcessor. Definition at line 254 of file net/cgi/config_processor.cc. References mpcl::util::prefs::TConfigProcessor::tOptionVector, and mpcl::text::TString. Referenced by processCommandLine(). |