PTLib
Version 2.18.8
|
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 } |
![]() | |
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 } |
Result of the comparison operation performed by the Compare() function. More... | |
Public Member Functions | |
PHTTPSpace () | |
Constructor for HTTP URL Name Space. More... | |
PBoolean | AddResource (PHTTPResource *resource, AddOptions overwrite=ErrorOnExist) |
Add a new resource to the URL space. More... | |
PBoolean | DelResource (const PURL &url) |
Delete an existing resource to the URL space. More... | |
PHTTPResource * | FindResource (const PURL &url) |
Locate the resource specified by the URL in the URL name space. More... | |
void | StartRead () const |
This function attempts to acquire the mutex for reading. More... | |
void | EndRead () const |
This function attempts to release the mutex for reading. More... | |
void | StartWrite () const |
This function attempts to acquire the mutex for writing. More... | |
void | EndWrite () const |
This function attempts to release the mutex for writing. More... | |
![]() | |
PContainer (PINDEX initialSize=0) | |
Create a new unique container. More... | |
PContainer (const PContainer &cont) | |
Create a new refernce to container. More... | |
PContainer & | operator= (const PContainer &cont) |
Assign one container reference to another. More... | |
virtual | ~PContainer () |
Destroy the container class. More... | |
virtual PINDEX | GetSize () const |
Get the current size of the container. More... | |
__inline size_t | size () const |
PBoolean | SetMinSize (PINDEX minSize) |
Set the minimum size of container. More... | |
virtual PBoolean | IsEmpty () const |
Determine if the container is empty. More... | |
__inline bool | empty () const |
PBoolean | IsUnique () const |
Determine if container is unique reference. More... | |
virtual PBoolean | MakeUnique () |
Make this instance to be the one and only reference to the container contents. More... | |
![]() | |
__inline unsigned | GetTraceContextIdentifier () const |
Get PTRACE context identifier. More... | |
__inline void | SetTraceContextIdentifier (unsigned id) |
__inline void | SetTraceContextIdentifier (const PObject &obj) |
__inline void | SetTraceContextIdentifier (const PObject *obj) |
__inline void | CopyTraceContextIdentifier (PObject &obj) const |
__inline void | CopyTraceContextIdentifier (PObject *obj) const |
virtual | ~PObject () |
__inline const char * | GetClass () const |
__inline bool | IsClass (const char *name) const |
__inline const PObject * | PTraceObjectInstance () const |
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 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... | |
Protected Member Functions | |
PSORTED_LIST (ChildList, Node) | |
![]() | |
PContainer (int dummy, const PContainer *cont) | |
Constructor used in support of the Clone() function. More... | |
PContainer (PContainerReference &reference) | |
Construct using static PContainerReference. More... | |
virtual void | DestroyContents ()=0 |
Destroy the container contents. More... | |
virtual void | AssignContents (const PContainer &c) |
Copy the container contents. More... | |
void | CopyContents (const PContainer &c) |
Copy the container contents. More... | |
void | CloneContents (const PContainer *src) |
Create a duplicate of the container contents. More... | |
void | Destruct () |
Internal function called from container destructors. More... | |
virtual void | DestroyReference () |
Destroy the PContainerReference instance. More... | |
![]() | |
PObject () | |
Constructor for PObject, made protected so cannot ever create one on its own. More... | |
Protected Attributes | |
PReadWriteMutex * | mutex |
PHTTPSpace::Node * | root |
![]() | |
PContainerReference * | reference |
![]() | |
unsigned | m_traceContextIdentifier |
Additional Inherited Members | |
![]() | |
static __inline void | CopyTraceContextIdentifier (PObject &to, const PObject &from) |
static __inline void | CopyTraceContextIdentifier (PObject &to, const PObject *from) |
static __inline void | CopyTraceContextIdentifier (PObject *to, const PObject &from) |
static __inline void | CopyTraceContextIdentifier (PObject *to, const PObject *from) |
static __inline const char * | Class () |
static __inline const PObject * | PTraceObjectInstance (const char *) |
static __inline const PObject * | PTraceObjectInstance (const PObject *obj) |
template<typename T > | |
static Comparison | Compare2 (T v1, T v2) |
Compare two types, returning Comparison type. More... | |
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size) |
Internal function caled from CompareObjectMemoryDirect() More... | |
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.
PHTTPSpace::PHTTPSpace | ( | ) |
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. |
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. |
|
inline |
This function attempts to release the mutex for reading.
References PReadWriteMutex::EndRead(), and mutex.
|
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. |
|
protected |
|
inline |
This function attempts to acquire the mutex for reading.
References mutex, and PReadWriteMutex::StartRead().
|
inline |
This function attempts to acquire the mutex for writing.
References mutex, and PReadWriteMutex::StartWrite().
|
protected |
Referenced by EndRead(), EndWrite(), StartRead(), and StartWrite().
|
protected |