C++ MonsterDoc:
UtWWWCodec

Home
Contact
Copyright
|| All Classes ||
||overview|| ||access|| ||inheritance|| ||descriptions||

Class Overview

This class is designed to handle the encoding and decoding of www-url-encoded strings. All functions are overloaded to hande either C++ string classes or PowerPlant LStr255 classes. Handling is also available for name-value pairs arising from <FORM> tags or query keywords arising from <ISINDEX> pages

Inheritance

This class has no ancestors.

Requirements

This class requires the C++ string class and the C++ multimap and set containers as well as the PowerPlant LStr255 class.

Files

  • UtWWWCodec.h
  • UtWWWCodec.cp

||overview|| ||access|| ||inheritance|| ||descriptions||

Members by Access

public

typedef
multimap<string,string>
FormPairs;

Guarenteed to be a subclass of multimap<string, string>, this class is the result of decoding name-value pairs from a <FORM> tag.

typedef
set<string>
QueryWords;

Guarenteed to be a subclass of set<string>, this class is the result of decoding a keyword pair list from a <ISINDEX> tag.

class InvalidString;

static
string
ToWWW(
const string& inPlainText
);

static
LStr255
ToWWW(
const LStr255& inPlainText
);

static
string
FromWWW(
const string& inCypherText
);

static
LStr255
FromWWW(
const LStr255& inCypherText);

static
FormPairs
StringToPairs(
const string& inEncodedString
);

static
QueryWords
StringToWords(
const string& inEncodedString
);

protected

private

UtWWWCodec(
void
);

UtWWWCodec(
const UtWWWCodec&
);

~UtWWWCodec(
void
);

const UtWWWCodec
operator=(
const UtWWWCodec&
);

||overview|| ||access|| ||inheritance|| ||descriptions||

Members by Inheritance

statics

The following static methods are declared in UtWWWCodec:

static
string
ToWWW(
const string& inPlainText
);

static
LStr255
ToWWW(
const LStr255& inPlainText
);

static
string
FromWWW(
const string& inCypherText
);

static
LStr255
FromWWW(
const LStr255& inCypherText
);

static
FormPairs
StringToPairs(
const string& inEncodedString
);

static
QueryWords
StringToWords(
const string& inEncodedString
);

overrides

There are no overrides in this class.

new virtuals

There are no new virtual functions in this class.

||overview|| ||access|| ||inheritance|| ||descriptions||

Member Descriptions

ToWWW

This method is designed to take a string and encode it in the www-url-encoded format.

Warning AlertThe encoding done by this method is actually more extreme than specified by the standard since this method will encode all non-alpha-numerics into three character hexadecimal sequences.

static
string
ToWWW(
const string& inPlainText
);

The parameter is the string to be encoded and the return value is the result of the encoding.

static
LStr255
ToWWW(
const LStr255& inPlainText
);

The parameter is the string to be encoded and the return value is the result of the encoding.

Stop AlertBecause encoding may lengthen the string, the LStr255 return value may be truncated. The programmer is resposible for handling this situation.

FromWWW

This method is designed to take a www-url-encoded string and decodes it. It will throw an InvalidString if the argument is not correctly coded.

static
string
FromWWW(
const string& inCypherText
);

The parameter is the string to be encoded and the return value is the result of the encoding.

static
LStr255
FromWWW(
const LStr255& inCypherText
);

The parameter is the string to be encoded and the return value is the result of the encoding.

StringToPairs

This method takes a www-url-encoded string and decodes it as a series of name/value pairs from an HTML <FORM> tag.

static
FormPairs
StringToPairs(
const string& inEncodedString
);

StringToWords

This method takes a www-url-encoded string and decodes it as a series of keywords from an HTML <ISINDEX> tag.

static
QueryWords
StringToWords(
const string& inEncodedString
);

UtWWWCodec

The class is completely static, as a result, no constructors are implemented.

UtWWWCodec(
void
);

UtWWWCodec(
const UtWWWCodec&
);

~UtWWWCodec

The class is completely static, as a result, no destructors are implemented.

~UtWWWCodec(
void
);

operator=

The class is completely static, as a result, no assignment operators are implemented.

const UtWWWCodec
operator=(
const UtWWWCodec&
);


©1999-2004 Monsterworks

Last Modified: Monday, October 2, 2000