PTLib Version 2.12.9

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
PHTTPTailFile Class Reference

This object describes a HyperText Transport Protocol resource which is a single file. More...

`#include <http.h>`

Inheritance diagram for PHTTPTailFile:
[legend]
Collaboration diagram for PHTTPTailFile:
[legend]

## Public Member Functions
| PHTTPTailFile (const PString &filename)
| Contruct a new simple file resource for the HTTP space. More...
| PHTTPTailFile (const PString &filename, const PHTTPAuthority &auth)
| PHTTPTailFile (const PURL &url, const PFilePath &file)
| PHTTPTailFile (const PURL &url, const PFilePath &file, const PString &contentType)
| PHTTPTailFile (const PURL &url, const PFilePath &file, const PHTTPAuthority &auth)
| PHTTPTailFile (const PURL &url, const PFilePath &file, const PString &contentType, const PHTTPAuthority &auth)
virtual PBoolean | LoadHeaders (PHTTPRequest &request)
| Get the headers for block of data (eg HTML) that the resource contains. More...
virtual PBoolean | LoadData (PHTTPRequest &request, PCharArray &data)
| Get a block of data that the resource contains. More...
Public Member Functions inherited from PHTTPFile
| PHTTPFile (const PString &filename)
| Contruct a new simple file resource for the HTTP space. More...
| PHTTPFile (const PString &filename, const PHTTPAuthority &auth)
| PHTTPFile (const PURL &url, const PFilePath &file)
| PHTTPFile (const PURL &url, const PFilePath &file, const PString &contentType)
| PHTTPFile (const PURL &url, const PFilePath &file, const PHTTPAuthority &auth)
| PHTTPFile (const PURL &url, const PFilePath &file, const PString &contentType, const PHTTPAuthority &auth)
virtual PHTTPRequest * | CreateRequest (const PURL &url, const PMIMEInfo &inMIME, const PMultiPartList &multipartFormInfo, PHTTPServer &socket)
| Create a new request block for this type of resource. More...
virtual PString | LoadText (PHTTPRequest &request)
| Get a block of text data (eg HTML) that the resource contains. More...
Public Member Functions inherited from PHTTPResource
virtual | ~PHTTPResource ()
const PURL & | GetURL () const
| Get the URL for this resource. More...
PString | GetHotLink () const
| Get relative hot link for this resouce. More...
const PString & | GetContentType () const
| Get the current content type for the resource. More...
PHTTPAuthority * | GetAuthority () const
| Get the current authority for the resource. More...
void | SetAuthority (const PHTTPAuthority &auth)
| Set the current authority for the resource. More...
void | ClearAuthority ()
| Set the current authority for the resource to unrestricted. More...
DWORD | GetHitCount () const
| Get the current hit count for the resource. More...
void | ClearHitCount ()
virtual PBoolean | OnGET (PHTTPServer &server, const PURL &url, const PMIMEInfo &info, const PHTTPConnectionInfo &conInfo)
| Handle the GET command passed from the HTTP socket. More...
virtual PBoolean | OnGETData (PHTTPServer &server, const PURL &url, const PHTTPConnectionInfo &connectInfo, PHTTPRequest &request)
| Send the data associated with a GET command. More...
virtual PBoolean | OnHEAD (PHTTPServer &server, const PURL &url, const PMIMEInfo &info, const PHTTPConnectionInfo &conInfo)
| Handle the HEAD command passed from the HTTP socket. More...
virtual PBoolean | OnPOST (PHTTPServer &server, const PURL &url, const PMIMEInfo &info, const PStringToString &data, const PHTTPConnectionInfo &conInfo)
| Handle the POST command passed from the HTTP socket. More...
virtual PBoolean | OnPOSTData (PHTTPRequest &request, const PStringToString &data)
| Send the data associated with a POST command. More...
virtual PBoolean | IsModifiedSince (const PTime &when)
| Check to see if the resource has been modified since the date specified. More...
virtual PBoolean | GetExpirationDate (PTime &when)
| Get a block of data (eg HTML) that the resource contains. More...
virtual void | SendData (PHTTPRequest &request)
| Send the data associated with a command. More...
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. More...
virtual PBoolean | Post (PHTTPRequest &request, const PStringToString &data, PHTML &replyMessage)
| Get a block of data (eg HTML) that the resource contains. More...
Public Member Functions inherited from PObject
unsigned | GetTraceContextIdentifier () const
| Get PTRACE context identifier. More...
void | SetTraceContextIdentifier (unsigned id)
void | GetTraceContextIdentifier (PObject &obj)
void | GetTraceContextIdentifier (PObject *obj)
void | SetTraceContextIdentifier (const PObject &obj)
void | SetTraceContextIdentifier (const PObject *obj)
virtual | ~PObject ()
virtual PObject * | Clone () const
| Create a copy of the class on the heap. More...
template<class CLS >
CLS * | CloneAs () const
| As for Clone() but converts to specified type. More...
virtual PINDEX | HashFunction () const
| This function yields a hash value required by the `PDictionary` class. More...
virtual Comparison | Compare (const PObject &obj) const
| Compare the two objects and return their relative rank. More...
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const
| Determine the byte wise comparison of two objects. More...
bool | operator== (const PObject &obj) const
| Compare the two objects. More...
bool | operator!= (const PObject &obj) const
| Compare the two objects. More...
bool | operator< (const PObject &obj) const
| Compare the two objects. More...
bool | operator> (const PObject &obj) const
| Compare the two objects. More...
bool | operator<= (const PObject &obj) const
| Compare the two objects. More...
bool | operator>= (const PObject &obj) const
| Compare the two objects. More...
virtual const char * | GetClass (unsigned ancestor=0) const
| Get the current dynamic type of the object instance. More...
PBoolean | IsClass (const char *cls) const
virtual PBoolean | InternalIsDescendant (const char *clsName) const
| Determine if the dynamic type of the current instance is a descendent of the specified class. More...
__inline const PObject * | PTraceObjectInstance () const
virtual void | PrintOn (ostream &strm) const
| Output the contents of the object to the stream. More...
virtual void | ReadFrom (istream &strm)
| Input the contents of the object from the stream. More...

## Additional Inherited Members
Public Types inherited from PObject
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
| Result of the comparison operation performed by the `Compare()` function. More...
Static Public Member Functions inherited from PObject
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
| Internal function caled from CompareObjectMemoryDirect() More...
static const char * | Class ()
| Get the name of the class as a C string. More...
static __inline const PObject * | PTraceObjectInstance (const char *)
static __inline const PObject * | PTraceObjectInstance (const PObject *obj)
Protected Member Functions inherited from PHTTPFile
| PHTTPFile (const PURL &url, int dummy)
Static Protected Member Functions inherited from PHTTPResource
static PBoolean | CheckAuthority (PHTTPAuthority &authority, PHTTPServer &server, const PHTTPRequest &request, const PHTTPConnectionInfo &connectInfo)
Protected Attributes inherited from PHTTPFile
PFilePath | filePath
Friends inherited from PObject

## Detailed Description

This object describes a HyperText Transport Protocol resource which is a single file.

The file can be anywhere in the file system and is mapped to the specified URL location in the HTTP name space defined by the `PHTTPSpace` class.

The difference between this and PHTTPFile is that it continually outputs the contents of the file, as per the unix "tail -f" command.

## Constructor & Destructor Documentation

PHTTPTailFile::PHTTPTailFile | ( | const PString & | filename | ) |

Contruct a new simple file resource for the HTTP space.

If no MIME content type is specified then a default type is used depending on the file type. For example, "text/html" is used of the file type is ".html" or ".htm". The default for an unknown type is "application/octet-stream".

PHTTPTailFile::PHTTPTailFile | ( | const PString & | filename,
|  | const PHTTPAuthority & | auth
| ) |  |

PHTTPTailFile::PHTTPTailFile | ( | const PURL & | url,
|  | const PFilePath & | file
| ) |  |

PHTTPTailFile::PHTTPTailFile | ( | const PURL & | url,
|  | const PFilePath & | file,
|  | const PString & | contentType
| ) |  |

PHTTPTailFile::PHTTPTailFile | ( | const PURL & | url,
|  | const PFilePath & | file,
|  | const PHTTPAuthority & | auth
| ) |  |

PHTTPTailFile::PHTTPTailFile | ( | const PURL & | url,
|  | const PFilePath & | file,
|  | const PString & | contentType,
|  | const PHTTPAuthority & | auth
| ) |  |

## Member Function Documentation

virtual PBoolean PHTTPTailFile::LoadData | ( | PHTTPRequest & | request,
|  | PCharArray & | data
| ) |  |
| virtual

Get a block of data that the resource contains.

Returns
  true if more to load.

Reimplemented from PHTTPFile.

virtual PBoolean PHTTPTailFile::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.

Reimplemented from PHTTPFile.

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

- http.h