Goby3  3.1.5a
2024.05.23
httplib::detail::PathParamsMatcher Class Reference

#include <goby/util/thirdparty/cpp-httplib/httplib.h>

Inheritance diagram for httplib::detail::PathParamsMatcher:
httplib::detail::MatcherBase

Public Member Functions

 PathParamsMatcher (const std::string &pattern)
 
bool match (Request &request) const override
 
- Public Member Functions inherited from httplib::detail::MatcherBase
virtual ~MatcherBase ()=default
 

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 agains 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 727 of file httplib.h.

Constructor & Destructor Documentation

◆ PathParamsMatcher()

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

Definition at line 6081 of file httplib.h.

Member Function Documentation

◆ match()

bool httplib::detail::PathParamsMatcher::match ( Request request) const
inlineoverridevirtual

Implements httplib::detail::MatcherBase.

Definition at line 6134 of file httplib.h.


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