TTMSMCPResources.FindMatchingTemplate Method
Looks up the first template entry whose pattern covers an address.
API unit family: TMS.MCP.Resources
Declaring type: TTMSMCPResources
Syntax
function FindMatchingTemplate(const URI: string): TTMSMCPResource;
Remarks
Both sides are split on slashes and compared segment by segment: a segment written between braces accepts any one segment, every other segment has to be equal, and the two have to have the same number of segments, so a variable never spans a slash. Entries are examined in the order they were added and the first match wins, so register the more specific pattern first when two patterns overlap.
Parameters
| Name | Description |
|---|---|
URI |
Expanded address to match against the registered patterns. |
Returns
The matching entry, which stays owned by the collection and must not be freed, or nil when no pattern covers the address.
Exceptions
| Exception | Description |
|---|---|
EJsonRpcException |
Raised with invalid-parameters, error code -32602, when the address is empty. |