C++ common classes
General purpose classes for use across projects (Apache license)
CGICPlusPlus Class Reference

Wrapper to simplify C++ creation of CGI programs. More...

#include <CGICPlusPlus.h>

List of all members.

Public Member Functions

 CGICPlusPlus ()
virtual ~CGICPlusPlus ()
int GetVariableCount ()
 Get the number of variables that we found.
const char * GetEnvironmentValue (const char *pVariable)
 Return the value of an environment variable.
const char * GetCGIVariable (const char *pKey)
 Get the value of a CGI variable.
void SetResponseMimeType (const char *pMimeType)
 Add response header.
void AddToHeader (const char *pContent)
 Add to header.
void AddToResponse (const char *pContent)
 Add to response.
void OutputResponse ()
 Output the response.
void ProcessRequest ()
 This function will direct to one of the following 4 function based on the http verb.
virtual void ProcessHEADRequest ()
 You must implement this method in a derived class.
virtual void ProcessGETRequest ()
 You must implement this method in a derived class.
virtual void ProcessPOSTRequest ()
 You must implement this method in a derived class.
virtual void ProcessDELETERequest ()
 You must implement this method in a derived class.
virtual void ProcessPUTRequest ()
 You must implement this method in a derived class.

Protected Member Functions

char x2c (char *what)
 Convert a two-char hex string into a char.
void unescape_url (char *url)
 Reduce any xx escape sequences to the characters they represent.
bool ParseRequest ()
 Parse request.

Protected Attributes

MAP_CGI_VALUES mCgiMap
CVIter cIter
string sResponse
string sHeader
string sEnvVar

Detailed Description

Wrapper to simplify C++ creation of CGI programs.

Definition at line 48 of file CGICPlusPlus.h.


Constructor & Destructor Documentation

Definition at line 25 of file CGICPlusPlus.cpp.

Definition at line 39 of file CGICPlusPlus.cpp.


Member Function Documentation

void CGICPlusPlus::AddToHeader ( const char *  pContent)

Add to header.

Definition at line 145 of file CGICPlusPlus.cpp.

void CGICPlusPlus::AddToResponse ( const char *  pContent)

Add to response.

Definition at line 139 of file CGICPlusPlus.cpp.

const char * CGICPlusPlus::GetCGIVariable ( const char *  pKey)

Get the value of a CGI variable.

Definition at line 189 of file CGICPlusPlus.cpp.

const char * CGICPlusPlus::GetEnvironmentValue ( const char *  pVariable)

Return the value of an environment variable.

Definition at line 180 of file CGICPlusPlus.cpp.

Get the number of variables that we found.

Definition at line 172 of file CGICPlusPlus.cpp.

Output the response.

Definition at line 162 of file CGICPlusPlus.cpp.

bool CGICPlusPlus::ParseRequest ( ) [protected]

Parse request.

Definition at line 45 of file CGICPlusPlus.cpp.

virtual void CGICPlusPlus::ProcessDELETERequest ( ) [inline, virtual]

You must implement this method in a derived class.

Definition at line 77 of file CGICPlusPlus.h.

virtual void CGICPlusPlus::ProcessGETRequest ( ) [inline, virtual]

You must implement this method in a derived class.

Definition at line 73 of file CGICPlusPlus.h.

virtual void CGICPlusPlus::ProcessHEADRequest ( ) [inline, virtual]

You must implement this method in a derived class.

Definition at line 71 of file CGICPlusPlus.h.

virtual void CGICPlusPlus::ProcessPOSTRequest ( ) [inline, virtual]

You must implement this method in a derived class.

Definition at line 75 of file CGICPlusPlus.h.

virtual void CGICPlusPlus::ProcessPUTRequest ( ) [inline, virtual]

You must implement this method in a derived class.

Definition at line 79 of file CGICPlusPlus.h.

This function will direct to one of the following 4 function based on the http verb.

Definition at line 120 of file CGICPlusPlus.cpp.

void CGICPlusPlus::SetResponseMimeType ( const char *  pMimeType)

Add response header.

Definition at line 153 of file CGICPlusPlus.cpp.

void CGICPlusPlus::unescape_url ( char *  url) [protected]

Reduce any xx escape sequences to the characters they represent.

Definition at line 213 of file CGICPlusPlus.cpp.

char CGICPlusPlus::x2c ( char *  what) [protected]

Convert a two-char hex string into a char.

Definition at line 200 of file CGICPlusPlus.cpp.


Member Data Documentation

Definition at line 90 of file CGICPlusPlus.h.

Definition at line 89 of file CGICPlusPlus.h.

string CGICPlusPlus::sEnvVar [protected]

Definition at line 93 of file CGICPlusPlus.h.

string CGICPlusPlus::sHeader [protected]

Definition at line 92 of file CGICPlusPlus.h.

string CGICPlusPlus::sResponse [protected]

Definition at line 91 of file CGICPlusPlus.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines