Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Dv::Cgi is the namespace for this package. More...


Classes

class  Dv::Cgi::Cgi
 A wrapper class that represents the http interface to a cgi program. More...
class  Dv::Cgi::Cgi::Filter
 Filter class which ensures that header_ is output before anything else. More...
class  Dv::Cgi::CgiError
 A runtime exception thrown by some cgi-related functions. More...
class  Dv::Cgi::HttpHeader
 A class representing the header part of a HTTP response. More...
class  Dv::Cgi::SessionServer
 A class that packages the link to the hidden server. More...
class  Dv::Cgi::SessionServer::Filter
 Filter class that ensures that header_ is output before anything else. More...

Functions

void cgidata (std::string &data) throw (CgiError)
 Fill the parameter string with the data stream passed to the cgi program.
Dv::Util::Propscookieprops (Dv::Util::Props &props) throw ()
 Store cookies as [name,value] pairs in props.
bool urlencoded_formdata (const std::string &data, Dv::Util::Props &props) throw ()
 Convert url encoded form data to <key,value> pairs in Dv::Util::Props.
bool multipart_formdata (const std::string &data, Dv::Util::Props &props) throw ()
 Convert multipart encoded form data to <key,value> pairs in Dv::Util::Props.
bool formdata (const std::string &data, Dv::Util::Props &props) throw ()
 Convert formdata using either urlencoded_formdata or multipart_formdata.
void eof (SessionServer &)
 Convenience function, simply calls refresh on its argument.
std::string & www_decode (std::string &s)
 In-place decode (RFC 1738) of string s.
std::string & www_encode (const std::string &sin, std::string &sout)
 Encode (RFC 1738) string.


Detailed Description

Dv::Cgi is the namespace for this package.

Function Documentation

void cgidata std::string &  data  )  throw (CgiError)
 

Fill the parameter string with the data stream passed to the cgi program.

Further processing can be done with Dv::Cgi::formdata.

Parameters:
data a string that will be filled with the data stream.
Exceptions:
CgiError is thrown when something goes wrong, e.g. illegal protocol etc.
See also:
Dv::Cgi::formdata

Dv::Util::Props& cookieprops Dv::Util::Props props  )  throw ()
 

Store cookies as [name,value] pairs in props.

bool urlencoded_formdata const std::string &  data,
Dv::Util::Props props
throw ()
 

Convert url encoded form data to <key,value> pairs in Dv::Util::Props.

Parameters:
data raw data, typically the result of calling Cgi::cgidata().
props where key=value pairs will be stored.
Returns:
true unless something went wrong.
Warning:
several values for the same keys will be appended to the value associated with the key, separated by comma's.
See also:
Dv::Util::Props

bool multipart_formdata const std::string &  data,
Dv::Util::Props props
throw ()
 

Convert multipart encoded form data to <key,value> pairs in Dv::Util::Props.

Parameters:
data raw data, typically the result of calling Cgi::cgidata().
props where key=value pairs will be stored. For a ``file'' field with name ``myfile'' in a form, props[myfile] will contain the contents of the file while props[myfile-name] will contain the filename, if any was transmitted.
Returns:
true unless something went wrong.
Warning:
several values for the same keys will be appended to the value associated with the key, separated by comma's.
See also:
Dv::Util::Props

bool formdata const std::string &  data,
Dv::Util::Props props
throw ()
 

Convert formdata using either urlencoded_formdata or multipart_formdata.

Parameters:
data raw data, typically the result of calling Cgi::cgidata().
props where key=value pairs will be stored.
Returns:
true unless something went wrong.
Warning:
several values for the same keys will be appended to the value associated with the key, separated by comma's.
See also:
Dv::Util::Props

void eof SessionServer &   ) 
 

Convenience function, simply calls refresh on its argument.

Example:

  Dv::Cgi::SessionServer s(..);

  s.header().content_type("text/html").no_cache();

  while (s) {
    Dv::Util::Props& input(s.props());

    s << "<html>..</html>" << Dv::Cgi::eof;
    }
See also:
operator<<(std::ostream& os, void (*f)(Dv::Cgi::SessionServer&)

std::string& www_decode std::string &  s  ) 
 

In-place decode (RFC 1738) of string s.

Parameters:
s string to be decoded (in-place).
Returns:
reference to parameter

std::string& www_encode const std::string &  sin,
std::string &  sout
 

Encode (RFC 1738) string.

Parameters:
sin input string to be encoded.
sout string that will receive the encoded version of sin.
Returns:
reference to sout.


dvcgi-0.5.12 [27 April, 2004]