Request Class Reference

#include <Request.h>

Collaboration diagram for Request:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Request ()
 ~Request ()
void sendHeaders (std::ostream &os=std::cout)
void setHeader (std::string header, std::string value)
void parse ()
std::string param (const std::string key)
std::vector< std::string > allParams (const std::string key)
void setParam (const std::string key, const std::string value)
void dumpParams ()


Constructor & Destructor Documentation

Request::Request (  ) 

00024                 {
00025    std::cerr << "Request object is build!\n";
00026    parse();
00027 }

Here is the call graph for this function:

Request::~Request (  ) 

00029                  {
00030         cleanUp();
00031 }


Member Function Documentation

std::vector<std::string> Request::allParams ( const std::string  key  ) 

void Request::dumpParams (  ) 

00127                         {
00128    repository.dump();
00129 }

Here is the call graph for this function:

std::string Request::param ( const std::string  key  ) 

void Request::parse (  ) 

00072                    {
00073 
00074    // TODO First get suitable Extractor 
00075    // Then extract data 
00076    // Get suitable parser
00077    // Add it to repository
00078 
00079    // TODO XXX Build apopriate parser 
00080    //ParserFactory factory;
00081    //AbstractParser * parser = factory.buildParser(getenv("CONTENT_TYPE"));
00082    //parser->parse(&data);
00083 
00084    // Process GET params
00085         if (getenv("QUERY_STRING")){
00086                 data = getenv("QUERY_STRING");
00087         }
00088  
00089    if (data.length() > 0){
00090       data += "&";
00091    }
00092    
00093    data = data + getPostParams();
00094         tool.Tokenize(data, tokens);
00095 
00096    cerr << data;    
00097 
00098    // XXX Optimizations needed!
00099         for (unsigned int i = 0; i < tokens.size(); i++){
00100       paramsToken.clear();
00101       tool.TokenizeFirst(tokens[i], paramsToken, "=");
00102       std::string key("");
00103 
00104       // We should go only twice throught this loop
00105       for (unsigned int j = 0; j < paramsToken.size(); j++){
00106          if (key.length() <= 0){
00107             key = paramsToken[j];
00108          } else {
00109             repository.push(key, paramsToken[j]);
00110          }
00111       }
00112         }
00113 }

Here is the call graph for this function:

void Request::sendHeaders ( std::ostream &  os = std::cout  ) 

void Request::setHeader ( std::string  header,
std::string  value 
)

void Request::setParam ( const std::string  key,
const std::string  value 
)


The documentation for this class was generated from the following files:

Generated on Wed Dec 23 14:15:05 2009 for CPPFrame by  doxygen 1.5.8