sptk2 logo
SPTK Home Page

sptk::CCGIApplication Class Reference
[Utility Classes]

Supports a classic CGI application, decodes input data stream etc. More...

#include <CCGI.h>

List of all members.

Public Member Functions

const char * debugInputFileName () const
 CCGIApplication ()
 Default constructor.
 ~CCGIApplication ()
 Destructor.
bool begin (HTML_TAGS tag, const char *params=NULL)
bool end (HTML_TAGS tag)
bool printString (const char *htmlCode)
void startTable (const char *params=NULL)
void endTable ()
 Ends the TABLE HTML tag.
void startTableRow (const char *params=NULL)
 Begins the table row HTML tag.
void endTableRow ()
 Ends the table row HTML tag.
void tableHeaderCell (const char *headerCellData, const char *params=NULL)
void tableCell (const char *cellData, const char *params=NULL)
void beginPage (const char *title, const char *bodyParams="")
void endPage ()
 Ends HTML page.
void addTextInput (const char *name, const char *value="", const char *attr="")
void addHiddenInput (const char *name, const char *value="", const char *attr="")
FILE * createHtmlCopyFile (const char *fname)
void closeHtmlCopyFile ()
 Stops duplicating the HTML output to the file.
void showPreviewMode (bool)
 Produce or not the HTML output to stdout.
bool showPreviewMode ()
 Reports ether the the HTML output to stdout is produced or not.
void printParameters ()
 Prints input information for debug purposes.

Public Attributes

CHttpParams contentData

Protected Member Functions

bool insertCRLF ()

Protected Attributes

bool m_showPreview
FILE * m_htmlPrint
 File descriptor for the normal HTML output.
FILE * m_htmlFile
 File descriptor for the external file HTML output.
char m_debugInputFileName [64]
 File name for the debug file to store the input data.


Detailed Description

Supports a classic CGI application, decodes input data stream etc.

Member Function Documentation

void sptk::CCGIApplication::addHiddenInput ( const char *  name,
const char *  value = "",
const char *  attr = "" 
)

Inserts hidden input on the page.

Parameters:
name const char *, hidden input name
value const char *, optional hidden input value
attr const char *, optional hidden input attributes

void sptk::CCGIApplication::addTextInput ( const char *  name,
const char *  value = "",
const char *  attr = "" 
)

Inserts text input on the page.

Parameters:
name const char *, input name
value const char *, optional input value
attr const char *, optional input attributes

bool sptk::CCGIApplication::begin ( HTML_TAGS  tag,
const char *  params = NULL 
)

Begins the standard HTML tag. See HTML_TAGS for the tag list.

Returns:
true if anything was printed
Parameters:
tag HTML_TAGS, HTML tag
params const char *, extra parameters

void sptk::CCGIApplication::beginPage ( const char *  title,
const char *  bodyParams = "" 
)

Begins HTML page.

Parameters:
title const char *, page title
bodyParams const char *, optional body attributes

FILE* sptk::CCGIApplication::createHtmlCopyFile ( const char *  fname  ) 

Starts duplicating the HTML output to the file.

Parameters:
fname const char *, output file name
Returns:
the output file descriptor

const char* sptk::CCGIApplication::debugInputFileName (  )  const [inline]

Reports the debug file name that contains the input data as it is received by the CGI application.

bool sptk::CCGIApplication::end ( HTML_TAGS  tag  ) 

Closes the standard HTML tag. See HTML_TAGS for the tag list.

Parameters:
tag HTML_TAGS, extra parameters
Returns:
true if anything was printed

bool sptk::CCGIApplication::insertCRLF (  )  [protected]

Prints CRLF into output

Returns:
true if anything was printed

bool sptk::CCGIApplication::printString ( const char *  htmlCode  ) 

Prints the htmlCode to the output files

Parameters:
htmlCode const char *, the HTML code to print
Returns:
true if anything was printed

void sptk::CCGIApplication::startTable ( const char *  params = NULL  ) 

Begins the TABLE HTML tag.

Parameters:
params const char *, optional table attributes

void sptk::CCGIApplication::tableCell ( const char *  cellData,
const char *  params = NULL 
)

Defines the table cell.

Parameters:
cellData const char *, cell text
params const char *, optional cells attributes

void sptk::CCGIApplication::tableHeaderCell ( const char *  headerCellData,
const char *  params = NULL 
)

Defines the table header cell HTML tag.

Parameters:
headerCellData const char *, header cell text
params const char *, optional cells attributes


Member Data Documentation

The map of input parameter names and values. Contains the information sent to the application from another page form through GET or POST metods.

Flag, true if the application should actually print something and not just create the HTML file for future references


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

Mon Mar 5 11:55:56 2012: SPTK 3.5.7