Daraja HTTP Framework 3.0-MS1 HTTP server framework for Object Pascal

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
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

  PathSpec | a single component mapping path (for example, '*.html' or '/*')
  Value | the 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

  PathSpec | a 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

  Path | the URL path (without context), for example 'test.html'

Returns
  list of matching mappings

## ◆ GetSpecType()

class TSpecType TdjPathMap::GetSpecType | ( | const string | Spec | ) |

Parameters

  Spec | the path specification (for example, '/*')

Returns
  the path specification type

## ◆ Matches()

class Boolean TdjPathMap::Matches | ( | const string | Path,
|  | const string | Spec,
|  | TSpecType | SpecType )
| protected

Parameters

  Path | the URL document path
  Spec | the path specification (for example, '/*')
  SpecType | the path specification type

Returns
  True if the Path mathes the Spec (with known SpecType)