# PHTTPString Class Reference

This object describes a HyperText Transport Protocol resource which is a string kept in memory. More...

`#include <http.h>`

Inheritance diagram for PHTTPString:

List of all members.

## Public Member Functions

| PHTTPString (const PURL &url)
| Contruct a new simple string resource for the HTTP space.
| PHTTPString (const PURL &url, const PHTTPAuthority &auth)
| PHTTPString (const PURL &url, const PString &str)
| PHTTPString (const PURL &url, const PString &str, const PString &contentType)
| PHTTPString (const PURL &url, const PString &str, const PHTTPAuthority &auth)
| PHTTPString (const PURL &url, const PString &str, const PString &contentType, const PHTTPAuthority &auth)
virtual PBoolean | LoadHeaders (PHTTPRequest &request)
| Get the headers for block of data (eg HTML) that the resource contains.
virtual PString | LoadText (PHTTPRequest &request)
| Get a block of text data (eg HTML) that the resource contains.
const PString & | GetString ()
| Get the string for this resource.
void | SetString (const PString &str)
| Set the string to be returned by this resource.

## Protected Attributes

PString | string

## Detailed Description

This object describes a HyperText Transport Protocol resource which is a string kept in memory.

For instance a pre-calculated HTML string could be set in this type of resource.

## Constructor & Destructor Documentation

PHTTPString::PHTTPString | ( | const PURL & | url | ) |

Contruct a new simple string resource for the HTTP space.

If no MIME content type is specified then a default type is "text/html".

PHTTPString::PHTTPString | ( | const PURL & | url,
|  | const PHTTPAuthority & | auth |
| ) |  |  |

PHTTPString::PHTTPString | ( | const PURL & | url,
|  | const PString & | str |
| ) |  |  |

PHTTPString::PHTTPString | ( | const PURL & | url,
|  | const PString & | str,
|  | const PString & | contentType |
| ) |  |  |

PHTTPString::PHTTPString | ( | const PURL & | url,
|  | const PString & | str,
|  | const PHTTPAuthority & | auth |
| ) |  |  |

PHTTPString::PHTTPString | ( | const PURL & | url,
|  | const PString & | str,
|  | const PString & | contentType,
|  | const PHTTPAuthority & | auth |
| ) |  |  |

## Member Function Documentation

const PString& PHTTPString::GetString | ( |  | ) | `[inline]`

Get the string for this resource.

Returns:
  String for resource.

virtual PBoolean PHTTPString::LoadHeaders | ( | PHTTPRequest & | request | ) | `[virtual]`

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

This will fill in all the fields of the `outMIME` parameter required by the resource and return the status for the load.

Returns:
  true if all OK, false if an error occurred.

Implements PHTTPResource.

virtual PString PHTTPString::LoadText | ( | PHTTPRequest & | request | ) | `[virtual]`

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

The default behaviour is to assert, one of `LoadText()` or `LoadData()` functions must be overridden for correct operation.

Returns:
  String for loaded text.

Reimplemented from PHTTPResource.

Reimplemented in PRegisterPage, and PServiceHTTPString.

void PHTTPString::SetString | ( | const PString & | str | ) | `[inline]`

Set the string to be returned by this resource.

## Member Data Documentation

PString PHTTPString::string `[protected]`

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

- http.h