Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

PHTTPSpace Class Reference

#include <http.h>

Inheritance diagram for PHTTPSpace:

PContainer PObject List of all members.

Public Types

enum  AddOptions { ErrorOnExist, Overwrite }

Public Member Functions

 PHTTPSpace ()
 Constructor for HTTP URL Name Space.

BOOL AddResource (PHTTPResource *resource, AddOptions overwrite=ErrorOnExist)
BOOL DelResource (const PURL &url)
PHTTPResourceFindResource (const PURL &url)
void StartRead () const
void EndRead () const
void StartWrite () const
void EndWrite () const

Protected Member Functions

 PSORTED_LIST (ChildList, Node)

Protected Attributes

PReadWriteMutexmutex
PHTTPSpace::Noderoot

Detailed Description

This class describes a name space that a Universal Resource Locator operates in. Each section of the hierarchy field of the URL points to a leg in the tree specified by this class.


Member Enumeration Documentation

enum PHTTPSpace::AddOptions
 

Enumeration values:
ErrorOnExist  Generate error if resource already exists.
Overwrite  Overwrite the existing resource at URL location.


Constructor & Destructor Documentation

PHTTPSpace::PHTTPSpace  ) 
 

Constructor for HTTP URL Name Space.


Member Function Documentation

BOOL PHTTPSpace::AddResource PHTTPResource resource,
AddOptions  overwrite = ErrorOnExist
 

Add a new resource to the URL space. If there is already a resource at the location in the tree, or that location in the tree is already in the path to another resource then the function will fail.

The overwrite flag can be used to replace an existing resource. The function will still fail if the resource is on a partial path to another resource but not if it is a leaf node.

Returns:
TRUE if resource added, FALSE if failed.
Parameters:
overwrite  Resource to add to the name space. Flag to overwrite an existing resource if it already exists.

BOOL PHTTPSpace::DelResource const PURL url  ) 
 

Delete an existing resource to the URL space. If there is not a resource at the location in the tree, or that location in the tree is in the path to another resource then the function will fail.

Returns:
TRUE if resource deleted, FALSE if failed.
Parameters:
url  URL to search for in the name space.

void PHTTPSpace::EndRead  )  const [inline]
 

This function attempts to release the mutex for reading.

void PHTTPSpace::EndWrite  )  const [inline]
 

This function attempts to release the mutex for writing.

PHTTPResource* PHTTPSpace::FindResource const PURL url  ) 
 

Locate the resource specified by the URL in the URL name space.

Returns:
The resource found or NULL if no resource at that position in hiearchy.
Parameters:
url  URL to search for in the name space.

PHTTPSpace::PSORTED_LIST ChildList  ,
Node 
[protected]
 

void PHTTPSpace::StartRead  )  const [inline]
 

This function attempts to acquire the mutex for reading.

void PHTTPSpace::StartWrite  )  const [inline]
 

This function attempts to acquire the mutex for writing.


Member Data Documentation

PReadWriteMutex* PHTTPSpace::mutex [protected]
 

PHTTPSpace::Node * PHTTPSpace::root [protected]
 


The documentation for this class was generated from the following file:
Generated on Sat Jul 24 15:35:58 2004 for PWLib by doxygen 1.3.7