Fastcgipp::Http Namespace Reference

Defines classes and function relating to the http protocol. More...


Classes

struct  Post
 Holds a piece of HTTP post data. More...
class  Address
 Efficiently stores IPv4 addresses. More...
struct  Session
 Data structure of HTTP session data. More...

Functions

bool operator== (Address x, Address y)
 Compare two Address values.
bool operator> (Address x, Address y)
 Compare two Address values.
bool operator< (Address x, Address y)
 Compare two Address values.
bool operator<= (Address x, Address y)
 Compare two Address values.
bool operator>= (Address x, Address y)
 Compare two Address values.
Address operator& (Address x, Address y)
 Bitwise AND two Address values.
template<class charT , class Traits >
std::basic_ostream< charT,
Traits > & 
operator<< (std::basic_ostream< charT, Traits > &os, const Address &address)
 Address stream insertion operation.
template<class charT , class Traits >
std::basic_istream< charT,
Traits > & 
operator>> (std::basic_istream< charT, Traits > &is, Address &address)
 Address stream extractor operation.
bool charToString (const char *data, size_t size, std::wstring &string)
 Convert a char string to a std::wstring.
bool charToString (const char *data, size_t size, std::string &string)
 Convert a char string to a std::string.
int atoi (const char *start, const char *end)
 Convert a char string to an integer.
template<class charT >
bool parseXmlValue (const char *const name, const char *start, const char *end, std::basic_string< charT > &string)
 Finds the value associated with a name in an 'name="value"' string.
int percentEscapedToRealBytes (const char *source, char *destination, size_t size)
 Convert a string with percent escaped byte values to their actual values.


Detailed Description

Defines classes and function relating to the http protocol.


Function Documentation

int Fastcgipp::Http::atoi ( const char *  start,
const char *  end 
)

Convert a char string to an integer.

This function is very similar to std::atoi() except that it takes start/end values of a non null terminated char string instead of a null terminated string. The first character must be either a number or a minus sign (-). As soon as the end is reached or a non numerical character is reached, the result is tallied and returned.

Parameters:
[in] start Pointer to the first byte in the string
[in] end Pointer to the last byte in the string + 1
Returns:
Integer value represented by the string

Definition at line 205 of file http.cpp.

Referenced by Fastcgipp::Http::Address::assign(), and Fastcgipp::Http::Session< charT >::fill().

bool Fastcgipp::Http::charToString ( const char *  data,
size_t  size,
std::string &  string 
) [inline]

Convert a char string to a std::string.

Parameters:
[in] data First byte in char string
[in] size Size in bytes of the string (no null terminator)
[out] string Reference to the string that should be modified
Returns:
Returns true on success, false on failure

Definition at line 275 of file http.hpp.

bool Fastcgipp::Http::charToString ( const char *  data,
size_t  size,
std::wstring &  string 
)

Convert a char string to a std::wstring.

Parameters:
[in] data First byte in char string
[in] size Size in bytes of the string (no null terminator)
[out] string Reference to the wstring that should be modified
Returns:
Returns true on success, false on failure

Definition at line 181 of file http.cpp.

Referenced by Fastcgipp::Http::Session< charT >::fill(), Fastcgipp::Http::Session< charT >::fillPosts(), and parseXmlValue().

Address Fastcgipp::Http::operator& ( Address  x,
Address  y 
) [inline]

Bitwise AND two Address values.

The bitwise AND operation is passed on to the internal unsigned 32 bit integer

Definition at line 153 of file http.hpp.

References Fastcgipp::Http::Address::data.

bool Fastcgipp::Http::operator< ( Address  x,
Address  y 
) [inline]

Compare two Address values.

This comparator merely passes on the comparison to the internal unsigned 32 bit integer.

Definition at line 136 of file http.hpp.

References Fastcgipp::Http::Address::data.

template<class charT , class Traits >
std::basic_ostream< charT, Traits > & Fastcgipp::Http::operator<< ( std::basic_ostream< charT, Traits > &  os,
const Address &  address 
) [inline]

Address stream insertion operation.

This stream inserter obeys all stream manipulators regarding alignment, field width and numerical base.

Definition at line 42 of file http.cpp.

bool Fastcgipp::Http::operator<= ( Address  x,
Address  y 
) [inline]

Compare two Address values.

This comparator merely passes on the comparison to the internal unsigned 32 bit integer.

Definition at line 142 of file http.hpp.

References Fastcgipp::Http::Address::data.

bool Fastcgipp::Http::operator== ( Address  x,
Address  y 
) [inline]

Compare two Address values.

This comparator merely passes on the comparison to the internal unsigned 32 bit integer.

Definition at line 124 of file http.hpp.

References Fastcgipp::Http::Address::data.

bool Fastcgipp::Http::operator> ( Address  x,
Address  y 
) [inline]

Compare two Address values.

This comparator merely passes on the comparison to the internal unsigned 32 bit integer.

Definition at line 130 of file http.hpp.

References Fastcgipp::Http::Address::data.

bool Fastcgipp::Http::operator>= ( Address  x,
Address  y 
) [inline]

Compare two Address values.

This comparator merely passes on the comparison to the internal unsigned 32 bit integer.

Definition at line 148 of file http.hpp.

References Fastcgipp::Http::Address::data.

template<class charT , class Traits >
std::basic_istream< charT, Traits > & Fastcgipp::Http::operator>> ( std::basic_istream< charT, Traits > &  is,
Address &  address 
) [inline]

Address stream extractor operation.

In order for this to work the stream must be positioned on at the start of a standard decimal representation of a IPv4 address. Example: "127.0.0.1".

Definition at line 103 of file http.cpp.

template<class charT >
bool Fastcgipp::Http::parseXmlValue ( const char *const   name,
const char *  start,
const char *  end,
std::basic_string< charT > &  string 
) [inline]

Finds the value associated with a name in an 'name="value"' string.

Note that the quotation marks are removed from the value. If no value is found, then string is left unchanged.

Parameters:
[in] name Pointer to a null terminated string containing the name
[in] start Pointer to the first byte of data to look in
[in] end Pointer to the last byte of data to look in + 1
[out] string Reference to the string the value should be stored in.

Definition at line 149 of file http.cpp.

References charToString().

Referenced by Fastcgipp::Http::Session< charT >::fillPosts().

int Fastcgipp::Http::percentEscapedToRealBytes ( const char *  source,
char *  destination,
size_t  size 
)

Convert a string with percent escaped byte values to their actual values.

Since converting a percent escaped string to actual values can only make it shorter, it is safe to assume that the return value will always be smaller than size. It is thereby a safe move to make the destination block of memory the same size as the source.

Parameters:
[in] source Pointer to the first character in the percent escaped string
[in] size Size in bytes of the data pointed to by source (no null termination)
[out] destination Pointer to the section of memory to write the converted string to
Returns:
Actual size of the new string

Definition at line 220 of file http.cpp.

Referenced by Fastcgipp::Http::Session< charT >::fill().


Generated on Thu Dec 11 01:47:29 2008 for fastcgi++ by  doxygen 1.5.7.1