cli20 0.1.2
A C++20 typed-schema command-line parser
Loading...
Searching...
No Matches
cli::validation::Matches< Pattern > Struct Template Reference

Validates that the input string matches a compile-time regular expression. More...

#include <action.hh>

Public Types

template<class Prev>
using after_type = Prev
template<class Prev>
using storage_type = void

Public Member Functions

template<class U>
auto operator() (ActionCtx< void > ctx, ActionResult< U > input) const -> ActionResult< U >

Static Public Attributes

template<class Prev>
static constexpr bool accepts_input = detail::StringLike<Prev>

Detailed Description

template<StringLiteral Pattern>
struct cli::validation::Matches< Pattern >

Validates that the input string matches a compile-time regular expression.

Uses std::regex_match (full-match semantics). Returns ErrorCode::validation_failed when the string does not match.

Template Parameters
PatternThe regex pattern string (e.g. "[a-z]+").

Definition at line 1288 of file action.hh.

Member Typedef Documentation

◆ after_type

template<StringLiteral Pattern>
template<class Prev>
using cli::validation::Matches< Pattern >::after_type = Prev

Definition at line 1293 of file action.hh.

◆ storage_type

template<StringLiteral Pattern>
template<class Prev>
using cli::validation::Matches< Pattern >::storage_type = void

Definition at line 1296 of file action.hh.

Member Function Documentation

◆ operator()()

template<StringLiteral Pattern>
template<class U>
auto cli::validation::Matches< Pattern >::operator() ( ActionCtx< void > ctx,
ActionResult< U > input ) const -> ActionResult< U >
inline

Definition at line 1299 of file action.hh.

Member Data Documentation

◆ accepts_input

template<StringLiteral Pattern>
template<class Prev>
bool cli::validation::Matches< Pattern >::accepts_input = detail::StringLike<Prev>
staticconstexpr

Definition at line 1290 of file action.hh.


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