RESTinio
Public Types | Public Member Functions | Private Attributes | List of all members
restinio::router::impl::route_matcher_t< Regex_Engine > Class Template Reference

A matcher for a given path. More...

#include <express.hpp>

Public Types

using regex_t = typename Regex_Engine::compiled_regex_t
 
using match_results_t = typename Regex_Engine::match_results_t
 

Public Member Functions

 route_matcher_t (http_method_id_t method, regex_t route_regex, std::shared_ptr< std::string > named_params_buffer, param_appender_sequence_t param_appender_sequence)
 Creates matcher with a given parameters. More...
 
 route_matcher_t ()=default
 
 route_matcher_t (route_matcher_t &&)=default
 
bool match_route (string_view_t target_path, route_params_t &parameters) const
 Try to match a given request target with this route. More...
 
bool operator() (const http_request_header_t &h, route_params_t &parameters) const
 

Private Attributes

http_method_id_t m_method
 HTTP method to match. More...
 
regex_t m_route_regex
 Regex of a given route. More...
 
std::shared_ptr< std::string > m_named_params_buffer
 Buffer for named parameters names string views. More...
 
param_appender_sequence_t m_param_appender_sequence
 Parameters values. More...
 

Detailed Description

template<typename Regex_Engine = std_regex_engine_t>
class restinio::router::impl::route_matcher_t< Regex_Engine >

A matcher for a given path.

Definition at line 278 of file express.hpp.

Member Typedef Documentation

◆ match_results_t

template<typename Regex_Engine = std_regex_engine_t>
using restinio::router::impl::route_matcher_t< Regex_Engine >::match_results_t = typename Regex_Engine::match_results_t

Definition at line 282 of file express.hpp.

◆ regex_t

template<typename Regex_Engine = std_regex_engine_t>
using restinio::router::impl::route_matcher_t< Regex_Engine >::regex_t = typename Regex_Engine::compiled_regex_t

Definition at line 281 of file express.hpp.

Constructor & Destructor Documentation

◆ route_matcher_t() [1/3]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::impl::route_matcher_t< Regex_Engine >::route_matcher_t ( http_method_id_t  method,
regex_t  route_regex,
std::shared_ptr< std::string >  named_params_buffer,
param_appender_sequence_t  param_appender_sequence 
)
inline

Creates matcher with a given parameters.

Definition at line 285 of file express.hpp.

◆ route_matcher_t() [2/3]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::impl::route_matcher_t< Regex_Engine >::route_matcher_t ( )
default

◆ route_matcher_t() [3/3]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::impl::route_matcher_t< Regex_Engine >::route_matcher_t ( route_matcher_t< Regex_Engine > &&  )
default

Member Function Documentation

◆ match_route()

template<typename Regex_Engine = std_regex_engine_t>
bool restinio::router::impl::route_matcher_t< Regex_Engine >::match_route ( string_view_t  target_path,
route_params_t parameters 
) const
inline

Try to match a given request target with this route.

Definition at line 301 of file express.hpp.

◆ operator()()

template<typename Regex_Engine = std_regex_engine_t>
bool restinio::router::impl::route_matcher_t< Regex_Engine >::operator() ( const http_request_header_t h,
route_params_t parameters 
) const
inline

Definition at line 368 of file express.hpp.

Member Data Documentation

◆ m_method

template<typename Regex_Engine = std_regex_engine_t>
http_method_id_t restinio::router::impl::route_matcher_t< Regex_Engine >::m_method
private

HTTP method to match.

Definition at line 377 of file express.hpp.

◆ m_named_params_buffer

template<typename Regex_Engine = std_regex_engine_t>
std::shared_ptr< std::string > restinio::router::impl::route_matcher_t< Regex_Engine >::m_named_params_buffer
private

Buffer for named parameters names string views.

Definition at line 383 of file express.hpp.

◆ m_param_appender_sequence

template<typename Regex_Engine = std_regex_engine_t>
param_appender_sequence_t restinio::router::impl::route_matcher_t< Regex_Engine >::m_param_appender_sequence
private

Parameters values.

Definition at line 386 of file express.hpp.

◆ m_route_regex

template<typename Regex_Engine = std_regex_engine_t>
regex_t restinio::router::impl::route_matcher_t< Regex_Engine >::m_route_regex
private

Regex of a given route.

Definition at line 380 of file express.hpp.


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