25namespace pcre2_details
33template <
typename Traits >
101 rw.m_route_regex =
nullptr;
109 rw.m_route_regex =
nullptr;
139 reinterpret_cast< const unsigned char*
>(
r.data() ),
141 static_cast<unsigned int>(
options),
148 std::array< unsigned char, 256 > buffer;
153 "unable to compile regex \"{}\": {}" ),
155 reinterpret_cast< const char *
>( buffer.data() ) ) };
167template < std::
size_t Max_Capture_Groups = 20,
int Compile_Options = 0,
int Match_Options = 0 >
180template <
typename Traits = pcre2_traits_t<> >
188 static constexpr std::size_t
191 return Traits::max_capture_groups;
202 int options = Traits::compile_options;
222 reinterpret_cast< const unsigned char*
>(
target_path.data() ),
225 Traits::match_options,
238 throw exception_t{
"unexpected: not enough submatch vector size" };
254 return static_cast< std::size_t
>(
m.m_begin );
261 return static_cast< std::size_t
>(
m.m_end );
Exception class for all exceptions thrown by RESTinio.
A wrapper for using pcre regexes in express_router.
regex_t(regex_t &&rw) noexcept
regex_t(const regex_t &)=delete
regex_t & operator=(const regex_t &)=delete
void compile(string_view_t r, int options)
regex_t(string_view_t r, int options)
pcre2_code * m_route_regex
const pcre2_code * pcre2_regex() const
A special wrapper around fmtlib include files.
#define RESTINIO_FMT_FORMAT_STRING(s)
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.
std::string_view string_view_t
matched_item_descriptor_t(PCRE2_SIZE begin, PCRE2_SIZE end)
A wrapper class for working with pcre match results.
match_results_t & operator=(const match_results_t &)=delete
pcre2_match_data * m_match_data
match_results_t(const match_results_t &)=delete
matched_item_descriptor_t operator[](std::size_t i) const
match_results_t(match_results_t &&)=delete
Regex engine implementation for PCRE2.
static auto submatch_end_pos(const matched_item_descriptor_t &m)
Get the end of a submatch.
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.
typename match_results_t::matched_item_descriptor_t matched_item_descriptor_t
static auto compile_regex(string_view_t r, bool is_case_sensative)
Create compiled regex object for a given route.
static auto submatch_begin_pos(const matched_item_descriptor_t &m)
Get the beginning of a submatch.
static constexpr std::size_t max_capture_groups()
static constexpr int match_options
static constexpr std::size_t max_capture_groups
static constexpr int compile_options