Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | List of all members
seastar::httpd::param_matcher Class Reference

Detailed Description

Check if the url match a parameter and fill the parameters object

Note that a non empty url will always return true with the parameters object filled

Assume that the rule is /file/{path}/ and the param_matcher identify the /{path}

For all non empty values, match will return true. If the entire url is /file/etc/hosts, and the part that is passed to param_matcher is /etc/hosts, if entire_path is true, the match will be '/etc/hosts' If entire_path is false, the match will be '/etc'

#include <seastar/http/matcher.hh>

Inheritance diagram for seastar::httpd::param_matcher:
seastar::httpd::matcher

Public Member Functions

 param_matcher (const sstring &name, bool entire_path=false)
 
virtual size_t match (const sstring &url, size_t ind, parameters &param) override
 

Constructor & Destructor Documentation

◆ param_matcher()

seastar::httpd::param_matcher::param_matcher ( const sstring &  name,
bool  entire_path = false 
)
inlineexplicit

Constructor

Parameters
namethe name of the parameter, will be used as the key in the parameters object
entire_pathwhen set to true, the matched parameters will include all the remaining url until the end of it. when set to false the match will terminate at the next slash

Member Function Documentation

◆ match()

virtual size_t seastar::httpd::param_matcher::match ( const sstring &  url,
size_t  ind,
parameters param 
)
overridevirtual

check if the given url matches the rule

Parameters
urlthe url to check
indthe position to start from
paramfill the parameters hash
Returns
the end of of the matched part, or sstring::npos if not matched

Implements seastar::httpd::matcher.


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