TUriSegmentStack Class
A cursor over an ordered list of URI path segments, supporting look-ahead and forward/backward navigation.
Remarks
Used when matching a request path against route templates: Pop advances to the next segment, Peek inspects segments relative to the current position, and Push steps back to a previous segment.
Syntax
Unit: Sparkle.Uri
TUriSegmentStack = class(TObject);
Constructors
| Name | Description |
|---|---|
| Create | Creates a segment stack over the given array of segments, positioned at the first segment. |
Methods
| Name | Description |
|---|---|
| Count | Returns the number of segments remaining from the current position to the end. |
| Peek | Returns the segment at the given offset from the current position without advancing. |
| Pop | Returns the current segment and advances the position to the next one. |
| Push | Steps the position back to the previous segment, without going before the first one. |
| ToString | Returns all segments joined by / into a single string. |