Daraja HTTP Framework 2.8
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
TdjPathMap Class Reference

Holds all known web component mappings for a context. More...

+ Inheritance diagram for TdjPathMap:

Public Member Functions

TSpecType GetSpecType (const string Spec)
 
Boolean Matches (const string Path, const string Spec)
 
 CheckExists (const string PathSpec)
 Check if a mapping path exists.
 
 AddPathSpec (const string PathSpec, TObject Value)
 Add a web component mapping.
 
TStrings GetMatches (const string Path)
 Return all matching mappings for the given path.
 

Protected Member Functions

Boolean Matches (const string Path, const string Spec, TSpecType SpecType)
 

Detailed Description

Holds all known web component mappings for a context.

Matching is performed in the following order Exact match Longest prefix match Longest suffix match

Member Function Documentation

◆ AddPathSpec()

TdjPathMap::AddPathSpec ( const string PathSpec,
TObject Value )

Add a web component mapping.

Parameters
PathSpeca single component mapping path (for example, '*.html' or '/*')
Valuethe mapped web component
Exceptions
EWebComponentException

References CheckExists().

◆ CheckExists()

TdjPathMap::CheckExists ( const string PathSpec)

Check if a mapping path exists.

This procedure throws a EWebComponentException if the PathSpec is already registered for this context.

Parameters
PathSpeca single component mapping path (for example, '*.html' or '/*')
Exceptions
EWebComponentException

Referenced by AddPathSpec().

◆ GetMatches()

TStrings TdjPathMap::GetMatches ( const string Path)

Return all matching mappings for the given path.

The best match will be the first entry.

Parameters
Paththe URL path (without context), for example 'test.html'
Returns
list of matching mappings

◆ GetSpecType()

class TSpecType TdjPathMap::GetSpecType ( const string Spec)
Parameters
Specthe path specification (for example, '/*')
Returns
the path specification type

◆ Matches()

class Boolean TdjPathMap::Matches ( const string Path,
const string Spec,
TSpecType SpecType )
protected
Parameters
Paththe URL document path
Specthe path specification (for example, '/*')
SpecTypethe path specification type
Returns
True if the Path mathes the Spec (with known SpecType)