PTLib  Version 2.10.4
PHTTPConfig Class Reference

#include <httpform.h>

Inheritance diagram for PHTTPConfig:
PHTTPForm PHTTPString PHTTPResource PObject PConfigPage PRegisterPage

List of all members.

Public Member Functions

 PHTTPConfig (const PURL &url, const PString &section)
 PHTTPConfig (const PURL &url, const PString &section, const PHTTPAuthority &auth)
 PHTTPConfig (const PURL &url, const PString &section, const PString &html)
 PHTTPConfig (const PURL &url, const PString &section, const PString &html, const PHTTPAuthority &auth)
virtual void OnLoadedText (PHTTPRequest &request, PString &text)
 This is called after the text has been loaded and may be used to customise or otherwise mangle a loaded piece of text.
virtual PBoolean Post (PHTTPRequest &request, const PStringToString &data, PHTML &replyMessage)
 Get a block of data (eg HTML) that the resource contains.
void LoadFromConfig ()
 Load all of the values for the resource from the configuration.
const PStringGetConfigSection () const
 Get the configuration file section that the page will alter.
void SetConfigSection (const PString &sect)
PHTTPFieldAddSectionField (PHTTPField *sectionFld, const char *prefix=NULL, const char *suffix=NULL)
 Add a field that will determine the name opf the secontion into which the other fields are to be added as keys.
void AddNewKeyFields (PHTTPField *keyFld, PHTTPField *valFld)
 Add fields to the HTTP form for adding a new key to the config file section.

Protected Attributes

PString section
PString sectionPrefix
PString sectionSuffix
PHTTPFieldsectionField
PHTTPFieldkeyField
PHTTPFieldvalField

Constructor & Destructor Documentation

PHTTPConfig::PHTTPConfig ( const PURL url,
const PString section 
)
PHTTPConfig::PHTTPConfig ( const PURL url,
const PString section,
const PHTTPAuthority auth 
)
PHTTPConfig::PHTTPConfig ( const PURL url,
const PString section,
const PString html 
)
PHTTPConfig::PHTTPConfig ( const PURL url,
const PString section,
const PString html,
const PHTTPAuthority auth 
)

Member Function Documentation

void PHTTPConfig::AddNewKeyFields ( PHTTPField keyFld,
PHTTPField valFld 
)

Add fields to the HTTP form for adding a new key to the config file section.

Parameters:
keyFldField for the key to be added.
valFldField for the value of the key yto be added.
PHTTPField* PHTTPConfig::AddSectionField ( PHTTPField sectionFld,
const char *  prefix = NULL,
const char *  suffix = NULL 
)

Add a field that will determine the name opf the secontion into which the other fields are to be added as keys.

The section is not created and and error generated if the section already exists.

Parameters:
sectionFldField to set as the section name
prefixString to attach before the field value
suffixString to attach after the field value
const PString& PHTTPConfig::GetConfigSection ( ) const [inline]

Get the configuration file section that the page will alter.

Returns:
String for config file section.

References section.

Load all of the values for the resource from the configuration.

virtual void PHTTPConfig::OnLoadedText ( PHTTPRequest request,
PString text 
) [virtual]

This is called after the text has been loaded and may be used to customise or otherwise mangle a loaded piece of text.

Typically this is used with HTML responses.

The default action for this function is to do nothing.

Parameters:
requestInformation on this request.
textData used in reply.

Reimplemented from PHTTPForm.

Reimplemented in PRegisterPage, and PConfigPage.

virtual PBoolean PHTTPConfig::Post ( PHTTPRequest request,
const PStringToString data,
PHTML replyMessage 
) [virtual]

Get a block of data (eg HTML) that the resource contains.

The default action for this function is to do nothing and return success.

Returns:
true if the connection may persist, false if the connection must close
Parameters:
requestInformation on this request.
dataVariables in the POST data.
replyMessageReply message for post.

Reimplemented from PHTTPForm.

Reimplemented in PRegisterPage, and PConfigPage.

void PHTTPConfig::SetConfigSection ( const PString sect) [inline]
Parameters:
sectNew section for the config page.

Member Data Documentation

Referenced by GetConfigSection().


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