RESTinio

Public Types | Static Public Member Functions | List of all members
restinio::router::std_regex_engine_t Struct Reference

Regex engine implementation for using with standard regex implementation. More...

`#include <std_regex_engine.hpp>`

## Public Types
using | compiled_regex_t = std::regex
using | match_results_t = std::vector< std::pair< std::size_t, size_t > >
using | matched_item_descriptor_t = match_results_t::value_type

## Static Public Member Functions
static constexpr std::size_t | max_capture_groups ()
static auto | compile_regex (string_view_t r, bool is_case_sensative)
| Create compiled regex object for a given route. More...
static auto | try_match (string_view_t target_path, const compiled_regex_t &r, match_results_t &match_results)
| Wrapper function for matching logic invokation. More...
static auto | submatch_begin_pos (const matched_item_descriptor_t &m)
| Get the beginning of a submatch. More...
static auto | submatch_end_pos (const matched_item_descriptor_t &m)
| Get the end of a submatch. More...

## Detailed Description

Regex engine implementation for using with standard regex implementation.

Examples
  sample/extra_data_factory/main.cpp.

Definition at line 24 of file std_regex_engine.hpp.

## Member Typedef Documentation

## ◆ compiled_regex_t

using restinio::router::std_regex_engine_t::compiled_regex_t = std::regex

Definition at line 26 of file std_regex_engine.hpp.

## ◆ match_results_t

using restinio::router::std_regex_engine_t::match_results_t = std::vector< std::pair< std::size_t, size_t > >

Definition at line 27 of file std_regex_engine.hpp.

## ◆ matched_item_descriptor_t

using restinio::router::std_regex_engine_t::matched_item_descriptor_t = match_results_t::value_type

Definition at line 28 of file std_regex_engine.hpp.

## Member Function Documentation

## ◆ compile_regex()

static auto restinio::router::std_regex_engine_t::compile_regex | ( | string_view_t | r,
|  | bool | is_case_sensative
| ) |  |
| inline static

Create compiled regex object for a given route.

Parameters

  r | Regular expression (the pattern).
  is_case_sensative | Option for case sensativity.

Definition at line 40 of file std_regex_engine.hpp.

## ◆ max_capture_groups()

static constexpr std::size_t restinio::router::std_regex_engine_t::max_capture_groups | ( |  | ) |
| inline static constexpr

Definition at line 31 of file std_regex_engine.hpp.

## ◆ submatch_begin_pos()

static auto restinio::router::std_regex_engine_t::submatch_begin_pos | ( | const matched_item_descriptor_t & | m | ) |
| inline static

Get the beginning of a submatch.

Definition at line 86 of file std_regex_engine.hpp.

## ◆ submatch_end_pos()

static auto restinio::router::std_regex_engine_t::submatch_end_pos | ( | const matched_item_descriptor_t & | m | ) |
| inline static

Get the end of a submatch.

Definition at line 93 of file std_regex_engine.hpp.

## ◆ try_match()

static auto restinio::router::std_regex_engine_t::try_match | ( | string_view_t | target_path,
|  | const compiled_regex_t & | r,
|  | match_results_t & | match_results
| ) |  |
| inline static

Wrapper function for matching logic invokation.

Definition at line 58 of file std_regex_engine.hpp.

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

- restinio/router/std_regex_engine.hpp