PTLib
Version 2.10.4
|
This class describes a name space that a Universal Resource Locator operates in. More...
#include <http.h>
Classes | |
class | Node |
Public Types | |
enum | AddOptions { ErrorOnExist, Overwrite } |
Public Member Functions | |
PHTTPSpace () | |
Constructor for HTTP URL Name Space. | |
PBoolean | AddResource (PHTTPResource *resource, AddOptions overwrite=ErrorOnExist) |
Add a new resource to the URL space. | |
PBoolean | DelResource (const PURL &url) |
Delete an existing resource to the URL space. | |
PHTTPResource * | FindResource (const PURL &url) |
Locate the resource specified by the URL in the URL name space. | |
void | StartRead () const |
This function attempts to acquire the mutex for reading. | |
void | EndRead () const |
This function attempts to release the mutex for reading. | |
void | StartWrite () const |
This function attempts to acquire the mutex for writing. | |
void | EndWrite () const |
This function attempts to release the mutex for writing. | |
Protected Member Functions | |
PSORTED_LIST (ChildList, Node) | |
Protected Attributes | |
PReadWriteMutex * | mutex |
PHTTPSpace::Node * | root |
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.
Constructor for HTTP URL Name Space.
PBoolean 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.
resource | Resource to add to the name space. |
overwrite | Flag to overwrite an existing resource if it already exists. |
PBoolean 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.
url | URL to search for in the name space. |
void PHTTPSpace::EndRead | ( | ) | const [inline] |
This function attempts to release the mutex for reading.
References PReadWriteMutex::EndRead(), and mutex.
void PHTTPSpace::EndWrite | ( | ) | const [inline] |
This function attempts to release the mutex for writing.
References PReadWriteMutex::EndWrite(), and mutex.
PHTTPResource* PHTTPSpace::FindResource | ( | const PURL & | url | ) |
Locate the resource specified by the URL in the URL name space.
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.
References mutex, and PReadWriteMutex::StartRead().
void PHTTPSpace::StartWrite | ( | ) | const [inline] |
This function attempts to acquire the mutex for writing.
References mutex, and PReadWriteMutex::StartWrite().
PReadWriteMutex* PHTTPSpace::mutex [protected] |
Referenced by EndRead(), EndWrite(), StartRead(), and StartWrite().
PHTTPSpace::Node * PHTTPSpace::root [protected] |