maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
Public Member Functions | List of all members
httplib::detail::PathParamsMatcher Class Referencefinal

Captures parameters in request path and stores them in Request::path_params. More...

`#include <httplib.h>`

Inheritance diagram for httplib::detail::PathParamsMatcher:
Collaboration diagram for httplib::detail::PathParamsMatcher:

## Public Member Functions
| PathParamsMatcher (const std::string &pattern)
bool | match (Request &request) const override
const std::string & | pattern () const

## Detailed Description

Captures parameters in request path and stores them in Request::path_params.

Capture name is a substring of a pattern from : to /. The rest of the pattern is matched against the request path directly Parameters are captured starting from the next character after the end of the last matched static pattern fragment until the next /.

Example pattern: "/path/fragments/:capture/more/fragments/:second_capture" Static fragments: "/path/fragments/", "more/fragments/"

Given the following request path: "/path/fragments/:1/more/fragments/:2" the resulting capture will be {{"capture", "1"}, {"second_capture", "2"}}

Definition at line 1013 of file httplib.h.

## Constructor & Destructor Documentation

## ◆ PathParamsMatcher()

httplib::detail::PathParamsMatcher::PathParamsMatcher | ( | const std::string & | pattern | ) |
| inline

Definition at line 7156 of file httplib.h.

References httplib::detail::MatcherBase::pattern().

Here is the call graph for this function:

## Member Function Documentation

## ◆ match()

bool httplib::detail::PathParamsMatcher::match | ( | Request & | request | ) | const
| inline override virtual

Implements httplib::detail::MatcherBase.

Definition at line 7205 of file httplib.h.

References httplib::Request::matches, httplib::Request::path, and httplib::Request::path_params.

## ◆ pattern()

const std::string & httplib::detail::MatcherBase::pattern | ( |  | ) | const
| inline inherited

Definition at line 986 of file httplib.h.

Referenced by PathParamsMatcher().

Here is the caller graph for this function:

The documentation for this class was generated from the following file:

- integrations/rest_api/httplib.h