cli20 0.1.2
A C++20 typed-schema command-line parser
Loading...
Searching...
No Matches
cli::conversion::Bool Struct Reference

Converts a string token to bool. More...

#include <action.hh>

Public Types

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

Public Member Functions

constexpr auto operator() (ActionCtx< void > ctx, ActionResult< std::string_view > input) const -> ActionResult< bool >

Static Public Attributes

template<class Input>
static constexpr bool accepts_input

Detailed Description

Converts a string token to bool.

Accepts "true" / "1" → true and "false" / "0" → false. Returns ErrorCode::invalid_value for any other input.

Definition at line 768 of file action.hh.

Member Typedef Documentation

◆ after_type

template<class Input>
using cli::conversion::Bool::after_type = bool

Definition at line 775 of file action.hh.

◆ storage_type

template<class Prev>
using cli::conversion::Bool::storage_type = void

Definition at line 778 of file action.hh.

Member Function Documentation

◆ operator()()

auto cli::conversion::Bool::operator() ( ActionCtx< void > ctx,
ActionResult< std::string_view > input ) const -> ActionResult< bool >
inlineconstexpr

Definition at line 780 of file action.hh.

Member Data Documentation

◆ accepts_input

template<class Input>
bool cli::conversion::Bool::accepts_input
staticconstexpr
Initial value:
=
std::same_as<std::remove_cvref_t<Input>, std::string_view> ||
std::same_as<std::remove_cvref_t<Input>, std::string>

Definition at line 770 of file action.hh.


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