This class encapsulates CGI input. More...
#include <DwmCgi.hh>
Public Types | |
| typedef std::map< std::string, std::string > | valueMap_t |
| typedef valueMap_t::iterator | iterator |
| typedef valueMap_t::const_iterator | const_iterator |
Public Member Functions | |
| Cgi () | |
| Constructor. | |
| ~Cgi () | |
| destructor | |
| const std::string & | RequestMethod () const |
| Returns the HTTP request method. | |
| const std::string & | RequestMethod (const std::string &requestMethod) |
| Sets and returns the HTTP request method. | |
| valueMap_t & | QueryValues () |
| Returns a reference to the query values sent by the client. | |
| valueMap_t & | EnvValues () |
This class encapsulates CGI input.
It is used for storing name/value pairs from CGI input (usually HTML forms) sent via an HTTP POST or GET operation. The constructor does the work of getting the data, hence you should likely only have a single Cgi object in a program. I haven't made this class a true singleton, but may do so in the future.
Under the hood... the implementation uses a trivial flex lexer to get CGI data from the environment (in the case of a GET operation) or stdin (in the case of a POST operation). It also unescapes any escape codes in the input values.
| Dwm::Cgi::Cgi | ( | ) |
Constructor.
Retrieves data from CGI and stores name/value pairs (as strings) in a map<string,string,less<string> >. The map is accessible via the QueryStrings() method.
| valueMap_t & Dwm::Cgi::QueryValues | ( | ) |
Returns a reference to the query values sent by the client.
These are the name/value pairs from CGI, typically from HTML form fields.